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.
- 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.
- Backend: Node.js, Express.js
- Database: MySQL (via Sequelize ORM)
- Authentication: JWT (JSON Web Token)
- Security: Bcrypt.js, Express Rate Limit
- Environment Management: dotenv
Make sure you have the following installed:
- Node.js (v16 or higher recommended)
- MySQL or PostgreSQL
- Git
git clone https://github.com/seniyadewmina/Appointment-Booking-System.git
cd appointment-booking-system
npm install
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
Update config/database.js
with your database details, then run:
npx sequelize-cli db:create
npx sequelize-cli db:migrate
npm run dev # For development (nodemon)
npm start # For production
-
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
- POST
-
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
- GET
For hot-reloading during development, use:
npm run dev
npm start
For any queries or suggestions, reach out via:
📧 seniyadewminaw@gmail.com
🔗 LinkedIn