๐ง Currently in Development - This API is actively being developed and is not yet ready for production use.
Backend API for the Uno Tracker application - A FastAPI-based REST API that handles user authentication, game management, and score tracking for Uno games.
- ๐ JWT Authentication - Secure user authentication with access tokens
- ๐ค OAuth Integration - Google OAuth support for easy sign-in
- ๐ฎ Game Management - Create, join, and manage Uno game sessions
- ๐ Score Tracking - Real-time score updates and game history
- ๐๏ธ PostgreSQL Database - Robust data persistence with SQLAlchemy ORM
- ๐ Database Migrations - Alembic for database schema management
- ๐ API Documentation - Auto-generated OpenAPI/Swagger documentation
- ๐ CORS Support - Configured for frontend integration
- โก High Performance - Built with FastAPI for maximum speed
- Python 3.8 or later
- PostgreSQL 13 or later
- pip (Python package manager)
- Clone the repository:
git clone https://github.com/BruceGoodGuy/uno-tracker-v2-backend.git
cd uno-tracker-backend- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Set up environment variables:
cp .env.example .env # Create environment file
# Edit .env with your configurationRequired environment variables:
# Database
DATABASE_URL=postgresql://username:password@localhost:5432/uno_tracker
POSTGRES_USER=your_username
POSTGRES_PASSWORD=your_password
POSTGRES_DB=uno_tracker
# JWT Configuration
SECRET_KEY=your-super-secret-jwt-key
ACCESS_TOKEN_EXPIRE_MINUTES=30
REFRESH_TOKEN_EXPIRE_DAYS=7
# OAuth
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
# Frontend
FRONTEND_URL=http://localhost:3000- Set up the database:
# Run database migrations
alembic upgrade head- Start the development server:
uvicorn src.main:app --reload --host 0.0.0.0 --port 8000The API will be available at http://localhost:8000
- FastAPI 0.116.1 - Modern, fast web framework for building APIs
- SQLAlchemy 2.0.41 - Python SQL toolkit and ORM
- PostgreSQL - Advanced open source database
- Alembic 1.16.4 - Database migration tool
- Pydantic 2.9.2 - Data validation using Python type hints
- python-jose - JWT implementation
- Passlib - Password hashing library
- Uvicorn - ASGI server implementation
uno-tracker-backend/
โโโ alembic/ # Database migrations
โ โโโ versions/ # Migration files
โ โโโ env.py # Migration environment
โโโ src/
โ โโโ auth/ # Authentication module
โ โ โโโ models.py # User and OAuth models
โ โ โโโ router.py # Auth endpoints
โ โ โโโ schemas.py # Pydantic schemas
โ โ โโโ service.py # Auth business logic
โ โโโ core/ # Core functionality
โ โ โโโ config.py # Configuration settings
โ โ โโโ database.py # Database connection
โ โ โโโ security.py # Security utilities
โ โโโ game/ # Game management module
โ โ โโโ models.py # Game and score models
โ โ โโโ router.py # Game endpoints
โ โ โโโ schemas.py # Game schemas
โ โ โโโ service.py # Game business logic
โ โโโ dependencies.py # Shared dependencies
โ โโโ main.py # FastAPI application
โโโ alembic.ini # Alembic configuration
โโโ requirements.txt # Python dependencies
โโโ README.md # This file
POST /auth/register- Register a new userPOST /auth/login- User loginPOST /auth/refresh- Refresh access tokenGET /auth/google- Google OAuth loginPOST /auth/logout- User logoutGET /auth/me- Get current user info
POST /games- Create a new gameGET /games- List user's gamesGET /games/{game_id}- Get game detailsPOST /games/{game_id}/join- Join a gamePOST /games/{game_id}/scores- Update game scoresDELETE /games/{game_id}- Delete a game
Once the server is running, you can access:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc - OpenAPI JSON:
http://localhost:8000/openapi.json
- Set environment variables for production
- Install dependencies:
pip install -r requirements.txt - Run migrations:
alembic upgrade head - Start with Gunicorn:
gunicorn src.main:app -w 4 -k uvicorn.workers.UvicornWorker
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- JWT Authentication system
- Google OAuth integration
- Database models and migrations
- Complete game management endpoints
- Real-time score tracking
- User profile management
- Game statistics and analytics
- WebSocket support for live updates
- API rate limiting
- Docker containerization
- CI/CD pipeline
- Game management endpoints are still under development
- WebSocket functionality not yet implemented
- Comprehensive error handling needs improvement
This project is licensed under the MIT License - see the LICENSE file for details.
BruceGoodGuy
- GitHub: @BruceGoodGuy
- Project Link: https://github.com/BruceGoodGuy/uno-tracker-v2
- Thanks to the FastAPI team for the excellent framework
- SQLAlchemy for the powerful ORM
- PostgreSQL for robust data storage
- All contributors and testers
โญ Star this repository if you find it helpful!