This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the TS template for information on how to integrate TypeScript and typescript-eslint in your project.
This app uses a database-backed system for ALOC past questions.
- Admin Prefetching: Only admins fetch questions from the ALOC API. This is done via the "Manage ALOC Past Questions" tab in the Admin Dashboard.
- Database Storage: Fetched questions are normalized and stored permanently in the local SQLite database (
dev.db) under theAlocQuestionmodel. - Upserting: Re-running a prefetch for the same subject/type/year safely updates existing questions rather than duplicating them.
- Student Access: Students read questions directly from the local database with zero network calls, ensuring speed and reliability.
-
Set your ALOC Access Token:
- You must have the
ALOC_ACCESS_TOKENset in your environment or in a.envfile before running the app. - Example
.env:ALOC_ACCESS_TOKEN=your_token_here
- You must have the
-
Run Prisma Migrations:
- After setting up the project, you need to apply the database schema changes for the ALOC models.
- Run the following command:
npx prisma migrate dev --name aloc_integration
- Note: If you face issues with a dirty shadow database, you can use
npx prisma db pushto forcefully push the schema in a local development environment.