mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-10 06:07:55 -06:00
This commit introduces a comprehensive deployment strategy that unifies the frontend and backend into a single Docker container served by the Rust backend, streamlining the deployment process and improving production architecture. Key changes: - Split CI/CD workflows: separated build.yaml (for CI/PR checks) and deploy.yaml (for production deployment) - Implemented unified Docker deployment where the Axum server serves both API routes (under /api) and frontend static files - Added GitHub Container Registry integration for Docker image distribution - Updated Railway configuration to use the new healthcheck path (/api/health) - Enhanced postgres.ts script with named volumes and constants for better container management - Added API client utilities (web/lib/api.ts) and environment configuration (web/.env.example) for frontend-backend communication - Configured Vite proxy for local development while supporting same-origin requests in production - Updated Dockerfile to include frontend static files and proper environment variable handling This architecture eliminates the need for separate deployments and CORS configuration, as the frontend and API are served from the same origin.
pacman-server
Despite the naming of this crate, it's not a server for the Pac-Man game allowing multiplayer or anything super interesting.
This crate is a webserver that hosts an OAuth login and leaderboard API for the main pacman crate to hook into.
Features
- Axum Webserver
- Health Check
- Inbound Rate Limiting
- Outbound Rate Limiting
- Provider Circuit Breaker
- Database
- OAuth
- Discord
- GitHub
- Leaderboard
- Score Submission
- Score Listings
- Pagination
- Global / Daily
- Name Restrictions & Flagging
- Avatars
- 8-bit Conversion
- Storage?
- Common Server/Client Crate
- CI/CD & Tests
Todo
- Refresh Token Handling (Encryption, Expiration & Refresh Timings)
- Refresh Token Background Job
- S3 Storage for Avatars
- Common Server/Client Crate, Basics
- Crate-level Log Level Configuration
- Span Tracing
- Avatar Pixelization
- Leaderboard API
- React-based Frontend
- Name Restrictions & Flagging
- Simple CI/CD Checks & Tests
- API Rate Limiting (outbound provider requests)
- API Rate Limiting (inbound requests, by IP, by User)
- Provider Circuit Breaker
- Merge migration files
Notes
Image Handling
Avatar images are stored in S3 as follows:
-
avatars/{user_public_id}/{avatar_hash}.original.png -
avatars/{user_public_id}/{avatar_hash}.mini.png -
The original image is converted to PNG and resized to a maximum of 512x512 pixels.
- Ideally, non-square images are fitted to a square.
-
The mini image is converted to PNG and resized to a maximum of 16x16, 24x24, or 32x32 pixels. TBD.
-
All images receive a Content-Type header of
image/png.
Image processing is handled immediately asynchronously, allowing a valid presigned URL to be generated immediately.