A production-ready full-stack appointment booking application built with modern web technologies, featuring role-based authentication, slot management, and real-time booking capabilities for seamless user-provider interactions.
- click here - https://appointment-app-topaz.vercel.app/
- π User Authentication - JWT-based secure authentication with role management
- π₯ Role-Based Access - Separate interfaces for Users and Service Providers
- π Slot Management - Create, edit, and delete time slots with overlap prevention
- β Booking System - View available slots, book appointments, and manage bookings
- π« Conflict Prevention - Validate slots or prevent duplicate slot creation
- π± Responsive Design - Clean, Functional UI
- π‘οΈ Protected Routes - Frontend and backend route protection based on user roles
- π RESTful API Design - Clean, intuitive endpoints for all operations
- π Middleware Security - Comprehensive authentication and authorization middleware
- π Data Validation - Robust input validation and error handling
- Framework: React.js + Vite
- Styling: Tailwind CSS
- HTTP Client: Axios
- State Management: React Hooks
- Routing: React Router DOM
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB with Mongoose ODM
- Authentication: JWT (JSON Web Tokens)
- Security: bcryptjs, CORS protection
- Environment Management: dotenv
- Development Server: Vite (Frontend), nodemon (Backend)
- Version Control: Git & GitHub
Bookify/
βββ frontend/ # Frontend React application
β βββ src/
β β βββ pages/ # Route components
β β βββ index.css
β β βββ App.jsx
β β βββ main.jsx
β βββ public/
β βββ index.html
β βββ package.json
β βββ vercel.json
βββ backend/ # Backend Node.js application
β βββ controllers/ # Business logic layer
β β βββ authController.js
β β βββ slotController.js
β β βββ bookingController.js
β βββ models/ # Database models
β β βββ User.js
β β βββ Slot.js
β β βββ Booking.js
β βββ routes/ # API routes
β β βββ authRoutes.js
β β βββ slotRoutes.js
β β βββ bookingRoutes.js
β βββ middlewares/ # Custom middleware
β β βββ authMiddleware.js # Authentication middleware
β β βββ roleCheckMW.js # Role-based authorization
β βββ .env # Environment variables
β βββ package.json
β βββ server.js # Application entry point
- Node.js (v14 or higher)
- MongoDB (local or MongoDB Atlas)
- Git
-
Clone the repository
git clone https://github.com/Bharat1Rajput/Bookify.git cd Bookify -
Backend Setup
cd backend npm install -
Frontend Setup
cd frontend npm install -
Environment Configuration Create
.envfile in the server directory:PORT=3000 MONGODB_URI=mongodb://localhost:27017/yourdbname JWT_SECRET=your_super_secret_jwt_key_here
-
Start MongoDB
# If using local MongoDB mongosh # Or ensure MongoDB Atlas connection is configured
-
Run the application
# Start backend (from backend directory) npm start # Start frontend (from frontend directory) npm run dev
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/signup |
Register new user |
| POST | /api/auth/login |
Login user |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/slot/create |
Create new time slot | Yes (Provider) |
| GET | /api/slot/view |
Get all slots for provider | Yes (Provider) |
| GET | /api/slot/available |
Get all slots | Yes (both) |
| PUT | /api/slot/edit/:id |
Update existing slot | Yes (Provider) |
| DELETE | /api/slot/delete/:id |
Delete slot | Yes (Provider) |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/booking/book/:slotId |
Book an available slot | Yes (User) |
| GET | /api/booking/view |
Get user's bookings | Yes (User) |
| GET | /api/booking/provider/bookings |
Get provider's bookings | Yes (provider) |
| DELETE | /api/booking/cancel/:id |
Cancel booking | Yes (User) |
POST /api/slot/create
{
"date": "2024-08-15",
"startTime": "10:00",
"endTime": "11:00",
"title": "Math Tutoring Session"
}- JWT Authentication: Stateless token-based authentication system
- Role-Based Authorization: Separate permissions for Users and Service Providers
- Password Security: bcrypt hashing with salt rounds for secure password storage
- Protected Routes: Middleware-based route protection on both frontend and backend
- Input Validation: Comprehensive request validation and sanitization
- CORS Configuration: Cross-origin resource sharing setup for secure API access
- Conflict Prevention: Database-level validation to prevent booking conflicts
- π Robust Authentication: Successfully implemented JWT-based role authentication system
- π Real-world Booking Logic: Built comprehensive appointment booking with conflict resolution
- π‘οΈ Security Implementation: Deployed protected routes across full-stack architecture
- ποΈ Database Integration: Mastered MongoDB integration with Mongoose for complex relationships
- β‘ Performance Optimization: Implemented efficient querying and state management
- Full-stack development workflow mastery
- RESTful API design principles
- React state management and hooks
- MongoDB schema design and relationships
- Middleware pattern implementation
- Total Components: 15+ React components
- API Endpoints: 8 RESTful endpoints
- Database Models: 3 (User, Slot, Booking)
- Middleware Functions: 4+ security and validation layers
- Role-Based Features: 2 distinct user experiences
- Real-time Notifications - WebSocket integration for instant booking updates
- Email Integration - Automated confirmation and reminder emails
- Calendar Integration - Google Calendar sync for providers
- Payment Gateway - Stripe integration for paid appointments
- Video Conferencing - Zoom/Meet integration for virtual appointments
- Advanced Analytics - Booking statistics and provider insights
- Mobile App - React Native mobile application
- Multi-language Support - Internationalization for global users
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Bharat
- GitHub: @Bharat1Rajput
- LinkedIn: Bharat Singh
- Email: bharattsingh33@gmail.com
- React.js community for excellent documentation and ecosystem
- MongoDB team for the robust database solution
- Tailwind CSS for the utility-first styling approach
- Express.js community for the minimalist web framework
β Star this repository if it helped you learn full-stack development!
Built with β€οΈ for seamless appointment management