Skip to content

Rushikesh8603/Backend-intern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"
	}

this is for adding student achievement

/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"
}

now fetch students achievement using api

api end point

student/achievements/{student_id}

ex - http://localhost:5000/student/achievements/202

=======

Backend-intern

About

Backend-intern is a Node.js and Express.js-based backend application designed to manage user authentication and interactions with a PostgreSQL database. It provides RESTful API endpoints for user registration and login functionalities.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors