This is the backend site for the college placement system, which allows TNP (Training and Placement) staff to add students, their scores, and manage interviews and reports. The site is built using EJS as the templating engine, Node.js as the runtime environment, and MongoDB as the database.
To get started with the backend site, follow the instructions below:
- Node.js installed on your machine. You can download it from the official website: Node.js
- MongoDB Atlas account. You can create one at MongoDB Atlas. Register yourself on Mongo db atlas and use your URI for connection.
-
Clone the repository:
git clone https://github.com/your-username/college-placement-backend.git
-
Change into the project directory:
cd NITJSR-backend
-
Install the dependencies:
npm install
-
Set up the environment variables:
- Create a .env file in the project root directory.
- Add the following variables and provide appropriate values:
PORT=8080 MONGODB_URI=YOUR_MONGODB_URI
Note: Replace YOUR_MONGODB_URI with the MongoDB connection URI obtained from MongoDB Atlas.
- Start the server:
npm start
- The backend site will be available at http://localhost:8080.
├── config # Contains databse connection
├── controllers # Contains route handlers and business logic
├── models # Defines the data models using Mongoose
├── public # Static files (CSS, JS, images)
├── routes # Defines the API routes
├── views # EJS templates for rendering HTML
├── index.js # Entry point of the application
└── .env # Environment variables
The backend site is deployed on Render.com. Follow the instructions below to deploy the site on Render.com:
-
Sign up for an account on Render.com if you don't have one.
-
Click on "Create a new service" on the Render dashboard.
-
Select "Web Service" as the service type.
-
Connect your GitHub repository that contains the backend site.
-
Configure the following settings for the deployment:
-
Build Command:
npm install
-
Start Command:
npm start
-
-
Click on "Create Web Service" to start the deployment.
-
Render will automatically build and deploy your backend site. Once the deployment is complete, you will be provided with a unique URL for your backend site.
-
Access your deployed backend site by visiting the provided URL.
You can visit the live deployed site for the College Placement Backend at https://nitjsr-backend.onrender.com.
###License This project is licensed under the MIT License.
In the .env
file, replace YOUR_MONGODB_URI
with the actual MongoDB connection URI obtained from MongoDB Atlas. This will ensure that your application connects to the appropriate MongoDB database.