- TypeScript 73%
- Go 24%
- JavaScript 1%
- CSS 0.7%
- PLpgSQL 0.6%
- Other 0.7%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .pi | ||
| backend | ||
| docker | ||
| frontend | ||
| migrations | ||
| .dockerignore | ||
| .gitignore | ||
| compose.yaml | ||
| config.yml.exemple | ||
| dev.sh | ||
| go.mod | ||
| go.sum | ||
| INTERNAL.md | ||
| README.md | ||
Frontend requirements
Bun 1.3.10 is the only supported frontend package manager. Install the locked
dependencies from frontend/:
bun install --frozen-lockfile
Development and static checks require Bun. Production builds additionally
require rsvg-convert from librsvg and ImageMagick's magick executable.
Local validation
Run the cheap, non-mutating static checks before submitting frontend changes:
cd frontend
bun run check
The complete Milestone 0 validation contract is:
bun run check
bun run format:check
bun run build
bun run format is the explicit mutating formatter command. Frontend tests use
Bun's built-in runner:
bun test
Installing the web app
Canapé uses browser-native installation. Use Install app in Android Chrome, Share → Add to Home Screen on iPhone or iPad, or File/Share → Add to Dock in macOS Safari. Production must be served over HTTPS. Installed clients load frontend updates on their next launch or navigation.
Dev
Check your config.yml file
Setup your database
Install your own database or start the local Podman database:
./dev.sh podman-db up
Run the backend
./dev.sh back
In case of custom database, launch the backend with DB_USER, DB_PASS, DB_DATABASE, DB_HOST, DB_PORT, or directly the full DSN in DB_DSN_DEV
DB_DSN_DEV="postgres://test:test@127.0.0.1:5432/dev?sslmode=disable" ./dev.sh back
Run the frontend
./dev.sh front
Connect to the database
./dev.sh db-shell
Setup the dev users
Connect to the database and enter this sql queries:
INSERT INTO users (name, hash, admin, activated) VALUES ('test', '$2a$10$QHx07iyuxO1RcehgtjMgjOzv03Bx2eeSKvsxkoj9oR2NJ4cklh6ue', false, true);
INSERT INTO users (name, hash, admin, activated) VALUES ('admin', '$2a$10$qAbyDZsHtcnhXhjhQZkD2uKlX72eMHsX8Hi2Cnl1vJUqHQiey2qa6', true, true);
This users are defined with this parameters: pepper: "pepper" cost: 10
Users:
- Admin user: admin / admin
- Test user: test / test
Init the database
./dev.sh db-init
Run the tests
go test ./...