A mobile-first casino website MVP built with FastAPI backend, Next.js frontend, and PostgreSQL database, all containerized with Docker.
- Landing Page: Featured games carousel, recent bets with replay, promotional banners
- Profile Page: User account management, transaction history, settings
- Cash Desk: Deposit/withdrawal interface, balance display, transaction history
- Games Catalog: Searchable game library with categories and filters
- Mobile-First Design: Responsive design optimized for mobile browsers
- Docker Deployment: Single-command deployment with docker-compose
- Backend: FastAPI + PostgreSQL + Redis + Alembic
- Frontend: Next.js 14 + Tailwind CSS + TypeScript
- Database: PostgreSQL with Redis caching
- Deployment: Docker Compose
-
Clone and start the application:
docker-compose up -d
-
Run database migrations:
docker-compose exec backend alembic upgrade head -
Seed the database with sample data:
docker-compose exec backend python app/db/seed.py -
Access the application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
cd backend
pip install -r requirements.txt
uvicorn app.main:app --reloadcd frontend
npm install
npm run dev# Create new migration
docker-compose exec backend alembic revision --autogenerate -m "Description"
# Apply migrations
docker-compose exec backend alembic upgrade head
# Rollback migration
docker-compose exec backend alembic downgrade -1microcasino/
├── backend/
│ ├── app/
│ │ ├── api/ # API routes
│ │ ├── core/ # Configuration and security
│ │ ├── db/ # Database connection and seeding
│ │ ├── models/ # SQLAlchemy models
│ │ ├── schemas/ # Pydantic schemas
│ │ └── main.py # FastAPI application
│ ├── alembic/ # Database migrations
│ ├── requirements.txt
│ └── Dockerfile
├── frontend/
│ ├── app/ # Next.js app directory
│ ├── components/ # React components
│ ├── lib/ # Utilities and API client
│ ├── package.json
│ └── Dockerfile
├── docker-compose.yml
└── README.md
GET /health- Health checkGET /api/v1/games- List all gamesGET /api/v1/games/featured- List featured gamesPOST /api/v1/auth/register- User registrationPOST /api/v1/auth/token- User loginGET /api/v1/users/me- Get current userGET /api/v1/transactions- Get user transactions
Create a .env file in the backend directory:
DATABASE_URL=postgresql://microcasino:microcasino_dev@localhost:5432/microcasino
REDIS_URL=redis://localhost:6379
SECRET_KEY=your-secret-key-heredocker-compose exec backend pytestdocker-compose exec frontend npm test- Update environment variables for production
- Build production images:
docker-compose -f docker-compose.prod.yml build
- Deploy:
docker-compose -f docker-compose.prod.yml up -d
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
This project is licensed under the MIT License.