The backend server for the marks management system which is aimed to be used by universites and other educational institutes.
- Supports Multiple User Type (Admin, Teacher, Student, ExamHead)
- Supports Bulk Data Import (csv)
- Student can view their marks, syllabus and other details.
- Teacher can add, view marks for their courses
- Admin can overview overall processes of the system.
- Supports multiple academic divisions: faculties, departments, programs and syllabus
- Supports more: Semester upgrade, marks mgmt and export, role mgmt, course mgmt,....
Make sure you have the following tools installed on your machine
- Docker
- Postman
- Node
- Pnpm
- Vscode (extensions: Prettier, Prisma, Eslint, GitLens)
- Run
cp .env.example .env
and edit
.env
file with required details (JWT_SECRET, DATABASE_URL,...) - Install dependencies
npm install -g pnpm && pnpm install
- To setup database connection
pnpm exec prisma migrate dev
- To run locally
pnpm run dev
- Update the
prisma/schema.prisma
file as necessary - Run
pnpm exec prisma migrate dev
- This will update database and generate prisma client
- For more details :
- Visit prisma's website https://www.prisma.io/docs
- Or, run
pnpm exec prisma help
- A basic project structure
- Subject to change over time
.
└── src
├── db -> Where the db related files will be stored
├── index.js -> entry point for the node
├── middlewares -> Where the middlewares will stored
└── routes -> Where the routes(controllers) will be stored
- Method - 1
- Install
docker
on your machine - Pull
postgres
image
docker pull postgres:latest
- Run the following command
docker run --name psql-dev \
-e POSTGRES_PASSWORD=test1234 \
-p 5432:5432 postgres
This will start a postgres instance at TCP port 5432 with username
postgres
and passwordtest1234
- You can access the postgres acces as such
docker exec -it psql-dev bash
psql -h localhost -U postgres
- From next time, just run
docker start psql-dev
to start the container
- Method-2
- Use the
aiven.io
postgres setup
- Explicitly define response's
status code
- Explicit
return
after sending response - Explicitly set return
content-type
res
.status(401)
.json(
errorResponse(
"Authentication Error",
"Please provide valid login credentials."
)
)
return
- Explicity set request body
content-type
- A database helper function should return with
toResult()
function
- Add endpoint API documentation (use swagger)