Trassenscout (Beta) aids administrations in evaluating and developing cycle highways and other similar route-based infrastructure.
Please contact hello@fixmycity.de to learn more.
This project is built with TanStack Start, React, Vite, and Bun. Data is stored in PostgreSQL via Prisma.
For starting developing, the following steps could be helpful for getting started:
- Install dependencies:
bun install - Start the development environment:
bun run dev(opens http://127.0.0.1:4000) - Run
nvm usefor Prisma and Playwright (they spawn Node;bun run devuses Bun) - Run all checks:
bun run check(check migrations, check TypeScript, run linter, run formatter, run tests) - Use
bun run buildandbun run startto test the production bundle locally - Husky: We run our checks on push. Use
git push --no-verifyto force-skip them
Local development uses a gitignored .env file (see .env.example). Production servers get .env from the deploy workflow.
TanStack Start
- File routes live in
src/routes. - Shared UI lives in
src/components. - Server-only code lives in
src/server. - Authentication is handled by Better Auth.
Market-share queries in package.json browserslist; wired to vite.config.mts (client build) and oxlint.config.mjs (client API lint).
How it works: browser-target skill
-
Setup
.env:
This will set up environment variables for PostgreSQL and other services.cp .env.example .env -
Install Docker and open it once to finish the setup:
brew install --cask docker -
Start the PostgreSQL Server
This is done automatically withbun run dev.docker compose up -d -
Seed your database:
Which will also apply migrations.bun run seed -
Run your app in the development mode:
bun run dev -
Open http://127.0.0.1:4000.
Runs your tests using Jest.
bun run test
Blitz comes with a test setup using Vitest and react-testing-library.
Follow these steps to add a model with forms and pages:
-
Add or update the Prisma model in prisma/schema.prisma.
-
Check prisma/schema.prisma if all was "translated".
-
Use
bun run migrate-create(bun prisma migrate dev --create-only) to create the migration but not run it directly. -
Double check the migration. For example, column renames are handled by deleting the column and adding a new one which we do not always want.
-
Use
bun run migrate(bun prisma migrate dev) to apply the migration. -
Schema:
- Add a shared Zod schema (Docs) in
src/shared/<domain>/and use it for client-side validations. - Update the Zod schema to match the Prisma schema.
- You can use
type UserType = z.infer<typeof UserSchema>to create a TS schema from Zod that can be compared to the prisma schema (which are located innode_modules/.prisma/client/index.d.ts) - You can use https://github.com/CarterGrimmeisen/zod-prisma to generate a starting point for this based on the prisma schema. Use it in a separate branch when experimenting with generated schemas.
- You can use
- Add a shared Zod schema (Docs) in
-
Add seed data in prisma/seed.ts and prisma/seeds/ - all models should have good seed data.