A full-stack platform connecting clients with professionals who provide grave care services — cleaning, planting flowers, painting fences — with real-time chat, photo reports, and a rating system.
Backend
- FastAPI — async REST API + WebSocket
- PostgreSQL 16 — primary database
- SQLAlchemy 2.0 — async ORM
- Alembic — database migrations
- Redis 7 — JWT token storage + Pub/Sub for real-time messaging
- Yandex Object Storage — S3-compatible photo storage
- uv — Python package manager
Frontend
- React 18 + TypeScript
- Vite — build tool
- Tailwind CSS — styling
- Framer Motion — animations
- React Router v6 — client-side routing
Infrastructure
- Docker + Docker Compose
- WebSocket with exponential backoff reconnect
- Auth — JWT access/refresh tokens, stored in HTTP-only cookies, refresh token revocation via Redis
- Services — executors create service listings with city, cemetery, and pricing info
- Orders — full order lifecycle:
SENT → ACCEPTED → IN_PROCESS → COMPLETED / REJECTED - Chats — real-time WebSocket messaging, photo sharing via S3, one chat per order
- Ratings — clients rate services after order completion, average rating auto-updated
- Photo reports — executors upload a completion photo when finishing an order
- Search — filter services by city, text, and price range
light_memory/
├── src/
│ ├── auth/ # JWT auth, users
│ ├── services/ # Service listings, ratings
│ ├── orders/ # Order management
│ ├── chats/ # WebSocket chat, messages
│ ├── s3/ # Yandex S3 integration
│ ├── redis/ # Redis client
│ └── db/ # SQLAlchemy engine, session
├── alembic/ # Database migrations
├── frontend/ # React + TypeScript SPA
│ └── src/
│ ├── api/ # API client functions
│ ├── components/# Navbar, ServiceCard
│ ├── pages/ # Home, Services, Chat, Orders, ...
│ └── context/ # Auth context
├── main.py # FastAPI app entrypoint
├── docker-compose.yaml
└── Dockerfile
- Docker & Docker Compose
- Node.js 18+ (for frontend dev)
Create a .env file in the project root:
# Database
DB_USER=postgres
DB_PASS=postgres
DB_NAME=light_memory
DB_HOST=localhost
DB_PORT=5432
# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
# JWT
JWT_SECRET=your-secret-key
JWT_ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30
REFRESH_TOKEN_EXPIRE_DAYS=30
# S3 (Yandex Object Storage)
S3_ENDPOINT=https://storage.yandexcloud.net
S3_REGION=ru-central1
S3_BUCKET=your-bucket-name
S3_ACCESS_KEY=your-access-key
S3_SECRET_KEY=your-secret-keydocker compose up --buildThe API will be available at http://localhost:8000.
API docs (Swagger) at http://localhost:8000/docs.
cd frontend
npm install
npm run devFrontend dev server: http://localhost:5173
| Method | Endpoint | Description |
|---|---|---|
POST |
/auth/register |
Register a new user |
POST |
/auth/login |
Login, get tokens |
POST |
/auth/refresh |
Refresh access token |
POST |
/auth/logout |
Revoke refresh token |
GET |
/services/ |
List services (with filters) |
POST |
/services/create |
Create a service listing |
GET |
/services/{id} |
Get service details |
GET |
/services/{id}/rates |
Get service reviews |
POST |
/services/rate/{id} |
Rate a service |
POST |
/orders/create |
Create an order |
GET |
/orders/ |
Get my orders |
GET |
/orders/pending |
Get incoming orders (executor) |
PUT |
/orders/accept/{id} |
Accept an order |
PUT |
/orders/reject/{id} |
Reject an order |
PUT |
/orders/start/{id} |
Start working on an order |
PUT |
/orders/complete/{id} |
Complete with photo |
GET |
/chats/ |
Get all my chats |
GET |
/chats/{id} |
Get chat details |
GET |
/chats/{id}/messages |
Get message history |
POST |
/chats/{id}/upload |
Upload photo to chat |
WS |
/chats/ws/{id} |
WebSocket connection |
# Apply all migrations
uv run alembic upgrade head
# Create a new migration
uv run alembic revision --autogenerate -m "description"
# Rollback one step
uv run alembic downgrade -1MIT