-
Notifications
You must be signed in to change notification settings - Fork 0
Initial app setup with databases, auth and testing #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
329ce35
47bdd36
01dc9f6
561b881
6487a1d
d8e686a
0e1c671
02f3ef6
dafb588
e84f8af
a1c0629
eb529b8
1d16f5e
6d3898f
a0bfdc0
ca97d4b
04941de
58ac943
873b7fc
816ee18
d88a6c7
c611677
89d1318
1852bec
115afe5
b485904
c684c83
bd1d472
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # This env file uses @env-spec - see https://varlock.dev/env-spec for more info | ||
| # | ||
| # @defaultRequired=infer @defaultSensitive=false | ||
| # @generateTypes(lang=ts, path=env.d.ts) | ||
| # ---------- | ||
|
|
||
| # @type=enum(development, production) | ||
| APP_ENV=development | ||
|
|
||
| # Postgres | ||
| # @optional @sensitive @example="postgresql://postgres:postgres@localhost:5432/trackr" | ||
| POSTGRES_DATABASE_URL= | ||
|
|
||
| # SQLite | ||
| # @optional @sensitive @example="file:./.local/trackr.sqlite" | ||
| SQLITE_DATABASE_URL= | ||
|
|
||
|
|
||
| # Auth | ||
| # @required @sensitive @example="00000000000000000000000000000000" | ||
| BETTER_AUTH_SECRET= |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||
| npm run format:fix | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't auto-fix in pre-commit unless you restage. Line 1 writes formatting changes to the working tree, but this hook never adds them back to the index. The hook can pass on formatted files while the commit still contains the pre-format version. Suggested fix-npm run format:fix
+npm run format:check📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| npm run lint | ||||||
| npm run test | ||||||
| npm run build -- --filter=!@trackr/desktop | ||||||
| npm run format | ||||||
| npm run build:all | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep the desktop build out of the pre-commit fast path. Line 3 runs the full monorepo build, so every commit now depends on the Rust/Tauri desktop toolchain being installed locally. That will block web/server-only contributors from committing at all. Suggested fix-npm run build:all
+npx turbo build --filter=@trackr/web --filter=@trackr/server📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| npm run test:unit | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # Rust / Tauri build output (large, generated) | ||
| apps/desktop/src-tauri/target/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| { | ||
| "cSpell.words": ["autoincrement", "Tauri", "Trackr", "Turborepo"] | ||
| "cSpell.words": ["autoincrement", "Tauri", "Trackr", "Turborepo", "varlock"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| # Contributing to Trackr | ||
|
|
||
| Thanks for your interest in Trackr. This guide covers how to work in the monorepo, what we expect before you open a pull request, and how CI validates changes. | ||
|
|
||
| For environment variables, database setup, and day-to-day dev commands, start with the [README](README.md) — especially **Local development**, **Database and Prisma**, and **End-to-end tests**. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - **Node.js** 22 or newer (LTS recommended) | ||
| - **npm** — the repo pins a version in the root `package.json` (`packageManager`); use [Corepack](https://nodejs.org/api/corepack.html) if you want npm to match automatically | ||
| - **PostgreSQL** — required for server development, integration tests, and most E2E flows | ||
| - **Desktop / Tauri** — Rust stable toolchain and platform libraries when you work on `apps/desktop` (see CI’s `desktop-build` job for Linux packages) | ||
|
|
||
| ## Getting started | ||
|
|
||
| From the repository root: | ||
|
|
||
| ```bash | ||
| npm install | ||
| ``` | ||
|
|
||
| Match CI more closely (clean install from the lockfile): | ||
|
|
||
| ```bash | ||
| npm ci | ||
| ``` | ||
|
|
||
| Generate Prisma clients before running server or tests that touch the database: | ||
|
|
||
| ```bash | ||
| npm run build -w @trackr/prisma | ||
| ``` | ||
|
|
||
| Apply migrations and seed a dev database when you need auth and sample data (see README for `POSTGRES_DATABASE_URL`): | ||
|
|
||
| ```bash | ||
| npm run migrate:dev -w @trackr/prisma # or migrate:deploy in CI-like environments | ||
| npm run seed -w @trackr/prisma | ||
| ``` | ||
|
|
||
| Use workspace-scoped scripts when you only need one app, for example: | ||
|
|
||
| ```bash | ||
| npm run dev -w @trackr/server | ||
| npm run dev -w @trackr/web | ||
| ``` | ||
|
|
||
| ## Quality checks (run locally) | ||
|
|
||
| Run these from the **repo root** before opening a PR: | ||
|
|
||
| | Command | Purpose | | ||
| | ---------------------- | ------------------------------------------------------ | | ||
| | `npm run format` | Apply Prettier | | ||
| | `npm run check-format` | Verify formatting (also enforced via Husky pre-commit) | | ||
| | `npm run lint` | Turborepo lint across packages | | ||
| | `npm run test` | Unit / Vitest tasks | | ||
| | `npm run build` | Production builds (see CI note for desktop on Linux) | | ||
|
|
||
| **Integration tests** for the server need a real Postgres database and: | ||
|
|
||
| ```bash | ||
| RUN_INTEGRATION=true npm run test -w @trackr/server | ||
| ``` | ||
|
|
||
| **E2E (Playwright):** install Chromium once (`npx playwright install chromium`), build the server if `dist/` is missing, then use the README’s E2E section. Onboarding E2E resets the database — use a disposable dev DB. Root shortcuts: `npm run e2e`, `npm run dev:e2e`, `npm run dev:e2e-desktop`. | ||
|
|
||
| ## Pull requests | ||
|
|
||
| - **Target branch:** `main` | ||
| - **Describe the change** in the PR: what problem it solves and any trade-offs | ||
| - **Keep scope focused** — unrelated refactors make review harder | ||
| - **Update tests** when behavior changes; add coverage when it prevents regressions | ||
|
|
||
| CI (`.github/workflows/ci.yml`) runs on pushes and PRs to `main`: `npm ci`, Prisma generate, migrate + seed, lint, tests with `RUN_INTEGRATION=true`, Turbo build (desktop excluded on the generic Linux job), then E2E (desktop excluded on that job). A separate job builds the desktop app with Rust and Tauri dependencies. | ||
|
|
||
| Maintainers: configure the **`CI_POSTGRES_PASSWORD`** repository secret as described in the README so the Postgres service uses a strong password. Fork PRs use a documented fallback in the workflow. | ||
|
|
||
| ## Issues and discussion | ||
|
|
||
| - **Bugs and features:** [GitHub Issues](https://github.com/nealhorner/trackr/issues) | ||
| - **Repository:** [github.com/nealhorner/trackr](https://github.com/nealhorner/trackr) | ||
|
|
||
| ## License | ||
|
|
||
| Trackr is distributed under the terms in [LICENSE](LICENSE). Read that file before redistributing or relying on permission to modify the software; contribution and use may be limited by those terms. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't gate web/server tests on the desktop build.
Line 111 makes
integration_and_e2ewait forbuild_desktop, but this job only runs server integration tests and Playwright with--filter=!@trackr/desktop. A desktop-only failure now prevents unrelated web/server validation from running.Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents