The Student Management System is a CRUD application designed to manage student data. It provides functionalities for adding, updating, deleting, and retrieving student information. The backend is built using Node.js, Express, and PostgreSQL.
- User authentication with Passport.js
- CRUD operations for student data
- Token-based authentication with JWT
- Session management with express-session
- Flash messages for authentication feedback
StudentManagementSystem/
├── controllers/
│ └── student.controller.js
├── middlewares/
│ └── LocalStrategy.js
│ └── VerifyToken.js
├── queries/
│ └── Queries.js
├── routes/
│ └── Auth.route.js
│ └── Student.route.js
├── .gitignore
├── index.js
├── db.js
├── package-lock.json
├── package.json
└── README.md
- Clone the repository:
git clone https://github.com/CollinsKipkemoi/Student-Management-System.git
- Navigate to the project directory:
cd StudentManagementSystem - Install the dependencies:
npm install
- Set up the environment variables by creating a
.envfile in the root directory:PORT=3000 SESSION_SECRET=your_session_secret DATABASE_URL=your_database_url DB_USER=your_database_user DB_PASSWORD=your_database_password DB_HOST=your_database_host DB_PORT=your_database_port DB_NAME=your_database_name SESSION_SECRET=your_session_secret JWT_SECRET=your_jwt_secret
- Start the server:
npm run dev
- The server will be running on
http://localhost:3000.
POST /auth/login- Login a userGET /auth/success- Redirect on successful loginGET /auth/failure- Redirect on failed login
GET /api/- Test endpointGET /api/students- Get all studentsPOST /api/students- Add a new studentGET /api/students/:id- Get a student by IDDELETE /api/students/- Delete a student by emailPUT /api/students/- Update a student by email
Contributions are welcome! Please open an issue or submit a pull request for any changes.
This project is licensed under the ISC License.
Collins Kipkemoi