This is a basic student portal where authorized users can view student data, update it, and add new students.
- Frontend: EJS
- Backend: Node.js, MySQL, Redis
app.js
: Specifies the port the app is using.loader.js
: Loads necessary files and sets global restrictions on the app (e.g., URL encoding).router.js
: Defines routes, middleware, and controllers.services/
: Contains files for database and Redis services.middleware/
: Houses functions for authentication and sending responses.controllers/
: Contains logic for APIs using services.config/
: Holds configuration files, such as database configuration.models/
: Defines database models, like the student model.test/
: Contains unit tests for APIs using Jest.utilities/
: Includes files for database connection, response validation, and session handling.views/
: Contains EJS templates for the frontend.
- If
ENV
is set totest
, the application will only send API responses without authentication. - If
ENV
is set toproduction
, the application will perform authentication and render the frontend using EJS with the help of API responses.
- Ensure MySQL and Redis services are running.
- Run
npm install
. - Change the environment to
production
in the.env
file to render the frontend. - Run
npm start
. - The application will run on port 3000.
Thanks to the following contributors for their valuable contributions to this project: