This project was made when I was a student at NTNU in 2014. It's a simple web application that allows us to track statistics for the card game Mattis.
The project was made in PHP with the Laravel framework and is located in the laravel folder.
In 2025, I decided to try to rewrite the project in Typescript with AI assistance by using Spec Kit.
This repository uses pre-commit to run formatting, linting, and infrastructure checks locally before you push changes.
- Make sure the TypeScript dependencies are installed with
npm installand Terraform is available on your machine when you work on infrastructure code. - Install pre-commit (for example with
brew install pre-commit). - Enable the hooks with
pre-commit install.
You can run all hooks on demand with pre-commit run -a.
The TypeScript app consumes the API contract defined in openapi.yaml.
- Run
npm run openapi:generatewhenever the contract changes to refresh the generated typings insrc/lib/api/generated.ts. - Use the shared
apiClientfromsrc/lib/api/client.tsfor HTTP requests. It wrapsopenapi-fetchso everyGET,POST,PUT, etc. call is type-safe out of the box. - Prefer deriving API-facing TypeScript types from the generated OpenAPI components (see
src/lib/api/schemas.ts) instead ofz.infer, so we do not have to manually synchronize type aliases with the schema.