Skip to content

OpenSpace is a comprehensive parking and valet management platform that connects customers, garage operators, managers, and valets through an intuitive digital ecosystem. Experience seamless parking reservations, real-time valet tracking, and efficient garage operations.

License

Notifications You must be signed in to change notification settings

den319/openspace

Repository files navigation

πŸš— OpenSpace - Smart Parking & Valet Management System

License: ISC TypeScript NestJS Next.js GraphQL Prisma

OpenSpace is a comprehensive parking and valet management platform that connects customers, garage operators, managers, and valets through an intuitive digital ecosystem. Experience seamless parking reservations, real-time valet tracking, and efficient garage operations.


user-home-page

✨ Features

πŸ…ΏοΈ Customer Experience

  • Smart Booking System: Real-time garage availability and instant booking
  • Valet Services: Request pickup/drop-off services with live tracking
  • 3D Garage Visualization: Interactive 3D maps of parking facilities
  • Payment Integration: Secure Stripe payments for all transactions
  • Mobile-First Design: Responsive web application for all devices

🏒 Garage Management

  • Multi-Garage Support: Manage multiple parking facilities
  • Slot Management: Dynamic slot allocation and pricing
  • Real-time Availability: Live updates on parking space status
  • Verification System: Admin-approved garage listings
  • Image Management: Photo galleries for each garage

πŸ‘₯ User Management

  • Role-Based Access: Separate interfaces for customers, managers, valets, and admins
  • Authentication: Secure JWT-based authentication with NextAuth.js
  • Profile Management: User profiles with preferences and history
  • Company Structure: Hierarchical company and garage management

πŸ“Š Analytics & Operations

  • Booking Timeline: Complete audit trail of all parking activities
  • Valet Assignment: Automated and manual valet service coordination
  • Review System: Customer feedback and rating system
  • Reporting Dashboard: Comprehensive analytics for operators
OpenSpace Platform Features Overview

πŸš— OpenSpace Platform
β”œβ”€β”€ Customer Portal
β”‚   β”œβ”€β”€ Smart Booking System
β”‚   β”œβ”€β”€ 3D Garage Visualization
β”‚   β”œβ”€β”€ Payment Integration
β”‚   └── Real-time Tracking
β”œβ”€β”€ Garage Management
β”‚   β”œβ”€β”€ Multi-Garage Support
β”‚   β”œβ”€β”€ Slot Management
β”‚   β”œβ”€β”€ Real-time Availability
β”‚   └── Image Management
β”œβ”€β”€ Valet Services
β”‚   β”œβ”€β”€ Pickup/Drop-off
β”‚   β”œβ”€β”€ GPS Tracking
β”‚   β”œβ”€β”€ Service Coordination
β”‚   └── Earnings Monitoring
└── Admin Dashboard
    β”œβ”€β”€ User Management
    β”œβ”€β”€ Analytics
    β”œβ”€β”€ Verification System
    └── Review System

�️ Architecture

OpenSpace follows a modern micro-frontend architecture with shared libraries and multiple specialized applications.

openspace/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ api/                 # NestJS GraphQL API Backend
β”‚   β”œβ”€β”€ web/                 # Customer Web Application (Port 3001)
β”‚   β”œβ”€β”€ web-admin/           # Admin Management Portal (Port 3004)
β”‚   β”œβ”€β”€ web-manager/         # Garage Manager Dashboard
β”‚   └── web-valet/           # Valet Mobile Application
β”œβ”€β”€ libs/
β”‚   β”œβ”€β”€ 3d/                  # Three.js 3D Visualization Library
β”‚   β”œβ”€β”€ forms/               # Shared Form Components & Validation
β”‚   β”œβ”€β”€ network/             # GraphQL Client & API Utilities
β”‚   β”œβ”€β”€ ui/                  # Reusable UI Component Library
β”‚   └── util/                # Utility Functions & Types
└── tools/                   # Development Tools & Scripts

OpenSpace Architecture Overview


β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Frontend Apps   β”‚    β”‚ Shared Librariesβ”‚    β”‚ Backend API      β”‚    β”‚External Servicesβ”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β€’ web (Port 3001β”‚    β”‚ β€’ ui (UI Comp.) β”‚    β”‚ β€’ api (Port 3000)β”‚    β”‚ β€’ PostgreSQL DB β”‚
β”‚   Customer)     β”‚    β”‚ β€’ forms (Forms) β”‚    β”‚   NestJS GraphQL β”‚    β”‚ β€’ Stripe Paymentβ”‚
β”‚ β€’ web-admin     β”‚    β”‚ β€’ network (GQL) β”‚    β”‚                  β”‚    β”‚ β€’ NextAuth Auth β”‚
β”‚   (Port 3004)   β”‚    β”‚ β€’ 3d (Three.js) β”‚    β”‚                  β”‚    β”‚ β€’ Cloudinary Imgβ”‚
β”‚ β€’ web-manager   β”‚    β”‚ β€’ util (Utils)  β”‚    β”‚                  β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ β€’ web-valet     β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β–²
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β–²                        β–²                     β”‚
              β”‚                 β”‚                        β”‚                     β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚                        β”‚
                                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Tech Stack

Backend

Frontend

Development Tools

  • Monorepo: Nx workspace management
  • TypeScript: Full type safety across the entire stack
  • Code Quality: ESLint, Prettier, Husky pre-commit hooks

OpenSpace Tech Stack


πŸ› οΈ Development Tools
β”œβ”€β”€ Nx Workspace (Monorepo management)
β”œβ”€β”€ TypeScript (Type safety)
└── Code Quality
    β”œβ”€β”€ ESLint (Linting)
    β”œβ”€β”€ Prettier (Formatting)
    └── Husky (Pre-commit hooks)

🌐 Frontend (Next.js 14)
β”œβ”€β”€ Framework: React + App Router
β”œβ”€β”€ Styling: Tailwind CSS
β”œβ”€β”€ State: React Hooks + Context API
β”œβ”€β”€ 3D Graphics: Three.js
└── Icons: Tabler Icons

πŸ”§ Backend (NestJS)
β”œβ”€β”€ API: GraphQL + Apollo Server
β”œβ”€β”€ Database: PostgreSQL + Prisma ORM
β”œβ”€β”€ Authentication: JWT + NextAuth.js
β”œβ”€β”€ Payments: Stripe Integration
└── Validation: class-validator

πŸ—οΈ Infrastructure
β”œβ”€β”€ Runtime: Node.js v18+
β”œβ”€β”€ Package Manager: Yarn
└── Containerization: Docker

πŸ“‹ Version Requirements

To avoid version mismatch issues, ensure you are using the exact versions specified below:

Runtime & Package Manager

  • Node.js: 20.x (Required)
  • Yarn: Latest stable version

Core Frameworks

  • NestJS: ^9.0.0
  • Next.js: 14.1.4
  • TypeScript: ^5.4.3 (root), ^5 (apps), ^4.7.4 (API)

Database & ORM

  • Prisma: 5.11.0
  • Prisma Client: 5.11.0

GraphQL & API

  • Apollo Server: 4.10.2
  • GraphQL: 16.8.1
  • NestJS GraphQL: 12.1.1

Styling

  • Tailwind CSS: 3.3.0

Development Tools

  • Nx: 22.3.3
  • ESLint: ^8.0.1
  • Prettier: ^2.3.2
  • Jest: 29.5.0

Key Dependencies Summary

Node.js: 20.x
NestJS: ^9.0.0
Next.js: 14.1.4
Prisma: 5.11.0
Prisma Client: 5.11.0
Apollo Server: 4.10.2
GraphQL: 16.8.1
Tailwind CSS: 3.3.0
Nx: 22.3.3

πŸš€ Getting Started

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v18 or higher)
  • Yarn package manager
  • PostgreSQL database
  • Docker (optional, for containerized deployment)

Installation

  1. Clone the repository

    git clone https://github.com/your-username/openspace.git
    cd openspace
  2. Install dependencies

    yarn install
  3. Set up environment variables

    Copy the example environment files and configure them:

    # API Environment
    cp apps/api/.env.example apps/api/.env
    
    # Web Applications
    cp apps/web/.env.example apps/web/.env
    cp apps/web-admin/.env.example apps/web-admin/.env
    cp apps/web-manager/.env.example apps/web-manager/.env
    cp apps/web-valet/.env.example apps/web-valet/.env

    Configure the following key variables:

    • DATABASE_URL: PostgreSQL connection string
    • NEXTAUTH_SECRET: Authentication secret
    • STRIPE_SECRET_KEY: Stripe payment secret
    • GOOGLE_CLIENT_ID: Google OAuth client ID
  4. Set up the database

    # Navigate to API directory
    cd apps/api
    
    # Run database migrations
    npx prisma migrate dev
    
    # Seed the database with sample data
    npx prisma db seed
  5. Start the development servers

    # From project root
    yarn dev
    
    # Or start services individually:
    yarn nx serve api          # API server (Port 3000)
    yarn nx serve web          # Customer app (Port 3001)
    yarn nx serve web-admin    # Admin panel (Port 3004)
    yarn nx serve web-manager  # Manager dashboard
    yarn nx serve web-valet    # Valet app

OpenSpace Setup Process Flowchart


1. πŸš€ START SETUP
   β”œβ”€β”€ Check Prerequisites
   β”‚   β”œβ”€β”€ Node.js v18+ installed? β†’ If NO β†’ Install Node.js v18+
   β”‚   β”œβ”€β”€ Yarn installed? β†’ If NO β†’ Install Yarn
   β”‚   └── PostgreSQL installed? β†’ If NO β†’ Install PostgreSQL
   β”‚
   β”œβ”€β”€ Clone Repository
   β”‚   └── git clone https://github.com/your-username/openspace.git
   β”‚
   β”œβ”€β”€ Install Dependencies
   β”‚   └── yarn install
   β”‚
   β”œβ”€β”€ Configure Environment
   β”‚   β”œβ”€β”€ Copy .env.example files to .env
   β”‚   └── Set DATABASE_URL, NEXTAUTH_SECRET, STRIPE_SECRET_KEY, etc.
   β”‚
   β”œβ”€β”€ Setup Database
   β”‚   β”œβ”€β”€ cd apps/api
   β”‚   β”œβ”€β”€ npx prisma migrate dev
   β”‚   └── npx prisma db seed
   β”‚
   └── Start Development Servers
       β”œβ”€β”€ yarn dev (from project root)
       └── Access applications:
           β”œβ”€β”€ API: http://localhost:3000
           β”œβ”€β”€ Customer App: http://localhost:3001
           β”œβ”€β”€ Manager App: http://localhost:3002
           β”œβ”€β”€ Valet App: http://localhost:3003
           β”œβ”€β”€ Admin Panel: http://localhost:3004
           └── πŸŽ‰ SETUP COMPLETE!

πŸ“– Usage

For Customers

  1. Sign Up/Login: Create an account or sign in with Google
  2. Find Parking: Search for available garages in your area
  3. Book a Spot: Select dates, times, and parking preferences
  4. Request Valet: Optional valet pickup/drop-off services
  5. Track & Pay: Monitor your booking and complete payment

For Garage Managers

  1. Manage Facilities: Add and configure parking garages
  2. Slot Configuration: Set up parking spaces with pricing
  3. Monitor Bookings: View real-time booking activity
  4. Valet Coordination: Assign valets to customer requests
  5. Analytics: Review performance metrics and revenue

For Valets

  1. Mobile App Access: Dedicated mobile interface
  2. Service Requests: Receive pickup/drop-off assignments
  3. GPS Tracking: Real-time location sharing with customers
  4. Status Updates: Mark services as completed
  5. Earnings Tracking: Monitor completed services

Screenshots

User Features

Login Page
Login Page
Search Map
Parking Locations on Map
Garage Booking Step 1
Garage Booking - Step 1
Garage Booking Step 2
Garage Booking - Step 2
Payment Page
Payment Processing
Booking History
Booking History

Manager Features

Manager Home
Manager Dashboard
Create Garage
Create New Garage
Booking Approvals
Approve Bookings
Valet Management
Manage Valets

Valet Features

Valet Trips
Valet's Trips

Admin Features

Admin Garage List
Manage All Garages
Admin Management
Admin Management Panel

πŸ”§ Development

Available Scripts

# Code formatting
yarn format:check    # Check code formatting
yarn format:write    # Auto-format code

# Type checking and linting
yarn tsc            # TypeScript compilation check
yarn lint           # ESLint checking

# Building
yarn build          # Build all applications
yarn nx build api   # Build specific app

# Validation
yarn validate       # Run format, type-check, lint, and build

Project Structure Details

API Backend (apps/api/)

  • GraphQL Schema: Auto-generated from Prisma models
  • Resolvers: Business logic for each entity
  • DTOs: Input validation and transformation
  • Services: Database operations and external integrations
  • Guards: Authentication and authorization

Web Applications (apps/web-*)

  • Pages: Next.js app router structure
  • Components: Reusable UI components from shared libraries
  • Hooks: Custom React hooks for data fetching
  • Utils: Helper functions and constants

Shared Libraries (libs/)

  • UI Library: Component library with Tailwind styling
  • Forms: Zod schemas and React Hook Form utilities
  • Network: GraphQL client with code generation
  • 3D: Three.js utilities for garage visualization
  • Utils: Common utilities and TypeScript types

OpenSpace Project Structure


openspace/
β”œβ”€β”€ apps/                          # Applications
β”‚   β”œβ”€β”€ api/                       # NestJS GraphQL API Backend
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ main.ts            # Application entry point
β”‚   β”‚   β”‚   β”œβ”€β”€ app.module.ts      # Main application module
β”‚   β”‚   β”‚   β”œβ”€β”€ common/            # Shared utilities & guards
β”‚   β”‚   β”‚   └── models/            # GraphQL resolvers & DTOs
β”‚   β”‚   β”œβ”€β”€ prisma/                # Database schema & migrations
β”‚   β”‚   └── package.json
β”‚   β”œβ”€β”€ web/                       # Customer Web App (Port 3001)
β”‚   β”‚   β”œβ”€β”€ src/app/               # Next.js app router pages
β”‚   β”‚   β”œβ”€β”€ src/components/        # React components
β”‚   β”‚   └── package.json
β”‚   β”œβ”€β”€ web-admin/                 # Admin Management Portal (Port 3004)
β”‚   β”œβ”€β”€ web-manager/               # Garage Manager Dashboard
β”‚   └── web-valet/                 # Valet Mobile Application
β”œβ”€β”€ libs/                          # Shared Libraries
β”‚   β”œβ”€β”€ ui/                        # Reusable UI Component Library
β”‚   β”‚   β”œβ”€β”€ src/components/        # UI components
β”‚   β”‚   └── src/styles/            # Tailwind styles
β”‚   β”œβ”€β”€ forms/                     # Form Components & Validation
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ bookSlot.tsx       # Booking form
β”‚   β”‚   β”‚   β”œβ”€β”€ createGarage.tsx   # Garage creation form
β”‚   β”‚   β”‚   └── schemas.ts         # Zod validation schemas
β”‚   β”œβ”€β”€ network/                   # GraphQL Client & API Utilities
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ config/            # GraphQL configuration
β”‚   β”‚   β”‚   └── gql/               # Generated GraphQL types
β”‚   β”œβ”€β”€ 3d/                        # Three.js 3D Visualization Library
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ components/        # 3D components
β”‚   β”‚   β”‚   └── scenes/            # 3D scenes
β”‚   └── util/                      # Utility Functions & Types
β”‚       β”œβ”€β”€ constants.ts           # App constants
β”‚       β”œβ”€β”€ date.ts                # Date utilities
β”‚       └── hooks/                 # Custom React hooks
β”œβ”€β”€ assets/                        # Static assets (screenshots, images)
β”œβ”€β”€ tools/                         # Development tools & scripts
β”œβ”€β”€ package.json                   # Root package.json
β”œβ”€β”€ nx.json                        # Nx workspace configuration
β”œβ”€β”€ README.md                      # This file
└── other config files...

πŸ” Security Features

  • JWT Authentication: Secure token-based authentication
  • Role-Based Access Control: Granular permissions system
  • Input Validation: Comprehensive request validation
  • SQL Injection Protection: Parameterized queries via Prisma
  • XSS Protection: Sanitized inputs and CSP headers
  • Rate Limiting: API rate limiting and DDoS protection
  • IP Blocking: Configurable IP-based access control
  • CAPTCHA Integration: hCaptcha for bot protection

πŸ“Š API Documentation

The GraphQL API provides comprehensive documentation accessible at:

  • GraphQL Playground: http://localhost:3000/graphql
  • Swagger UI: http://localhost:3000/api (REST endpoints)

Key Entities

  • Users: Customer, Manager, Valet, and Admin accounts
  • Garages: Parking facilities with slots and pricing
  • Bookings: Parking reservations with timeline tracking
  • ValetAssignments: Pickup and drop-off service coordination
  • Reviews: Customer feedback system
  • Verifications: Admin approval system for garages
swagger-image

πŸš€ Deployment

Production Checklist

  • Environment variables configured
  • Database migrations applied
  • SSL certificates installed
  • Domain configured
  • CDN setup for static assets
  • Monitoring and logging configured
  • Backup strategy implemented

Docker Deployment

# Build and run with Docker Compose
docker-compose up -d

# Or build individual services
docker build -t openspace-api apps/api/
docker build -t openspace-web apps/web/

🀝 Contributing

We welcome contributions to OpenSpace! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes and ensure tests pass
  4. Run validation: yarn validate
  5. Commit your changes: git commit -m 'Add amazing feature'
  6. Push to the branch: git push origin feature/amazing-feature
  7. Open a Pull Request

Development Guidelines

  • Follow the existing code style and conventions
  • Write comprehensive tests for new features
  • Update documentation for API changes
  • Ensure TypeScript strict mode compliance
  • Use conventional commit messages
OpenSpace Contribution Workflow

πŸ‘₯ CONTRIBUTOR STARTS HERE
β”‚
β”œβ”€β”€ 1. Fork Repository on GitHub
β”‚   └── Create your own copy of the project
β”‚
β”œβ”€β”€ 2. Clone Your Fork Locally
β”‚   └── git clone https://github.com/YOUR_USERNAME/openspace.git
β”‚
β”œβ”€β”€ 3. Create Feature Branch
β”‚   └── git checkout -b feature/your-awesome-feature
β”‚
β”œβ”€β”€ 4. Make Your Changes
β”‚   β”œβ”€β”€ Write code, add tests, update documentation
β”‚   └── Follow coding standards and conventions
β”‚
β”œβ”€β”€ 5. Run Validation Checks
β”‚   β”œβ”€β”€ yarn validate (runs format, lint, type-check, build)
β”‚   └── yarn test (run tests)
β”‚
β”œβ”€β”€ 6. Tests Pass?
β”‚   β”œβ”€β”€ YES β†’ Continue to commit
β”‚   └── NO β†’ Fix issues and re-run validation
β”‚
β”œβ”€β”€ 7. Commit Your Changes
β”‚   └── git commit -m 'feat: add awesome feature description'
β”‚       (Use conventional commit format)
β”‚
β”œβ”€β”€ 8. Push to Your Fork
β”‚   └── git push origin feature/your-awesome-feature
β”‚
β”œβ”€β”€ 9. Create Pull Request
β”‚   └── Open PR on GitHub with clear description
β”‚
β”œβ”€β”€ 10. Code Review Process
β”‚    β”œβ”€β”€ Maintainers review your code
β”‚    └── Feedback provided if needed
β”‚
β”œβ”€β”€ 11. Review Approved?
β”‚    β”œβ”€β”€ YES β†’ Merge to main branch
β”‚    └── NO β†’ Address feedback and update PR
β”‚
└── πŸŽ‰ CONTRIBUTION COMPLETE!
    └── Your changes are now part of OpenSpace!

πŸ“ License

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

πŸ™ Acknowledgments

  • NestJS Community for the excellent framework
  • Prisma Team for the powerful ORM
  • Next.js Team for the amazing React framework
  • Tailwind CSS for the utility-first styling approach
  • Three.js for 3D visualization capabilities

About

OpenSpace is a comprehensive parking and valet management platform that connects customers, garage operators, managers, and valets through an intuitive digital ecosystem. Experience seamless parking reservations, real-time valet tracking, and efficient garage operations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages