Front-end training project for viewing subjects and courses.
*MirageJS code is not in typescript since it is not yet fully supported.
https://mvalleza-elearning-vue.vercel.app/
Due to absence of a backend, the endpoints have been mocked using MirageJS
The MirageJS configs can be found in src/mock-server
Note that whatever data you created will be lost once you refresh the app since they are saved within the front-end instance only.
To persist data, we can save it into localStorage by configuring it in our env file. (See installation section)
The initial start of the app might run slow since MirageJS is seeding mock data.
These mock implementations can possibly be removed once an actual backend has been implemented for this.
yarn install
Before running the project, make sure to setup a .env file at the root folder.
We need to put the API namespace and APP env to make sure MirageJS will run:
VITE_APP_ENV=test
VITE_API_NAMESPACE=/api
Additionally, if you want data to persist for MirageJS, add this in the ENV file (true is recommended in order to mock sessions):
VITE_MIRAGE_PERSISTENCE=true
Finally, run the project with:
yarn dev
Unit tests for webservices and store functions are provided.
You can run them with:
yarn test
There are 3 users:
- Admin
- Instructor
- Student
Sample accounts are available:
Default instructor (w/ sample subjects, courses, and modules)
email: tr1@test
password: 123
Default Student
email: s@test
password: 123
Admin
email: admin@test
password: 123
Creating an account is still possible even without the backend.
Simply go through the registration process as normal.
No email verification has been set yet since actual sending of email is not present in the mocks. Instead, a temporary button that will redirect and activate the user to verification will appear in the app.