Cozy card games. For now: a new blackjack game every 15 seconds.
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
- .NET 9.0 SDK
- Node.js 18+
- Yarn
- Docker (optional, for containerized deployment)
-
Navigate to the API directory:
cd api
-
Restore dependencies:
dotnet restore
-
Run the API:
dotnet run
The API will start on https://localhost:5001
-
Navigate to the web directory:
cd web
-
Install dependencies:
yarn install
-
Start the development server:
yarn dev
The frontend development server will run on http://localhost:8081
with hot reload enabled.
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.
From the project root:
docker build -t blackjack-app .
# 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
.
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