Skip to content

Latest commit

Β 

History

35 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Fix-It Hub πŸ”§

A full-stack campus repair marketplace connecting students who need repairs with skilled fixers, promoting sustainability and the circular economy.

Live Demo: https://fixit-bmsce.netlify.app
Backend API: https://fixit-01yy.onrender.com


πŸ“š Table of Contents


🎯 Project Overview

Fix-It Hub is a campus-based platform that solves a real problem: students need items repaired but don't know who can help. Instead of throwing things away, students can:

  1. Post repair requests (broken laptop, torn jeans, wobbly chair)
  2. Find skilled fixers (other students with repair skills)
  3. Communicate in-app (private messaging system)
  4. Track repair progress (status updates and completion)

Why it matters:

  • ♻️ Reduces waste and promotes sustainability
  • πŸ’° Saves money (student-to-student pricing)
  • 🀝 Builds community connections
  • πŸŽ“ Skill-sharing and learning opportunities

πŸ› οΈ Technology Stack

Frontend (What Users See)

Technology Version Purpose Learn More
React 18.2.0 UI library for building interactive interfaces React Docs
Vite 5.0.8 Fast build tool and dev server (replaces Create React App) Vite Guide
React Router 6.21.1 Client-side routing (navigate without page reloads) Router Tutorial
Axios 1.6.5 HTTP client for API calls Axios Docs
Tailwind CSS 3.4.1 Utility-first CSS framework for styling Tailwind CSS

Backend (Server Logic)

Technology Version Purpose Learn More
Node.js 22.16.0 JavaScript runtime for server-side code Node.js Docs
Express 4.21.2 Web framework for building REST APIs Express Guide
MongoDB - NoSQL database for storing data MongoDB Tutorial
Mongoose 8.9.3 ODM (Object Data Modeling) for MongoDB Mongoose Guide
JWT 9.0.2 JSON Web Tokens for authentication JWT.io
bcryptjs 2.4.3 Password hashing for security bcrypt Explained
CORS 2.8.5 Cross-Origin Resource Sharing (lets frontend talk to backend) CORS Explained

Deployment & Hosting

Service Purpose Free Tier Learn More
Netlify Hosts React frontend 100GB bandwidth/month Netlify Docs
Render Hosts Node.js backend 750 hours/month Render Docs
MongoDB Atlas Cloud database 512MB storage Atlas Guide
GitHub Version control & auto-deployment Unlimited public repos Git Handbook

πŸ—οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         USER'S BROWSER                          β”‚
β”‚                    (https://fixit-bmsce.netlify.app)            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
                             β”‚ HTTP Requests (AJAX/Axios)
                             β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      FRONTEND (React + Vite)                     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Components:                                              β”‚  β”‚
β”‚  β”‚  - Navbar, Footer, SearchBar                             β”‚  β”‚
β”‚  β”‚  - ListingCard, SkillProfileCard                         β”‚  β”‚
β”‚  β”‚                                                           β”‚  β”‚
β”‚  β”‚  Pages:                                                   β”‚  β”‚
β”‚  β”‚  - HomePage, BrowseListingsPage, LoginPage               β”‚  β”‚
β”‚  β”‚  - ProfilePage, MessagesPage, ConversationPage           β”‚  β”‚
β”‚  β”‚                                                           β”‚  β”‚
β”‚  β”‚  Services (API Calls):                                    β”‚  β”‚
β”‚  β”‚  - api.js (axios setup + interceptors)                   β”‚  β”‚
β”‚  β”‚  - userService.js (login, register, profile)             β”‚  β”‚
β”‚  β”‚  - listingService.js (CRUD operations)                   β”‚  β”‚
β”‚  β”‚  - messageService.js (chat functionality)                β”‚  β”‚
β”‚  β”‚                                                           β”‚  β”‚
β”‚  β”‚  Context (Global State):                                  β”‚  β”‚
β”‚  β”‚  - AuthContext.jsx (user auth state)                     β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
                             β”‚ API Calls (REST)
                             β”‚ Example: POST /api/users/login
                             β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   BACKEND (Node.js + Express)                    β”‚
β”‚                  (https://fixit-01yy.onrender.com)              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  server.js (Entry Point)                                 β”‚  β”‚
β”‚  β”‚  - CORS configuration                                     β”‚  β”‚
β”‚  β”‚  - Body parsing (JSON, up to 10MB for images)            β”‚  β”‚
β”‚  β”‚  - Route mounting                                         β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                       β”‚                                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Routes (API Endpoints):                                  β”‚  β”‚
β”‚  β”‚  - /api/users (login, register, profile, update)         β”‚  β”‚
β”‚  β”‚  - /api/listings (create, read, update, delete)          β”‚  β”‚
β”‚  β”‚  - /api/messages (conversations, send, read)             β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                       β”‚                                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Middleware:                                              β”‚  β”‚
β”‚  β”‚  - authMiddleware.js (JWT verification, protect routes)  β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                       β”‚                                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Controllers (Business Logic):                            β”‚  β”‚
β”‚  β”‚  - userController.js (auth, profile updates)             β”‚  β”‚
β”‚  β”‚  - listingController.js (CRUD, filtering)                β”‚  β”‚
β”‚  β”‚  - messageController.js (chat logic)                     β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                       β”‚                                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Models (Database Schemas):                               β”‚  β”‚
β”‚  β”‚  - User.js (users, auth, skills, badges)                 β”‚  β”‚
β”‚  β”‚  - Listing.js (repair requests, status, category)        β”‚  β”‚
β”‚  β”‚  - Message.js (conversations, messages)                  β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
                             β”‚ Mongoose Queries
                             β”‚ (CREATE, READ, UPDATE, DELETE)
                             β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   DATABASE (MongoDB Atlas)                       β”‚
β”‚                        (Cloud Hosted)                            β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Collections:                                             β”‚  β”‚
β”‚  β”‚  - users (authentication, profiles, skills)              β”‚  β”‚
β”‚  β”‚  - listings (repair requests, images, status)            β”‚  β”‚
β”‚  β”‚  - messages (conversations, chat history)                β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🌟 Features

1. User Authentication

  • βœ… Register with email & password
  • βœ… Login with JWT token (stored in localStorage)
  • βœ… Password hashing with bcrypt (12 salt rounds)
  • βœ… Protected routes (can't access profile without login)
  • βœ… Auto-logout on token expiration

2. Listing Management

  • βœ… Create repair requests with photos (base64 encoding)
  • βœ… Browse all listings with search & filters
  • βœ… Category filtering (Tech, Clothing, Furniture, Other)
  • βœ… Status tracking (Available, In Progress, Completed)
  • βœ… Edit and delete your own listings
  • βœ… Clickable cards for detailed view

3. Messaging System

  • βœ… In-platform private messaging (no email needed)
  • βœ… Conversation threads per listing
  • βœ… Real-time message display with timestamps
  • βœ… Unread message counts
  • βœ… Message read/unread status
  • βœ… Auto-scroll to latest message

4. Profile Management

  • βœ… Upload profile pictures (base64, max 5MB)
  • βœ… Add/edit skills (e.g., "Soldering", "Sewing")
  • βœ… Display badges and stats
  • βœ… View your listings (Available vs In Progress)
  • βœ… Clickable usernames to view profiles

5. Search & Discovery

  • βœ… Real-time search across listings
  • βœ… Filter by category
  • βœ… Find skilled fixers page
  • βœ… Stats dashboard (total repairs, items saved, CO2 reduced)

πŸ”„ How It All Works Together

Example: User Logs In

  1. User enters email/password β†’ React form captures input
  2. Frontend calls API β†’ userService.login() sends POST request
    POST https://fixit-01yy.onrender.com/api/users/login
    Body: { email: "student@college.edu", password: "password123" }
  3. Backend receives request β†’ Express routes to userController.loginUser()
  4. Controller validates β†’ Checks MongoDB for user, compares hashed password
  5. JWT token generated β†’ Backend creates signed token with user ID
  6. Response sent β†’ Backend returns { token, user } JSON
  7. Frontend stores token β†’ Saved in localStorage and AuthContext
  8. Future requests authenticated β†’ Axios interceptor adds Authorization: Bearer <token> header

Example: User Uploads Profile Picture

  1. User selects image β†’ <input type="file"> triggers
  2. FileReader converts to base64 β†’ Browser reads file as data URL
    data:image/jpeg;base64,/9j/4AAQSkZJRg...
  3. Size validation β†’ Check if < 5MB (frontend), < 10MB (backend)
  4. API call with base64 β†’ userService.updateUserProfile({ photoUrl: base64String })
  5. Backend validates β†’ Checks if string starts with data:image/
  6. Mongoose saves to MongoDB β†’ Stored as string in user document
  7. Frontend updates β†’ AuthContext updates, component re-renders with new photo

Example: Two Users Chat

  1. User A clicks "Message" on listing β†’ Navigates to conversation page
  2. Frontend fetches conversation β†’ GET /api/messages/conversation/:listingId/:userId
  3. Backend finds or creates β†’ Mongoose searches for existing conversation
  4. User A types message β†’ Form captures text input
  5. Frontend sends message β†’ POST /api/messages/:conversationId
  6. Backend saves to DB β†’ Adds message to messages array in conversation document
  7. Frontend refetches β†’ Gets updated conversation with new message
  8. User B opens inbox β†’ Sees unread count, clicks conversation
  9. Mark as read triggered β†’ PUT /api/messages/:conversationId/read

πŸš€ Deployment Architecture

The Three-Platform Setup

GitHub (Code Storage)
    ↓
    β”œβ”€β†’ Netlify (Detects push to main branch)
    β”‚   β”œβ”€ Runs: npm install
    β”‚   β”œβ”€ Runs: npm run build (Vite builds React to /dist)
    β”‚   β”œβ”€ Deploys: Serves static files from /dist
    β”‚   └─ URL: https://fixit-bmsce.netlify.app
    β”‚
    └─→ Render (Detects push to main branch)
        β”œβ”€ Runs: npm install (in /server directory)
        β”œβ”€ Runs: node server.js
        β”œβ”€ Environment: Loads MONGODB_URI, JWT_SECRET, etc.
        └─ URL: https://fixit-01yy.onrender.com

MongoDB Atlas (Always Online)
    β”œβ”€ Connection: Accepts connections from Render's IP (0.0.0.0/0)
    β”œβ”€ Database: fixithub
    └─ Collections: users, listings, messages

Environment Variables (Hidden Secrets)

Netlify (Frontend):

VITE_API_URL=https://fixit-01yy.onrender.com/api
  • Tells React where the backend API is located
  • VITE_ prefix required for Vite to expose to browser

Render (Backend):

MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/fixithub
JWT_SECRET=super-secret-random-string-for-signing-tokens
NODE_ENV=production
PORT=5000
CLIENT_URL=https://fixit-bmsce.netlify.app
  • MONGODB_URI: Database connection string
  • JWT_SECRET: Used to sign/verify authentication tokens
  • CLIENT_URL: Allowed origin for CORS (security)

How Deployment Works

  1. You push code β†’ git push origin main
  2. GitHub receives β†’ Code stored in repository
  3. Netlify webhook triggered β†’ Detects new commit
    • Clones repo
    • Installs dependencies (npm install)
    • Builds React app (npm run build β†’ creates /dist folder)
    • Deploys static files to CDN
    • Result: https://fixit-bmsce.netlify.app updated
  4. Render webhook triggered β†’ Detects new commit
    • Clones repo
    • Enters /server directory
    • Installs dependencies (npm install)
    • Starts server (node server.js)
    • Result: https://fixit-01yy.onrender.com restarted
  5. Both live in ~2 minutes! πŸŽ‰

Why This Architecture?

Aspect Explanation
Separation of Concerns Frontend and backend deployed independently
Static Frontend React builds to HTML/CSS/JS files (fast CDN delivery)
Dynamic Backend Node.js server handles business logic and database
Scalability Each part can scale independently
Security API keys and secrets hidden in environment variables
Cost All three platforms free for small projects!

πŸ’» Local Development Setup

Prerequisites

  • Node.js 22.16.0+ (Download)
  • npm (comes with Node.js)
  • MongoDB (local) or MongoDB Atlas account
  • Git

Step-by-Step Setup

# 1. Clone the repository
git clone https://github.com/GlyphicGuy/fixIt.git
cd fixIt

# 2. Install frontend dependencies
npm install

# 3. Install backend dependencies
cd server
npm install
cd ..

# 4. Create environment file
cat > .env << EOF
PORT=5000
NODE_ENV=development
MONGODB_URI=mongodb://localhost:27017/fixithub
JWT_SECRET=your-dev-secret-key
CLIENT_URL=http://localhost:5173
EOF

# 5. Start MongoDB (if using local)
# macOS/Linux: brew services start mongodb-community
# Windows: net start MongoDB

# 6. Start backend (in one terminal)
cd server
npm run dev  # Uses nodemon for auto-restart

# 7. Start frontend (in another terminal)
npm run dev  # Runs on http://localhost:5173

Project Structure

fixIt/
β”œβ”€β”€ public/              # Static assets
β”œβ”€β”€ src/                 # Frontend React code
β”‚   β”œβ”€β”€ components/      # Reusable UI components
β”‚   β”œβ”€β”€ pages/           # Route pages
β”‚   β”œβ”€β”€ services/        # API call functions
β”‚   β”œβ”€β”€ context/         # Global state (Auth)
β”‚   β”œβ”€β”€ assets/          # Images, icons
β”‚   └── main.jsx         # React entry point
β”œβ”€β”€ server/              # Backend Node.js code
β”‚   β”œβ”€β”€ models/          # Mongoose schemas
β”‚   β”œβ”€β”€ controllers/     # Business logic
β”‚   β”œβ”€β”€ routes/          # API endpoints
β”‚   β”œβ”€β”€ middleware/      # Auth middleware
β”‚   β”œβ”€β”€ config/          # Database connection
β”‚   └── server.js        # Express entry point
β”œβ”€β”€ .env                 # Environment variables (gitignored)
β”œβ”€β”€ package.json         # Frontend dependencies
β”œβ”€β”€ vite.config.js       # Vite configuration
└── netlify.toml         # Netlify deployment config

πŸ“‘ API Documentation

Base URL

  • Production: https://fixit-01yy.onrender.com/api
  • Development: http://localhost:5000/api

Authentication Endpoints

POST /api/users/register

Create a new user account.

Request Body:

{
  "name": "John Doe",
  "email": "john@college.edu",
  "password": "securepassword123"
}

Response:

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "user": {
    "_id": "abc123",
    "name": "John Doe",
    "email": "john@college.edu"
  }
}

POST /api/users/login

Authenticate existing user.

Request Body:

{
  "email": "john@college.edu",
  "password": "securepassword123"
}

Response: Same as register

Listing Endpoints

GET /api/listings

Get all repair listings (with optional filters).

Query Parameters:

  • category (optional): Tech, Clothing, Furniture, Other
  • search (optional): Search in title/description

Response:

[
  {
    "_id": "listing123",
    "title": "Broken Laptop Screen",
    "description": "MacBook Air 2020, cracked display",
    "category": "Tech",
    "status": "Available",
    "photoUrl": "data:image/jpeg;base64,...",
    "postedBy": {
      "_id": "user123",
      "name": "Jane Doe"
    },
    "createdAt": "2025-12-29T10:30:00.000Z"
  }
]

POST /api/listings πŸ”’

Create a new listing (requires authentication).

Headers:

Authorization: Bearer <your-jwt-token>

Request Body:

{
  "title": "Torn Jeans Need Patching",
  "description": "Ripped at the knee, blue denim",
  "category": "Clothing",
  "photoUrl": "data:image/jpeg;base64,..."
}

Message Endpoints

GET /api/messages/conversations πŸ”’

Get all conversations for logged-in user.

GET /api/messages/conversation/:listingId/:otherUserId πŸ”’

Get or create a conversation between two users about a listing.

POST /api/messages/:conversationId πŸ”’

Send a message in a conversation.

Request Body:

{
  "content": "Hi, can you fix this by Friday?"
}

πŸ”’ = Requires Authorization: Bearer <token> header


πŸ—„οΈ Database Schema

Users Collection

{
  _id: ObjectId("..."),
  name: "John Doe",
  email: "john@college.edu",
  password: "$2a$12$hashed...",  // bcrypt hashed
  photoUrl: "data:image/jpeg;base64,...",  // optional
  skills: ["Soldering", "Screen Replacement"],  // optional array
  createdAt: ISODate("2025-12-01T..."),
  updatedAt: ISODate("2025-12-29T...")
}

Listings Collection

{
  _id: ObjectId("..."),
  title: "Broken Laptop Screen",
  description: "MacBook Air 2020, cracked display",
  category: "Tech",  // enum: Tech, Clothing, Furniture, Other
  status: "Available",  // enum: Available, In Progress, Completed
  photoUrl: "data:image/jpeg;base64,...",
  postedBy: ObjectId("user123"),  // reference to Users
  createdAt: ISODate("2025-12-29T..."),
  updatedAt: ISODate("2025-12-29T...")
}

Messages Collection

{
  _id: ObjectId("..."),
  listing: ObjectId("listing123"),  // reference to Listings
  participants: [ObjectId("user1"), ObjectId("user2")],
  messages: [
    {
      sender: ObjectId("user1"),
      content: "Can you fix this?",
      read: false,
      timestamp: ISODate("2025-12-29T10:00:00Z")
    },
    {
      sender: ObjectId("user2"),
      content: "Yes, I can help!",
      read: true,
      timestamp: ISODate("2025-12-29T10:05:00Z")
    }
  ],
  lastMessageAt: ISODate("2025-12-29T10:05:00Z"),
  createdAt: ISODate("2025-12-29T09:50:00Z")
}

πŸŽ“ Key Concepts to Research

Here's what you should understand to fully grasp this project:

Frontend Concepts

Concept What to Learn Why It Matters
React Components Functional components, props, state Building blocks of the UI
React Hooks useState, useEffect, useContext Manage state and side effects
React Router Routes, navigation, URL parameters Multi-page feel without page reloads
Context API Global state management Share auth state across components
Axios Interceptors Request/response middleware Auto-add auth tokens to requests
Base64 Encoding Binary data β†’ text string Store images in database as text
Tailwind CSS Utility classes, responsive design Fast styling without writing CSS
Vite Build tool, HMR, environment variables Faster than Webpack, modern tooling

Backend Concepts

Concept What to Learn Why It Matters
REST API HTTP methods, status codes, endpoints How frontend and backend communicate
Express Middleware Request pipeline, next() Process requests before reaching routes
JWT (JSON Web Tokens) Token structure, signing, verification Stateless authentication
bcrypt Hashing, salts, rainbow tables Secure password storage
Mongoose Schemas, models, queries Object-oriented MongoDB interaction
CORS Same-origin policy, preflight requests Allow cross-domain API calls
Environment Variables .env files, process.env Hide secrets, configure environments
Async/Await Promises, error handling Handle asynchronous operations

Database Concepts

Concept What to Learn Why It Matters
NoSQL vs SQL Document vs relational databases Why MongoDB for this project
MongoDB Documents JSON-like structure, flexibility How data is stored
Mongoose Schemas Schema definition, validation Enforce data structure in NoSQL
References ObjectId, populate() Link documents together
Indexing Query optimization Fast lookups on participants

Deployment Concepts

Concept What to Learn Why It Matters
Git & GitHub Version control, branches, commits Track changes, collaborate
CI/CD Continuous integration/deployment Auto-deploy on git push
Static vs Dynamic Hosting File serving vs server execution Why Netlify β‰  Render
Environment Variables Config management, secrets Different settings per environment
CDN Content delivery networks Fast global asset delivery
Webhooks Event-driven triggers GitHub β†’ Netlify/Render communication

Security Concepts

Concept What to Learn Why It Matters
Password Hashing One-way encryption, salts Never store plain passwords
JWT Security Token expiration, secret keys Prevent token forgery
CORS Policy Origin whitelist, credentials Prevent malicious sites accessing API
.gitignore Exclude sensitive files Don't commit secrets to GitHub
HTTPS SSL/TLS, encryption Secure data in transit

πŸ“– Recommended Learning Path

Phase 1: Frontend Basics

  1. βœ… HTML/CSS/JavaScript fundamentals
  2. βœ… React basics (components, props, state)
  3. βœ… React Hooks (useState, useEffect)
  4. βœ… React Router (navigation)
  5. βœ… Axios (API calls)

Phase 2: Backend Basics

  1. βœ… Node.js fundamentals
  2. βœ… Express.js (routes, middleware)
  3. βœ… MongoDB basics (CRUD operations)
  4. βœ… Mongoose (schemas, models)
  5. βœ… REST API design

Phase 3: Authentication

  1. βœ… JWT concept and implementation
  2. βœ… bcrypt password hashing
  3. βœ… Protected routes (middleware)
  4. βœ… Context API for global auth state

Phase 4: Advanced Features

  1. βœ… File uploads (base64 encoding)
  2. βœ… Real-time features (messaging)
  3. βœ… Search and filtering
  4. βœ… CORS configuration

Phase 5: Deployment

  1. βœ… Git and GitHub
  2. βœ… Environment variables
  3. βœ… Netlify deployment (static sites)
  4. βœ… Render deployment (Node.js apps)
  5. βœ… MongoDB Atlas (cloud database)

πŸš€ Future Enhancements

Ideas to expand the project:

  • Real-time messaging (Socket.io for instant updates)
  • Image compression (Reduce base64 size before upload)
  • Email notifications (Nodemailer for new messages)
  • Rating system (5-star reviews for fixers)
  • Payment integration (Stripe for transactions)
  • Admin dashboard (Moderate listings and users)
  • Mobile app (React Native version)
  • PWA (Progressive Web App for offline support)
  • Search autocomplete (ElasticSearch integration)
  • Image storage (AWS S3 instead of base64)

🀝 Contributing

This is a learning project! Feel free to:

  • Report bugs
  • Suggest features
  • Fork and experiment
  • Ask questions

πŸ“„ License

This project is open source and available for educational purposes.


πŸ™ Acknowledgments

Built as a campus sustainability project to promote the circular economy and reduce waste through student collaboration.


πŸ“ž Support

Live Site: https://fixit-bmsce.netlify.app
API Health Check: https://fixit-01yy.onrender.com/api/health

For questions about the codebase, refer to the guides:

  • DEPLOYMENT_GUIDE.md - Detailed deployment instructions
  • QUICK_DEPLOY.md - 30-minute deployment summary
  • MESSAGING_SYSTEM.md - How the chat system works
  • PROFILE_PICTURE_UPLOAD.md - Image upload implementation

Built with ❀️ by students, for students πŸŽ“

🌟 Features

Pages

  • Home Page - Browse repair listings with search, category filtering, stats dashboard, and featured fixers
  • Listing Detail Page - View complete listing information, contact fixers, and see interested helpers
  • New Listing Page - Post repair requests with photos, descriptions, and categories
  • Profile Page - Manage skills, view badges, and track your repair listings

Components

  • Navbar - Responsive navigation with routing
  • Footer - Site-wide footer with links and contact info
  • ListingCard - Display repair requests with images and status
  • SkillProfileCard - Show fixer profiles with ratings and badges
  • SearchBar - Real-time search functionality
  • StatsSection - Platform impact statistics
  • HowItWorks - Step-by-step guide for users

πŸš€ Getting Started

Prerequisites

  • Node.js 22.12 or higher
  • npm or yarn

Installation

  1. Clone the repository
git clone <your-repo-url>
cd fixIt
  1. Install dependencies
npm install
  1. Start the development server
npm run dev
  1. Open your browser and visit http://localhost:5173

Database Viewer

To view and inspect the MongoDB database in your browser:

  1. Make sure the backend server is running (npm run dev in the server directory)

  2. Open server/db-viewer.html in your browser or visit it directly:

open server/db-viewer.html
# or on Linux: xdg-open server/db-viewer.html
# or just drag the file into your browser

The database viewer provides:

  • Live Statistics - Total users, listings, open/fixed counts
  • Users Collection - View all users with their skills, ratings, and activity
  • Listings Collection - Browse all listings with status, interested fixers, and details
  • Table & JSON Views - Toggle between formatted table and raw JSON data
  • Real-time Refresh - Update data with the refresh button

API Endpoints:

  • GET /api/db/stats - Database statistics
  • GET /api/db/users - All users (passwords excluded)
  • GET /api/db/listings - All listings with populated references

πŸ› οΈ Tech Stack

  • Frontend Framework: React 18 with Vite
  • Styling: Tailwind CSS 3
  • Routing: React Router DOM
  • Backend (Planned): Node.js, Express, MongoDB

πŸ“ Project Structure

fixIt/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/       # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ Navbar.jsx
β”‚   β”‚   β”œβ”€β”€ Footer.jsx
β”‚   β”‚   β”œβ”€β”€ ListingCard.jsx
β”‚   β”‚   β”œβ”€β”€ SkillProfileCard.jsx
β”‚   β”‚   β”œβ”€β”€ SearchBar.jsx
β”‚   β”‚   β”œβ”€β”€ StatsSection.jsx
β”‚   β”‚   └── HowItWorks.jsx
β”‚   β”œβ”€β”€ pages/           # Main application pages
β”‚   β”‚   β”œβ”€β”€ HomePage.jsx
β”‚   β”‚   β”œβ”€β”€ ListingDetailPage.jsx
β”‚   β”‚   β”œβ”€β”€ NewListingPage.jsx
β”‚   β”‚   └── ProfilePage.jsx
β”‚   β”œβ”€β”€ data/            # Mock data (will be replaced with API calls)
β”‚   β”‚   └── mockData.js
β”‚   β”œβ”€β”€ App.jsx          # Main app component with routes
β”‚   β”œβ”€β”€ main.jsx         # Entry point
β”‚   └── index.css        # Global styles
β”œβ”€β”€ public/              # Static assets
└── package.json         # Dependencies and scripts

πŸ“Š Key Data Models

User

  • Name, email, photo
  • Array of skills (e.g., "Sewing", "Soldering", "Bike Repair")
  • Badges earned
  • Rating and fixes completed

Listing

  • Title, description, category
  • Photo URL
  • Status ('open', 'fixed')
  • Posted by (user reference)
  • Posted date

🎨 Categories

  • Tech - Electronics, computers, phones
  • Clothing - Sewing, mending, alterations
  • Furniture - Woodworking, assembly, repairs
  • Other - Bikes, sports equipment, misc items

πŸ”œ Upcoming Features

Backend Integration

  • User authentication (oAuth Google)
  • Email notifications

Frontend Enhancements

  • Booking/scheduling system
  • Image before/after
  • Mobile app version

🀝 Contributing

This is a college project. Contributions and suggestions are welcome!

πŸ“ Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run preview - Preview production build
  • npm run lint - Run ESLint

🌱 Sustainability Mission

Fix-It Hub promotes the circular economy by:

  • Reducing waste through repair instead of replacement
  • Building a skill-sharing community
  • Extending the life of products
  • Educating students about sustainability
  • Creating a culture of resourcefulness

πŸ“§ Contact

For questions or feedback, contact us at support@fixithub.edu

Copyright 2026

About

A Full Stack Web Development Project as a subject project.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages