Skip to content

Cozy card games. For now: a blackjack game every 15 seconds. Built with F#, React, TypeScript, and Effect

Notifications You must be signed in to change notification settings

joe307bad/cards

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cards.joebad.com

cards.joebad.com

Cozy card games. For now: a new blackjack game every 15 seconds.

Project Structure

cards/
├── api/                   # F# API project
│   ├── blackjack.db       # SQLite database
│   ├── wwwroot/           # Static web assets (built from web/)
│   └── *.fsproj           # F# project files
├── web/                   # Frontend web project
│   ├── src/               # Source code
│   ├── package.json       # Node.js dependencies
│   ├── yarn.lock          # Yarn lockfile
│   └── webpack.config.js  # Webpack configuration
├── Dockerfile             # Multi-stage Docker build
└── README.md

Prerequisites

Local Development

Running the API (F# Backend)

  1. Navigate to the API directory:

    cd api
  2. Restore dependencies:

    dotnet restore
  3. Run the API:

    dotnet run

The API will start on https://localhost:5001

Running the Web Frontend

  1. Navigate to the web directory:

    cd web
  2. Install dependencies:

    yarn install
  3. Start the development server:

    yarn dev

The frontend development server will run on http://localhost:8081 with hot reload enabled.

Database

The SQLite database (blackjack.db) is automatically created by the F# application on first run if it doesn't exist. The database file is stored in the api/ directory during local development.

Docker Deployment

Building the Docker Image

From the project root:

docker build -t blackjack-app .

Running with Docker

# Run with database persistence
docker run -d -p 5001:5001 -v blackjack-data:/app/data blackjack-app

The application will be available at http://localhost:5001.

Docker Volume

The SQLite database is persisted in the Docker volume blackjack-data. This ensures your game data survives container restarts.

To inspect the volume:

docker volume inspect blackjack-data

About

Cozy card games. For now: a blackjack game every 15 seconds. Built with F#, React, TypeScript, and Effect

Resources

Stars

Watchers

Forks