Skip to content

ChipSetters/AI-Powered-PC-Builder-and-Appointment-Scheduler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

67 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AI-Powered PC Builder and Appointment Scheduler

A comprehensive web application that combines PC building assistance with an intelligent appointment scheduling system. Built with React, Node.js, MongoDB, and featuring role-based access control for admins and regular users.

πŸš€ Features

Core Functionality

  • AI-Powered PC Building Assistant: Intelligent chatbot to help users build custom PCs
  • Appointment Scheduling System: Advanced calendar-based booking with real-time availability
  • Role-Based Access Control: Separate interfaces for admins and regular users
  • Real-Time Notifications: Success/error feedback system
  • Responsive Design: Modern UI that works on all devices

Admin Features

  • Dashboard Management: View and manage all appointments
  • User Management: View user details and manage profiles
  • Appointment Control: Confirm, cancel, and track appointment status
  • Search & Filter: Advanced search by appointment ID, user name, and service type
  • Calendar Overview: Full calendar view of all appointments

User Features

  • Personal Dashboard: View own appointments and profile
  • Appointment Booking: Easy-to-use calendar interface
  • Profile Management: Update personal information and reset password
  • ChatBot Access: Direct access to AI PC building assistant
  • Appointment History: View past and upcoming appointments

Technical Features

  • JWT Authentication: Secure token-based authentication
  • MongoDB Database: Scalable NoSQL database
  • RESTful API: Clean API architecture
  • Real-Time Updates: Live calendar updates and notifications
  • Past Date Protection: Prevents booking on past dates
  • Conflict Prevention: Blocks double-booking of time slots

πŸ› οΈ Tech Stack

Frontend

  • React 18.2.0: Modern UI framework
  • React Router DOM: Client-side routing
  • FullCalendar: Advanced calendar component
  • Axios: HTTP client for API calls
  • JWT Decode: Token management
  • JS Cookie: Cookie management

Backend

  • Node.js: Server runtime
  • Express.js: Web framework
  • MongoDB: Database
  • Mongoose: ODM for MongoDB
  • bcryptjs: Password hashing
  • jsonwebtoken: JWT authentication
  • CORS: Cross-origin resource sharing
  • Socket.io: Real-time communication

Development Tools

  • Nodemon: Development server with auto-restart
  • ESLint: Code quality and consistency

πŸ“‹ Prerequisites

Before running this project, make sure you have the following installed:

  • Node.js (v16 or higher)
  • npm (v8 or higher)
  • MongoDB (v5 or higher)
  • Git (for cloning the repository)

πŸš€ Installation & Setup

1. Clone the Repository

git clone <repository-url>
cd AI-Powered-PC-Builder-and-Appointment-Scheduler

2. Install Dependencies

Install Root Dependencies

npm install

Install Client Dependencies

cd client
npm install
cd ..

Install Server Dependencies

cd server
npm install
cd ..

3. Environment Configuration

Create Environment Files

Root .env file:

# Create .env file in root directory
touch .env

Server .env file:

# Create .env file in server directory
cd server
touch .env
cd ..

Configure Environment Variables

Root .env:

# Add any root-level environment variables here

Server .env:

# MongoDB Connection String
MONGODB_CONNECTION_STRING_DEV=mongodb://localhost:27017/pc_builder_db

# JWT Secret (generate a strong secret)
JWT_SECRET=your_jwt_secret_here

# Server Port (optional, defaults to 5000)
PORT=5000

# CORS Origin (for development)
CORS_ORIGIN=http://localhost:3000

4. Database Setup

Start MongoDB

# Start MongoDB service
mongod

# Or if using MongoDB as a service
sudo systemctl start mongod

Create Database

The application will automatically create the database when it first connects. Make sure MongoDB is running before starting the application.

5. Start the Application

Development Mode (Recommended)

Terminal 1 - Start Backend Server:

cd server
npm run dev

Terminal 2 - Start Frontend Client:

cd client
npm start

Production Mode

Build the Frontend:

cd client
npm run build
cd ..

Start Production Server:

cd server
npm start

6. Access the Application

πŸ“ Project Structure

AI-Powered-PC-Builder-and-Appointment-Scheduler/
β”œβ”€β”€ client/                          # React frontend
β”‚   β”œβ”€β”€ public/                      # Static files
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ modules/                 # Feature modules
β”‚   β”‚   β”‚   β”œβ”€β”€ appointment/         # Appointment management
β”‚   β”‚   β”‚   β”œβ”€β”€ auth/               # Authentication
β”‚   β”‚   β”‚   β”œβ”€β”€ chatbot/            # AI chatbot
β”‚   β”‚   β”‚   └── user/               # User management
β”‚   β”‚   β”œβ”€β”€ shared/                 # Shared components & services
β”‚   β”‚   β”‚   β”œβ”€β”€ components/         # Reusable components
β”‚   β”‚   β”‚   β”œβ”€β”€ services/           # API services
β”‚   β”‚   β”‚   β”œβ”€β”€ config/             # Configuration
β”‚   β”‚   β”‚   └── styles/             # Shared styles
β”‚   β”‚   └── routes/                 # Routing
β”‚   └── package.json
β”œβ”€β”€ server/                          # Node.js backend
β”‚   β”œβ”€β”€ controllers/                 # Business logic
β”‚   β”œβ”€β”€ middleware/                  # Custom middleware
β”‚   β”œβ”€β”€ models/                      # Database models
β”‚   β”œβ”€β”€ routes/                      # API routes
β”‚   β”œβ”€β”€ app.js                       # Express app setup
β”‚   β”œβ”€β”€ server.js                    # Server entry point
β”‚   └── package.json
β”œβ”€β”€ python_services/                 # Python services
β”œβ”€β”€ shared/                          # Shared utilities
└── README.md

πŸ” Authentication & Roles

User Roles

  1. Admin: Full access to all features

    • Manage all appointments
    • View all user details
    • Confirm/cancel appointments
    • Access admin dashboard
  2. Regular User: Limited access

    • Book personal appointments
    • View own appointments
    • Manage personal profile
    • Access chatbot

Default Users

The application creates default users on first run. You can modify these in the database or create new users through the registration system.

πŸ“± Usage Guide

For Regular Users

  1. Registration/Login: Create an account or log in
  2. Dashboard: View your appointments and profile
  3. Book Appointment: Use the calendar to select available time slots
  4. ChatBot: Get AI assistance for PC building
  5. Profile Management: Update your information and reset password

For Admins

  1. Admin Dashboard: Access the admin panel
  2. Appointment Management: View and manage all appointments
  3. User Management: View user details and profiles
  4. Calendar Overview: See all appointments in calendar view
  5. Search & Filter: Find specific appointments or users

πŸ”§ API Endpoints

Authentication

  • POST /api/v1/auth/register - User registration
  • POST /api/v1/auth/login - User login
  • POST /api/v1/auth/logout - User logout

Appointments

  • GET /api/v1/appointments - Get all appointments
  • POST /api/v1/appointments - Create appointment
  • PUT /api/v1/appointments/:id - Update appointment
  • DELETE /api/v1/appointments/:id - Cancel appointment
  • GET /api/v1/appointments/confirmed - Get confirmed appointments

User Management

  • GET /api/v1/user/profile - Get user profile
  • PUT /api/v1/user/profile/:id - Update user profile
  • GET /api/v1/user/appointments/:email - Get user appointments

πŸ› Troubleshooting

Common Issues

  1. MongoDB Connection Failed

    • Ensure MongoDB is running
    • Check connection string in .env file
    • Verify MongoDB port (default: 27017)
  2. Port Already in Use

    • Change port in .env file
    • Kill existing processes using the port
    • Use different ports for client and server
  3. Module Not Found Errors

    • Run npm install in all directories
    • Clear node_modules and reinstall
    • Check package.json for missing dependencies
  4. CORS Errors

    • Verify CORS_ORIGIN in server .env
    • Ensure frontend URL matches CORS configuration

Development Tips

  • Use npm run dev for development with auto-restart
  • Check browser console for frontend errors
  • Monitor server logs for backend issues
  • Use MongoDB Compass for database inspection

About

AI-Powered PC Builder & Appointment Scheduler: A MERN stack application with GPT integration for smart PC build recommendations and appointment scheduling.

Resources

Stars

Watchers

Forks

Contributors