- add the following file in db
db/init.js
db = db.getSiblingDB('admin');
db.createUser({
user: "username",
pwd: "password",
roles: [{ role: "readWrite", db: "admin" }]
});
- add .env in the root
MONGODB_HOST=mongodb
MONGODB_PORT=27017
MONGO_INITDB_ROOT_USERNAME=vanshika
MONGO_INITDB_ROOT_PASSWORD=password
MONGO_INITDB_DATABASE=admin
PORTAL_HOST=portal
PORTAL_PORT=8000
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_CLIENT_REDIRECT_URL=
JWT_SECRET=
JWT_EXPIRY=
- Run the following command in terminal
docker compose --env-file .env up --build
- add .env with this additional key
MONGO_TEST='your mongodb cloud atlas url goes here'
Header | Type | Description |
---|---|---|
Authorization | string | Required. Bearer token for authorization |
POST /portal/v1/auth/register
Parameter | Type | Description |
---|---|---|
name |
string |
Required |
email |
string |
Required |
password |
string |
Required |
confirmPassword |
string |
Required |
role |
string |
Required. 'admin' or 'user' |
POST /portal/v1/auth/login
Parameter | Type | Description |
---|---|---|
type |
string |
Required. 'google' or 'custom' |
email |
string |
Required for type 'custom' |
password |
string |
Required. for type 'custom' |
GET /portal/v1/admin/assignments
POST /portal/v1/admin/assignments/:id/:action
Path Parameter | Type | Description |
---|---|---|
id |
string | Required. The ID of the assignment |
action |
string | Required. The action to perform (accept , reject ) |
Parameter | Type | Description |
---|---|---|
feedback |
string | Optional |
POST /portal/v1/user/upload
Parameter | Type | Description |
---|---|---|
userId |
string |
Required |
assignmentId |
string |
Required |
assignmentContent |
string |
Required |
adminId |
string |
Required |
GET /portal/v1/user/admins
POST portal/v1/assignment/create
Parameter | Type | Description |
---|---|---|
title |
string |
Required |
subtitle |
string |
Optional |
description |
string |
Optional |
dueDate |
string |
Required |
maxMarks |
string |
Optional |
fileName |
string |
Optional |
fileUrl |
string |
Optional |
- bcrypt - Password hashing.
- joi - Input validation.
- jwt - Token creation/verification.
- express - Web server framework.
- mongoose - MongoDB ORM.
- jest - Unit testing framework.
- axios - HTTP client for API requests.
- googleapis - Google OAuth and API integration.
https://github.com/Vanshika-Dargan/assignment-portal-frontend