Getting Started
Quick start guide
Architecture
System design
API Reference
Endpoints & examples
Deployment
Production setup
Table of Contents
Download Docs
Getting Started
AIParksit is a comprehensive geo-spatial parking platform built with modern technologies. This documentation covers all aspects of the system.
Quick Start
# Clone the repository
git clone https://github.com/aiparksit/platform.git
# Install dependencies
cd platform && npm install
# Start development server
npm run dev
System Requirements
- Node.js 18+ or 20+
- PostgreSQL 14+ with PostGIS extension
- Redis 6+
- 4GB RAM minimum (8GB recommended)
Architecture Overview
The platform follows a modern microservices-inspired architecture with clear separation of concerns.
┌─────────────────────────────────────┐ │ Internet (Public) │ └─────────────┬───────────────────────┘ ↓ ┌─────────────────────────────────────┐ │ pfSense Firewall │ │ WAN: 63.226.48.138 │ └─────────────┬───────────────────────┘ ↓ ┌─────────────────────────────────────┐ │ Nginx Reverse Proxy │ │ SSL/TLS Termination │ └─────────────┬───────────────────────┘ ↓ ┌───────┴────────┐ ↓ ↓ ┌──────────┐ ┌──────────────┐ │Dashboard │ │ Backend API │ │(Next.js) │ │(Express.js) │ │Port 3000 │ │Port 3004 │ └──────────┘ └──────┬───────┘ ↓ ┌────────┴────────┐ ↓ ↓ ┌──────────┐ ┌──────────┐ │PostgreSQL│ │ Redis │ │+ PostGIS │ │ Cache │ └──────────┘ └──────────┘
Key Components
- Backend API: Node.js + Express with REST, GraphQL, and WebSocket
- Frontend: Next.js 14 with TypeScript and Tailwind CSS
- Database: PostgreSQL with PostGIS for spatial queries
- Cache: Redis for session management and caching
- Proxy: Nginx for load balancing and SSL termination
Backend API
The backend API provides 40+ endpoints across multiple domains.
API Endpoints
Facilities API
GET /api/facilities
- List all facilitiesPOST /api/facilities
- Create facilityGET /api/facilities/:id
- Get facility details
Marketplace API
GET /api/marketplace/listings
- Browse listingsPOST /api/marketplace/listings
- Create listingGET /api/marketplace/nearby
- Find nearby spaces
AI API
POST /api/ai/match
- Smart matchmakingGET /api/ai/pricing
- Dynamic pricingGET /api/ai/predict
- Occupancy prediction
Investor API
GET /api/investor/metrics
- Platform metricsGET /api/investor/projections
- Financial projections
Database Schema
PostgreSQL database with PostGIS extension for spatial queries.
Core Tables
parking_facilities
- Operator-managed facilitiesparking_spots
- Individual parking spacesmarketplace_listings
- P2P parking listingsbookings
- Reservation recordsreviews
- User reviews and ratingsusers
- User accountspricing_rules
- Dynamic pricing configurationpredictions
- AI occupancy predictions
Spatial Queries
-- Find nearby parking spaces
SELECT * FROM marketplace_listings
WHERE ST_DWithin(
location::geography,
ST_GeogFromText('POINT(-122.4194 37.7749)'),
1000 -- 1km radius
);
AI Features
Three core AI-powered features enhance the platform.
1. Smart Matchmaking
Matches drivers with optimal parking spots based on:
- Distance (40% weight)
- Price (30% weight)
- Rating (20% weight)
- Features (10% weight)
✓ 85% match accuracy
2. Dynamic Pricing
Automatically adjusts prices based on:
- Time of day (peak hours +50%)
- Demand level (high +30%, low -10%)
- Day of week (weekends -20%)
- Special events (custom multipliers)
✓ +35% revenue optimization
3. Occupancy Prediction
Forecasts availability for 5-15 minute windows using:
- Historical patterns
- Current occupancy trends
- Time-based analysis
- Confidence scoring
✓ 78% prediction accuracy
Deployment Guide
Current production deployment on dedicated server with pfSense firewall.
Production Stack
- Server: 10.123.45.22 (private network)
- Firewall: pfSense (63.226.48.138 public IP)
- Proxy: Nginx with SSL/TLS
- Process Manager: PM2
- SSL: Let's Encrypt (auto-renewal)
Deployment Commands
# Deploy backend
rsync -avz src/ root@server:/var/www/backend/
pm2 restart backend-api
# Deploy frontend
rsync -avz app/ root@server:/var/www/dashboard/
pm2 restart dashboard
Security
Multi-layered security approach with industry best practices.
Security Measures
- JWT authentication with secure tokens
- SSL/TLS encryption (HTTPS only)
- pfSense firewall with NAT
- Rate limiting on API endpoints
- SQL injection prevention (parameterized queries)
- XSS protection headers
- CORS configuration
- Environment variable management
Need All Documentation?
Download complete documentation package with all .md files