A full-featured online casino platform built with Angular and NestJS.
This is a comprehensive online casino platform that provides users with a secure, engaging, and fair gaming experience. The platform includes various casino games, user account management, payment processing, and responsible gaming features.
- Framework: NestJS (Node.js)
- Database: PostgreSQL (primary), Redis (caching & sessions)
- ORM: TypeORM
- Authentication: JWT tokens with refresh token rotation
- Real-time: Socket.io (planned)
- Payment Processing: Stripe / PayPal integration (planned)
- Game Engine: Custom provably fair algorithm implementation
- Framework: Angular 17+ (standalone components, signals-based state management)
- Styling: Tailwind CSS
- UI Components: Custom component library
- Real-time Updates: WebSockets (Socket.io client)
-
Authentication System
- User registration and login
- JWT access and refresh tokens
- Password hashing with bcrypt
- Session management
- Auth guards and strategies
-
User Management
- User profiles with KYC status
- Responsible gaming limits
- Self-exclusion options
- Activity tracking
- VIP levels
-
Wallet & Transactions
- Multi-currency support structure
- Deposit and withdrawal processing
- Transaction history
- Real-time balance updates
- Bet and win recording
-
Game System
- Game entities and metadata
- Game session tracking
- Support for multiple game types
-
Provably Fair Engine
- Server and client seed generation
- Cryptographic hash verification
- Random number generation
- Outcome verification system
-
Casino Games
- Slot Machines: 3-reel slot with weighted symbols and multipliers
- Blackjack: Classic blackjack with dealer AI
- Roulette: European roulette with various bet types
-
Bonus System
- Multiple bonus types (welcome, deposit, cashback, etc.)
- Wagering requirements tracking
- Bonus expiration handling
- Active bonus management
- Angular frontend application
- WebSocket gateway for real-time features
- Admin dashboard
- Leaderboards and social features
- Additional payment integrations
cassino/
βββ backend/ # NestJS backend application
β βββ src/
β β βββ auth/ # Authentication module
β β βββ user/ # User management
β β βββ wallet/ # Wallet and transactions
β β βββ game/ # Game engine and logic
β β β βββ entities/ # Game entities
β β β βββ services/ # Game implementations
β β β βββ dto/ # Data transfer objects
β β βββ bonus/ # Bonus system
β β βββ database/ # Database utilities (Redis)
β β βββ common/ # Shared utilities
β βββ package.json
β βββ tsconfig.json
βββ frontend/ # Angular frontend (to be implemented)
βββ docker-compose.yml # PostgreSQL and Redis setup
βββ .env.example # Environment variables template
βββ README.md # This file
- Node.js (v18 or higher)
- Docker and Docker Compose
- npm or yarn
-
Clone the repository
git clone <repository-url> cd cassino
-
Set up environment variables
cp .env.example .env # Edit .env with your configuration -
Start the databases
docker-compose up -d
-
Install backend dependencies
cd backend npm install -
Run database migrations
npm run typeorm migration:run
-
Start the backend server
npm run start:dev
The backend API will be available at http://localhost:3000/api
Key environment variables (see .env.example for complete list):
# Database
DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=casino_user
DB_PASSWORD=casino_pass
DB_DATABASE=casino_db
# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
# JWT
JWT_SECRET=your-secret-key
JWT_REFRESH_SECRET=your-refresh-secret
JWT_EXPIRES_IN=15m
JWT_REFRESH_EXPIRES_IN=7d
# Application
NODE_ENV=development
PORT=3000POST /api/auth/register- Register new userPOST /api/auth/login- LoginPOST /api/auth/logout- LogoutPOST /api/auth/refresh- Refresh access token
GET /api/user/profile- Get user profilePUT /api/user/profile- Update profilePUT /api/user/responsible-gaming/limits- Set gaming limitsPUT /api/user/self-exclusion- Set self-exclusion
GET /api/wallet/balance- Get current balancePOST /api/wallet/deposit- Make a depositPOST /api/wallet/withdraw- Request withdrawalGET /api/wallet/transactions- Get transaction history
GET /api/games- List all available gamesGET /api/games/:id- Get game detailsPOST /api/games/:id/play- Play a gameGET /api/games/:id/history- Get game historyGET /api/games/sessions/:sessionId/verify- Verify game outcome
GET /api/bonuses/available- Get available bonusesPOST /api/bonuses/claim- Claim a bonusGET /api/bonuses/active- Get active bonusesGET /api/bonuses/history- Get bonus history
All games use a provably fair algorithm to ensure transparency and fairness:
- Server Seed: Generated randomly by the server
- Client Seed: Provided by the client or generated randomly
- Nonce: Incremental counter for each game round
- Combined Hash: SHA-256 hash of server seed + client seed + nonce
Players can verify game outcomes using the provided seeds and nonce.
- 3 reels with 3 symbols each
- Weighted symbol distribution
- Multipliers: 2x to 50x
- Payline: Middle row
- Classic rules
- Dealer hits on 16, stands on 17
- Blackjack pays 3:2
- Push on ties
- European style (single zero)
- Bet types: straight up (35:1), color (1:1), even/odd (1:1), high/low (1:1)
- Password hashing with bcrypt
- JWT token authentication
- Refresh token rotation
- Rate limiting (planned)
- Input validation with class-validator
- SQL injection prevention via TypeORM
- XSS protection
The platform includes responsible gaming features:
- Deposit limits (daily, weekly, monthly)
- Loss limits
- Session time limits
- Self-exclusion options
- Reality checks (planned)
# Unit tests
npm run test
# E2E tests
npm run test:e2e
# Test coverage
npm run test:covcd backend
npm run start:devThe backend will run on http://localhost:3000 with hot reload enabled.
# Generate a new migration
npm run typeorm migration:generate -- -n MigrationName
# Run migrations
npm run typeorm migration:run
# Revert migration
npm run typeorm migration:revert(To be documented - deployment strategies for production)
(To be documented - contribution guidelines)
MIT
- Obtain proper gambling licenses
- Implement comprehensive KYC/AML procedures
- Add payment gateway integrations
- Implement fraud detection systems
- Add comprehensive logging and monitoring
- Conduct security audits
- Ensure compliance with local gambling regulations
- Add age verification
- Implement geolocation restrictions
For questions or issues, please open an issue on GitHub.
Last Updated: November 2025