Skip to content

A backend API system that allows students to authenticate, view available time slots, and book appointments with professors. Professors can authenticate and specify their availability for appointments. The system is built with Node.js, Express.js, and uses MongoDB for database management. Deployed on Heroku for scalability and reliability.

Notifications You must be signed in to change notification settings

Hemanshi2954/College-Appointment-System-API

Repository files navigation

📅 College Appointment System API

The College Appointment System API allows students to book appointments with professors. Professors can specify their availability, and students can authenticate, view available slots, and book appointments.

✨ Live Demo

College Appointment System API

Features

  • ✅ User authentication (Students & Professors)
  • ✅ Professors can specify available time slots
  • ✅ Students can view available slots and book appointments
  • ✅ Secure data handling using MongoDB
  • ✅ Deployed on Render

💻 Tech Stack

  • Backend: Node.js, Express.js
  • Database: MongoDB (Free version)
  • Deployment: Render
  • Authentication: JSON Web Tokens (JWT)

🚀 Installation & Setup

Prerequisites

Ensure you have the following installed:

  • Node.js
  • npm or yarn
  • MongoDB (if running locally)

Clone Repository

git clone <repository-url>
cd college-appointment-system-api

Install Dependencies

npm install

Setup Environment Variables

Create a .env file in the root directory and add:

PORT=5000
MONGODB_URI=<your-mongodb-uri>
JWT_SECRET=<your-secret-key>

Run the Server Locally

npm run dev

The API will be available at http://localhost:5000.

API Endpoints

Authentication

User Login

POST /api/auth/login

Request Body:

{
  "email": "user@example.com",
  "password": "password123"
}

Response:

{
  "token": "your-jwt-token"
}

Professors

Set Availability

POST /api/professors/availability

Request Body:

{
  "professorId": "12345",
  "availableSlots": ["2025-02-12T10:00:00Z", "2025-02-12T14:00:00Z"]
}

Students

View Available Slots

GET /api/professors/12345/availability

Response:

{
  "availableSlots": ["2025-02-12T10:00:00Z", "2025-02-12T14:00:00Z"]
}

Book an Appointment

POST /api/appointments/book

Request Body:

{
  "studentId": "67890",
  "professorId": "12345",
  "time": "2025-02-12T10:00:00Z"
}

☑️ Deployment on Render

Steps to Deploy

  1. Push the code to GitHub.
  2. Sign in to Render and create a new Web Service.
  3. Connect your GitHub repository.
  4. Set environment variables in Render's Environment section.
  5. Deploy the application.

🌟 Future Enhancements

  • Add email notifications for bookings.
  • Implement calendar integration.
  • Add real-time updates using WebSockets.

About

A backend API system that allows students to authenticate, view available time slots, and book appointments with professors. Professors can authenticate and specify their availability for appointments. The system is built with Node.js, Express.js, and uses MongoDB for database management. Deployed on Heroku for scalability and reliability.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published