Client - MathparLearningTeam/Documentation GitHub Wiki

API

apiClient.ts unifies all API calls. It adds URL prefixes and request headers, handles errors, serializes request parameters. If you need to add something that are applied to all API calls, please add it to this file.

Every backend service should have its own request methods containing file in api directory (ex. accountAPI.ts is for AccountService, schoolAPI.ts is for SchoolService).

AccountMixin contains all methods that communicate with AccountService on the backend. Is uses request methods declared in accountAPI.ts file. All components and views that work with AccountService should include AccountMixin to its mixins array, so that it can call account methods.

SchoolMixin contains all methods that communicate with SchoolService on the backend. Is uses request methods declared in schoolAPI.ts file. All components and views that work with SchoolService should include SchoolMixin to its mixins array, so that it can call account methods.

Assets

Static files (images, fonts etc.) should be placed in assets directory.

Views

Components that act as views (has a reference in routes) should be placed in views directory.

Components

Reusable components and components that are not act as views for routing should be placed in components directory. shared directory is for reusable components; school and profile contain components that are only used in views corresponding its backend services.