bcs2021_035@iiitm.ac.in / abc12345 (Student)
bcs2021_012@iiitm.ac.in / abc12345 (Admin)
bcs2021_072@iiitm.ac.in / abc12345 (Security)
Paper: Click Here
UI Design (Figma): Click Here
Frontend Repo: Click Here
This is a simple guide to help you locally setup the backend for development.
Before proceeding with the installation, make sure you have the following prerequisites installed on your machine:
Follow these steps to install and run the Node Express app locally:
-
Fork the Repo & Clone to the repository to your local machine:
git clone <forked url>
-
Navigate to the project directory:
cd guardian-server
-
Duplicate the
.env.template
file in the project and rename it to.env
file and configure the environment variables as needed.PORT=8000 MONGO_URL=mongodb://localhost:27017/Guardian REDIS_HOST="localhost" SESS_SECRET=1234567890 GMAIL_ID= (Google email) GMAIL_APP_PASS= (Google App Password from 2FA option) CLOUDINARY_NAME= (Cloudinary Credentials) CLOUDINARY_APIKEY= (Cloudinary Credentials) CLOUDINARY_APISECRET= (Cloudinary Credentials)
NOTE: You do not necessarily need to setup GMAIL / CLOUDINARY environments to run the server, they are only needed for specific functions like sending Email & updating images.
NOTE: Google App Password is not the same as your regular password! (Guide) -
Start docker & then run the following command to start redis & mongoDB containers (Verify all containers are running in docker):
docker-compose up -d --build
-
Run the script to install dependencies:
npm i
-
Run the start command:
npm run dev
-
You'll need a client like Postman / Thunder Client (or Guardian Frontend set up locally) to test the API endpoints. From the imports folder, Import the "api-endpoints-postman.json" file in postman to import all the routes in postman or "api-endpoints-thunder.json" in thunder if you prefer Thunder Client.
-
You can access Redis-commander GUI tool on http://localhost:8081 & mongo-express GUI tool on http://localhost:8082 for managing database. The server should be live at http://localhost:8000.
NOTE: You can import sample mongoDB data for testing from imports/Guardian.users & imports/Guardian.outings using mongo-express GUI tool.
If you would like to contribute to this project, please follow these guidelines:
- Set up the repository on locally.
- Create a new branch with your name in it from the
main
branch for your changes. - Make your modifications, add features, or fix bugs.
- Ensure that your code adheres to the project's coding conventions and style.
- Commit your changes and push them to your fork.
- Submit a pull request describing your changes