Skip to content

codesamu/Blackjack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blackjack

Python Flask MySQL Linux Windows macOS iOSAndroid

A simple Blackjack game with a leaderboard

📋 Table of Contents

✨ Features

🔐 Authentication & Security

  • User authentication system (register/login/logout)
  • Session management
  • MySQL database integration
  • Virtual currency system with initial 50 credit balance
  • Transaction logging and monitoring

🎰 Blackjack Game

  • Complete game logic following standard casino rules
  • Intelligent dealer AI (hits on 16-, stands on 17+)
  • Card scoring system:
    • Face cards = 10
    • Ace = 1 or 11 (dynamic)
    • Number cards = face value
  • Multiple win conditions:
    • Natural blackjack (3:2 payout)
    • Regular win (1:1 payout)
    • Push and bust detection
  • Configurable betting system

🎨 User Interface

  • Modern, responsive design
  • Mobile-friendly layout
  • Real-time balance updates
  • Interactive game controls
  • Strategic dealer card visibility
  • Intuitive game messaging system

🛠️ Technologies Used

  • Python 3.6+
  • Flask web framework
  • MySQL database
  • HTML5/CSS3

🏗️ Project Structure

Database Schema

CREATE TABLE users (
    id INT PRIMARY KEY AUTO_INCREMENT,
    username VARCHAR(255) NOT NULL UNIQUE,
    password VARCHAR(255) NOT NULL,
    money DECIMAL(10,2) DEFAULT 50.00
);

API Endpoints

Authentication Routes

Method Endpoint Description
GET / Login page
POST / Process login
GET /register Registration page
POST /register Process registration
GET /logout Logout user

Game Routes

Method Endpoint Description
GET /blackjack Main game view
GET /blackjack/new Start new game
GET /blackjack/hit Hit action
GET /blackjack/stand Stand action

🚀 Getting Started

  1. Clone the repository
git clone https://github.com/your-username/FaceId-gambling.git
cd FaceId-gambling
  1. Install dependencies
pip install -r requirements.txt
  1. Set up environment variables
cp .env.example .env
# Edit .env with your database credentials
  1. Run the application
python app.py

🔒 Security Considerations

⚠️ Note: This is currently a development version. For production deployment, implement:

  • Password hashing
  • Enhanced session management
  • Rate limiting
  • SQL injection protection
  • CSRF protection
  • HTTPS enforcement

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors