diff --git a/README.md b/README.md new file mode 100644 index 0000000..98c96e5 --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +# ASTRAIN + +ASTRAIN is a dark-mode, mobile-first workout logbook. It runs a Blazor WebAssembly frontend and an ASP.NET Core minimal API backend (both on .NET 10) in a single container. The API is served under `/api`, while the UI is served at `/`. + +## Features +- Exercises and routines management +- Routine runs with last-run weights +- User identification via 8-character key in the URL +- SQLite storage via Entity Framework Core + +## Local development + +### Run API (serves UI when published) + +1. Restore/build: + - `dotnet restore` +2. Run the API: + - `dotnet run --project src/ASTRAIN.Api/ASTRAIN.Api.csproj` + +### Run Client (for UI-only development) + +- `dotnet run --project src/ASTRAIN.Client/ASTRAIN.Client.csproj` + +## Docker + +Build and run the single-container setup: + +- `docker compose up --build` + +The app will be available at http://localhost:8080 + +## URLs + +- `/exercises` or `/{userId}/exercises` +- `/routines` or `/{userId}/routines` + +Opening a URL without a user id will generate a new user and redirect to `/{userId}/routines`. + +## Data + +SQLite database file is stored in `src/ASTRAIN.Api/Data/astrain.db` (or `/app/Data/astrain.db` in Docker). diff --git a/docs/prompt-log.md b/docs/prompt-log.md new file mode 100644 index 0000000..64a020f --- /dev/null +++ b/docs/prompt-log.md @@ -0,0 +1,30 @@ +# ASTRAIN Work Log + +Date: 2026-01-29 + +## Summary +- Created a .NET 10 solution with a Blazor WebAssembly client, ASP.NET Core minimal API backend, and shared models. +- Implemented SQLite storage via EF Core and user ID creation/ensure flow (8-char alphanumeric key). +- Added API endpoints for users, exercises, routines, and routine runs under `/api`. +- Built a dark, mobile-first UI with bottom navigation, routines/exercises pages, and routine run view. +- Added PWA assets (manifest, app icons) and splash/loading screen. +- Added Dockerfile and docker-compose for single-container hosting and documentation. + +## Key Features Implemented +- Routes: `/exercises`, `/{userId}/exercises`, `/routines`, `/{userId}/routines`. +- User creation/redirect when missing. +- Exercises: list/add/edit. +- Routines: list/add/edit, start run, save run, last-run weight preload. +- Run UI: checkboxes for completion, weight input with `kg` suffix, completed highlight. +- UI: red/white theme, centered + buttons, nav refinement, top brand header. +- PWA: `manifest.json`, icon/splash with `logo_square.png`. + +## Docker +- Single container serves API at `/api` and the client at `/` (published WASM static files). + +## Files of Interest +- Client: `src/ASTRAIN.Client` +- API: `src/ASTRAIN.Api` +- Shared: `src/ASTRAIN.Shared` +- Docker: `src/ASTRAIN.Api/Dockerfile`, `docker-compose.yml` +- PWA: `src/ASTRAIN.Client/wwwroot/manifest.json`