Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MicroCasino MVP

A mobile-first casino website MVP built with FastAPI backend, Next.js frontend, and PostgreSQL database, all containerized with Docker.

Features

  • 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

Tech Stack

  • Backend: FastAPI + PostgreSQL + Redis + Alembic
  • Frontend: Next.js 14 + Tailwind CSS + TypeScript
  • Database: PostgreSQL with Redis caching
  • Deployment: Docker Compose

Quick Start

  1. Clone and start the application:

    docker-compose up -d
  2. Run database migrations:

    docker-compose exec backend alembic upgrade head
  3. Seed the database with sample data:

    docker-compose exec backend python app/db/seed.py
  4. Access the application:

Development

Backend Development

cd backend
pip install -r requirements.txt
uvicorn app.main:app --reload

Frontend Development

cd frontend
npm install
npm run dev

Database Management

# 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 -1

Project Structure

microcasino/
├── 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

API Endpoints

  • GET /health - Health check
  • GET /api/v1/games - List all games
  • GET /api/v1/games/featured - List featured games
  • POST /api/v1/auth/register - User registration
  • POST /api/v1/auth/token - User login
  • GET /api/v1/users/me - Get current user
  • GET /api/v1/transactions - Get user transactions

Environment Variables

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-here

Testing

Backend Tests

docker-compose exec backend pytest

Frontend Tests

docker-compose exec frontend npm test

Production Deployment

  1. Update environment variables for production
  2. Build production images:
    docker-compose -f docker-compose.prod.yml build
  3. Deploy:
    docker-compose -f docker-compose.prod.yml up -d

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

License

This project is licensed under the MIT License.

About

tiny sample casino with slots, blackjack, and roulette

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages