7f7da15965
Completed: - Phase 0: Project Setup (T001-T003) - Docker Compose, FastAPI skeleton, React SPA - Phase 1: Auth System (T004-T008) - DB models, JWT auth, RBAC middleware, user management - Phase 2: Contacts & Tags (T009-T011) - CRUD API + UI - Phase 3: Equipment Catalog (T012-T014) - Models, API, UI with barcode/QR - Phase 4: Crew Management (T015-T017) - Models, availability, UI - Phase 5: Vehicle Fleet (T018-T020) - Models, assignments, UI - Phase 6: Projects (T021-T023) - Project hierarchy models, CRUD API, list/detail UI
114 lines
2.9 KiB
Markdown
114 lines
2.9 KiB
Markdown
# Rentman Clone
|
|
|
|
A full-stack clone of Rentman.io, a project-centric SaaS platform for rental and event industries.
|
|
|
|
## Tech Stack
|
|
|
|
- **Backend:** FastAPI (Python 3.12+), SQLAlchemy 2.0, SQLite/PostgreSQL, Redis, Celery
|
|
- **Frontend:** React 19, TypeScript, Vite, Tailwind CSS, Radix UI, Zustand, React Query
|
|
- **Storage:** MinIO (S3-compatible)
|
|
- **Deployment:** Docker Compose, Coolify
|
|
|
|
## Getting Started
|
|
|
|
### Prerequisites
|
|
|
|
- Docker & Docker Compose
|
|
- Or Python 3.12+, Node.js 20+
|
|
|
|
### Quick Start (Docker)
|
|
|
|
```bash
|
|
cp .env.example .env
|
|
# Edit .env if needed
|
|
make dev
|
|
```
|
|
|
|
This starts:
|
|
- Backend API at http://localhost:8000 (Swagger at /docs)
|
|
- Frontend at http://localhost:5173
|
|
- Redis at port 6379
|
|
- MinIO at ports 9000 (API) and 9001 (Console)
|
|
|
|
### Local Development (without Docker)
|
|
|
|
#### Backend
|
|
|
|
```bash
|
|
cd backend
|
|
python -m venv venv
|
|
source venv/bin/activate
|
|
pip install -r requirements.txt
|
|
cp ../.env.example .env # adjust DATABASE_URL if needed
|
|
uvicorn app.main:app --reload
|
|
```
|
|
|
|
#### Frontend
|
|
|
|
```bash
|
|
cd frontend
|
|
npm install
|
|
npm run dev
|
|
```
|
|
|
|
### Project Structure
|
|
|
|
```
|
|
.
|
|
├── backend/ # FastAPI application
|
|
│ ├── app/
|
|
│ │ ├── main.py # App entry point
|
|
│ │ ├── core/ # Config, security
|
|
│ │ ├── db/ # Database setup
|
|
│ │ ├── models/ # SQLAlchemy models
|
|
│ │ ├── schemas/ # Pydantic schemas
|
|
│ │ ├── api/ # API routes
|
|
│ │ └── services/ # Business logic
|
|
│ ├── alembic/ # Database migrations
|
|
│ └── requirements.txt
|
|
├── frontend/ # React application
|
|
│ ├── src/
|
|
│ │ ├── components/ # Shared UI components
|
|
│ │ ├── pages/ # Page components
|
|
│ │ ├── stores/ # Zustand stores
|
|
│ │ ├── hooks/ # Custom hooks
|
|
│ │ └── lib/ # Utilities
|
|
│ └── package.json
|
|
├── docker-compose.yml
|
|
├── Makefile
|
|
└── .env.example
|
|
```
|
|
|
|
## Environment Variables
|
|
|
|
See `.env.example` for all required variables. Key ones:
|
|
|
|
| Variable | Description |
|
|
|----------|-------------|
|
|
| DATABASE_URL | Database connection string (SQLite for dev) |
|
|
| JWT_SECRET_KEY | Secret for signing JWT tokens |
|
|
| REDIS_URL | Redis connection URL |
|
|
| MINIO_ACCESS_KEY / MINIO_SECRET_KEY | MinIO credentials |
|
|
| CORS_ORIGINS | Allowed origins for CORS |
|
|
|
|
## Available Scripts
|
|
|
|
```bash
|
|
make dev # Start all services
|
|
make install-backend # Install Python dependencies
|
|
make install-frontend # Install npm dependencies
|
|
make migrate # Run database migrations
|
|
make create-migration MSG="description" # Create new migration
|
|
make clean # Clean cache files
|
|
```
|
|
|
|
## API Documentation
|
|
|
|
Once the backend is running, visit:
|
|
- Swagger UI: http://localhost:8000/docs
|
|
- ReDoc: http://localhost:8000/redoc
|
|
|
|
## License
|
|
|
|
MIT
|