Skip to content

Islamhassana3/SpareChair

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

49 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ChairShare

ChairShare is an Airbnb-style platform for service-based businesses with unused space. Salon owners, therapists, or studios can list spare chairs or rooms, set availability and pricing, and earn from underused capacity. Freelancers book spaces flexibly by the hour or day, with secure payments, ID verification, and reviews.

๐Ÿš€ Quick Preview

Want to see ChairShare in action? Launch the preview with one click!

Preview on localhost:3000 Quick Start Guide Preview Guide

๐ŸŽฏ Launch Methods

Choose your platform and run the preview script:

๐Ÿง Linux / ๐ŸŽ macOS:

./preview.sh

๐ŸชŸ Windows (Command Prompt):

preview.bat

๐ŸชŸ Windows (PowerShell):

.\preview.ps1

๐Ÿ’ก What happens:

  • โœ… Automatically checks and installs dependencies
  • โœ… Navigates to the frontend directory
  • โœ… Starts the development server on port 3000
  • โœ… Opens the application in your default browser

๐Ÿš€ Quick Start

New to ChairShare? Get up and running in 5 minutes with our Quick Start Guide!

npm run install-deps && cp .env.example .env
# Edit .env with your database URL
npx prisma generate && npx prisma db push
npm run dev

For detailed setup instructions, see the Installation section below.

๐Ÿ“‹ Platform Review & Improvement Plan

New! A comprehensive review and improvement plan has been created for the ChairShare platform:

Current Platform Score: 44/100 | Total Improvements: 300 items | Timeline: 24 months in 6 phases

Quick Wins Available: 10 high-impact improvements can be implemented in just 2-3 weeks! See Getting Started Guide.

๐Ÿš€ Features

For Space Seekers (Guests)

  • Discover Spaces: Search and filter professional spaces by location, type, amenities, and price
  • Flexible Booking: Book spaces by the hour or day with instant confirmation
  • Secure Payments: Safe payment processing with Stripe integration
  • Review System: Read and write reviews to build trust in the community
  • User Dashboard: Track bookings, manage preferences, and view history

For Space Providers (Hosts)

  • List Your Space: Create detailed listings with photos, amenities, and pricing
  • Manage Availability: Set your schedule and pricing preferences
  • Booking Management: Accept/decline requests and communicate with guests
  • Earnings Tracking: Monitor your income and payout schedule
  • Professional Profile: Build your reputation through reviews and verification

Core Platform Features

  • User Authentication: Secure JWT-based authentication system
  • ID Verification: Trust and safety through identity verification
  • Real-time Notifications: Stay updated on bookings and messages
  • Mobile-Responsive: Works seamlessly on desktop and mobile devices
  • Admin Dashboard: Platform management and oversight tools

๐Ÿ› ๏ธ Technology Stack

Backend

  • Node.js with Express.js framework
  • PostgreSQL database with Prisma ORM
  • JWT for authentication
  • Stripe for payment processing
  • Multer for file uploads
  • Nodemailer for email notifications

Frontend

  • React with TypeScript
  • Material-UI for component library
  • React Router for navigation
  • Axios for API communication
  • Context API for state management

Database Schema

  • Users: Authentication and profile management
  • Listings: Space details and host information
  • Bookings: Reservation management and status tracking
  • Reviews: Rating and feedback system
  • Payments: Transaction processing and records
  • Availability: Time slot management

๐Ÿ“ฆ Installation

Prerequisites

  • Node.js (v16 or higher)
  • PostgreSQL database
  • Stripe account for payments

Environment Setup

  1. Clone the repository
git clone https://github.com/Islamhassana3/SpareChair.git
cd SpareChair
  1. Install dependencies
npm run install-deps
  1. Set up environment variables
cp .env.example .env

Edit .env with your configuration:

DATABASE_URL="postgresql://username:password@localhost:5432/chairshare"
JWT_SECRET="your-jwt-secret-key-here"
STRIPE_SECRET_KEY="sk_test_your_stripe_secret_key"
STRIPE_PUBLISHABLE_KEY="pk_test_your_stripe_publishable_key"
EMAIL_HOST="smtp.gmail.com"
EMAIL_PORT=587
EMAIL_USER="[email protected]"
EMAIL_PASS="your-app-password"
PORT=5000
NODE_ENV=development
CLIENT_URL=http://localhost:3000
  1. Set up the database
npx prisma generate
npx prisma db push
  1. Verify your setup (optional but recommended)
./verify-setup.sh

This script checks if all prerequisites are installed and properly configured.

  1. Start the development servers
npm run dev

This will start:

โš ๏ธ Common Issues

If you encounter problems during setup, check these common issues:

"Login failed" or cannot connect to backend:

  • Ensure backend is running on port 5000
  • Run curl http://localhost:5000/api/health to verify
  • Check that .env file exists and has correct values

Prisma errors:

  • Run npx prisma generate if you see "@prisma/client did not initialize"
  • Ensure PostgreSQL is running: pg_isready
  • Verify DATABASE_URL in .env is correct

Port already in use:

  • Kill existing processes: lsof -ti:5000 | xargs kill -9 (backend) or lsof -ti:3000 | xargs kill -9 (frontend)

๐Ÿ“š For detailed troubleshooting, see TROUBLESHOOTING.md

๐Ÿš€ Usage

Development

# Start both frontend and backend
npm run dev

# Start backend only
npm run server

# Start frontend only
npm run client

# Build for production
npm run build

Production Deployment

# Build the React app
npm run build

# Start production server
npm start

๐Ÿš€ Railway.app Deployment

ChairShare is optimized for deployment on Railway.app with the following features:

Quick Deploy

  1. One-Click Deploy: Connect your GitHub repository to Railway
  2. Auto-Configuration: Includes railway.toml, nixpacks.toml, and Procfile
  3. Database Setup: Add PostgreSQL service for automatic DATABASE_URL configuration

Railway-Specific Optimizations

  • โœ… Optimized Build Process: Efficient multi-stage build with dependency caching
  • โœ… Health Checks: Enhanced /api/health endpoint with database connectivity monitoring
  • โœ… Environment Handling: Production-ready CORS and proxy configuration
  • โœ… Database Migrations: Automatic Prisma client generation and schema deployment
  • โœ… Static File Serving: Optimized React build serving from Express server
  • โœ… Process Management: Railway-aware startup scripts and error handling

Configuration Files

  • railway.toml - Railway platform configuration
  • nixpacks.toml - Build environment specification
  • Procfile - Process definition for Railway
  • start.sh - Railway-optimized startup script
  • .env.railway - Environment variable template
  • RAILWAY_DEPLOYMENT.md - Detailed deployment guide

Required Environment Variables

DATABASE_URL=postgresql://...    # Auto-provided by Railway PostgreSQL
JWT_SECRET=your-secure-secret
STRIPE_SECRET_KEY=sk_live_...
STRIPE_PUBLISHABLE_KEY=pk_live_...
NODE_ENV=production
CLIENT_URL=https://your-app.railway.app

๐Ÿ“‹ See RAILWAY_DEPLOYMENT.md for complete deployment guide

๐Ÿ“ฑ API Endpoints

Authentication

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login
  • GET /api/auth/profile - Get user profile

Listings

  • GET /api/listings - Get all listings (with filters)
  • GET /api/listings/:id - Get specific listing
  • POST /api/listings - Create new listing (Host only)
  • PUT /api/listings/:id - Update listing (Host only)
  • DELETE /api/listings/:id - Delete listing (Host only)

Bookings

  • POST /api/bookings - Create booking request
  • GET /api/bookings - Get user's bookings
  • GET /api/bookings/:id - Get specific booking
  • PUT /api/bookings/:id/status - Update booking status (Host only)
  • PUT /api/bookings/:id/cancel - Cancel booking

Reviews

  • POST /api/reviews - Create review
  • GET /api/reviews - Get reviews (with filters)
  • PUT /api/reviews/:id - Update review
  • DELETE /api/reviews/:id - Delete review

๐ŸŽฏ Business Types Supported

  • Salon & Barbershop
  • Spa & Massage Therapy
  • Nail Salon
  • Tattoo Parlor
  • Photography Studio
  • Music Studio
  • Art Studio
  • Dance Studio
  • Fitness Studio
  • Coworking Space
  • Medical Office
  • Therapy Office
  • And more...

๐Ÿ’ก Space Types Available

  • Individual Chairs
  • Private Rooms
  • Work Stations
  • Desks
  • Studios
  • Offices
  • Custom Spaces

๐Ÿ” Security Features

  • Authentication: JWT-based secure authentication
  • Data Validation: Input validation and sanitization
  • Payment Security: PCI-compliant payment processing
  • ID Verification: Identity verification for trust and safety
  • CORS Protection: Cross-origin request security
  • Rate Limiting: API abuse prevention

๐ŸŽจ User Interface

The platform features a modern, responsive design built with Material-UI:

  • Clean Navigation: Intuitive header with user-specific options
  • Search & Filters: Advanced filtering for finding perfect spaces
  • Interactive Cards: Engaging listing displays with key information
  • Mobile-First: Responsive design that works on all devices
  • Accessible: Following WCAG guidelines for accessibility

๐Ÿ”„ Booking Flow

  1. Guest searches for spaces using filters
  2. Guest selects a space and views details
  3. Guest submits booking request with dates/times
  4. Host receives notification and can accept/decline
  5. Payment processing occurs upon confirmation
  6. Space usage and review system post-completion

๐Ÿ“Š Revenue Model

  • Commission: Platform fee on successful bookings
  • Premium Features: Enhanced listings and priority placement
  • Verification Services: ID and business verification fees
  • Payment Processing: Transaction fees

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™‹ Support

For support, email [email protected] or create an issue in the GitHub repository.

๐Ÿ”ฎ Future Enhancements

  • Mobile Apps: Native iOS and Android applications
  • Real-time Chat: In-app messaging between hosts and guests
  • Calendar Integration: Sync with Google Calendar and other platforms
  • Advanced Analytics: Detailed insights for hosts and admins
  • Multi-language Support: Internationalization
  • AI Recommendations: Smart space suggestions based on user behavior
  • Virtual Tours: 360ยฐ space previews
  • Insurance Integration: Protection for hosts and guests

Built with โค๏ธ by the ChairShare Team

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •