Skip to content
youngjoelPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Smiley Counter

A single Docker-delivered web app where every visitor shares one persistent smiley-face click counter. The FastAPI service also serves the compiled React/TypeScript client; MySQL stores the counter state.

Run locally

  1. Copy .env.example to .env and adjust non-secret values if needed.

  2. Create secrets/mysql_password with a strong database password. This file is ignored by Git.

  3. Start the application:

    docker-compose up --build
  4. Open http://localhost:8000. Click the centered smiley to increment the shared count. Reset is in the bottom-right corner.

docker-compose down stops the app while retaining its count. Use docker-compose down -v only when intentionally deleting local database data.

Validation

docker-compose --profile test run --rm backend-test
docker-compose --profile test run --rm frontend-test
docker-compose --profile test run --rm integration-test

The counter API contract is documented at specs/001-smiley-click-counter/contracts/counter-api.yaml.

Operational notes

  • Do not commit .env files or secrets/mysql_password.
  • Migrations run in the Compose migrate service before the web application starts.
  • Successful API responses always contain a committed, nonnegative count. On a database failure, the application returns a safe unavailable error rather than an unconfirmed value.
  • Browser HTML and API responses are not cached; Vite's content-hashed client assets use long-lived immutable caching for efficient production delivery.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages