Skip to content

seniyadewmina/Appointment-Booking-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Appointment Booking System

This is a Node.js-based appointment booking system with authentication, built using Express, Sequelize (for database management), JWT for authentication, and bcrypt for password hashing.

🚀 Features

  • User Authentication: Signup, login, logout, and token refresh using JWT.
  • Password Security: Bcrypt for hashing passwords.
  • Rate Limiting: Prevent brute-force attacks with Express Rate Limit.
  • Database Management: Sequelize ORM with MySQL/PostgreSQL.
  • Environment Variables: Securely handle secrets using dotenv.
  • Appointment Management: Book, retrieve, and cancel appointments.

🛠️ Technologies Used

  • Backend: Node.js, Express.js
  • Database: MySQL (via Sequelize ORM)
  • Authentication: JWT (JSON Web Token)
  • Security: Bcrypt.js, Express Rate Limit
  • Environment Management: dotenv

📌 Prerequisites

Make sure you have the following installed:

🛠️ Setup & Installation

1️⃣ Clone the Repository

git clone https://github.com/seniyadewmina/Appointment-Booking-System.git
cd appointment-booking-system

2️⃣ Install Dependencies

npm install

3️⃣ Set Up Environment Variables

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

PORT=5000
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=yourpassword
DB_NAME=appointment_db
JWT_SECRET=your_secret_key
TOKEN_EXPIRY=1h
NODE_ENV=development

4️⃣ Set Up Database

Update config/database.js with your database details, then run:

npx sequelize-cli db:create
npx sequelize-cli db:migrate

5️⃣ Start the Server

npm run dev  # For development (nodemon)
npm start    # For production

6️⃣ API Endpoints

  • Authentication:

    • POST /auth/signup → Register a new user
    • POST /auth/login → Login and receive a JWT token
    • POST /auth/logout → Logout by clearing the cookie
    • POST /auth/refresh → Refresh the JWT token
  • Appointments:

    • GET /slots → Retrieve available time slots
    • POST /appointments → Book an appointment
    • GET /appointments → Retrieve booked appointments for a user
    • DELETE /appointments/:id → Cancel an appointment

🔧 Development

Running in Development Mode

For hot-reloading during development, use:

npm run dev

Running in Production

npm start

📬 Contact

For any queries or suggestions, reach out via:
📧 seniyadewminaw@gmail.com
🔗 LinkedIn


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published