Clone the Repository:
In the terminal, use the following command to clone the repository:
git clone https://github.com/Rushikesh8603/Backend-intern.git
Navigate to the Cloned Directory:
Once the repository is cloned, navigate into the folder:
cd Backend-intern
change db.js in config according to your postgressql
chage user , host, databse , password , port according to your database
const { Pool } = require('pg');
const pool = new Pool({
user: 'postgres', #
host: 'localhost',
database: 'rushi',
password: '8603@Rushi',
port: 5432,
});
pool.connect()
.then(() => console.log('Connected to PostgreSQL'))
.catch((err) => console.error('Database connection error:', err));
module.exports = pool;
npm install
npx nodemon server.js
/auth/signup
ex - http://localhost:5000/auth/signup
{
"name": "Rushi Patare",
"email": "student@slate.com",
"password": "11111",
"role": "Student",
"linked_student_id": "202"
}
/student/add
ex- http://localhost:5000/student/add { "student_id": 202, "name": "Rushi Patare", "school_name": "ABC School", "grade": "10th", "achievements": "Science Olympiad Winner" }
for login
/auth/login
ex - http://localhost:5000/auth/login
{
"email": "student@slate.com",
"password": "11111",
"role": "Student"
}
api end point
student/achievements/{student_id}
ex - http://localhost:5000/student/achievements/202
=======