Skip to content

create2000/Exam-CBT

Repository files navigation

React + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

Expanding the ESLint configuration

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.

Nigerian Past-Questions Architecture

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 the AlocQuestion model.
  • 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.

Setup Instructions

  1. Set your ALOC Access Token:

    • You must have the ALOC_ACCESS_TOKEN set in your environment or in a .env file before running the app.
    • Example .env:
      ALOC_ACCESS_TOKEN=your_token_here
  2. 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 push to forcefully push the schema in a local development environment.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors