This project uses Lefthook for managing git hooks to ensure code quality and consistency.
The following checks run on staged files before each commit:
- Database Schema Check: Validates Drizzle schema changes (
drizzle-kit check) ondb/schema/*.ts - Prettier: Code formatting (
prettier --write) - Oxlint: Code linting with auto-fix
Pre-push hooks are currently disabled (commented out in lefthook.yml). Uncomment to enable if desired.
If you need to bypass hooks (use sparingly):
# Skip pre-commit hooks
git commit --no-verify
# Skip pre-push hooks
git push --no-verifyYou can manually run hooks for testing:
# Run pre-commit checks
pnpx lefthook run pre-commit
# Run pre-push checks
pnpx lefthook run pre-pushAutomaspec helps organize test specifications, requirements, and individual tests in a foldered hierarchy with per‑spec status breakdowns. It includes authentication, organizations, and a dashboard UI.
- Next.js 16 (Turbopack) + React 19
- Drizzle ORM with libsql/Turso
- Better Auth (with organizations plugin)
- oRPC + TanStack Query
- Tailwind CSS v4
- Vitest + React Testing Library
- Lefthook, Prettier, Oxlint
- Node.js (active LTS recommended)
- pnpm
- Turso CLI (for
turso dev) or another libsql-compatible server
-
Install dependencies
pnpm install
-
Environment variables
Copy
.env.exampleto.env.localfor local dev and to.envfor Docker:NEXT_PUBLIC_DATABASE_URL=https://your-cloud-libsql-endpoint DATABASE_AUTH_TOKEN=your-cloud-libsql-token # Optional: VERCEL_URL=your-vercel-deployment-url # Optional: OPENROUTER_API_KEY=... # Optional: GEMINI_API_KEY=...
-
Database (local libsql)
Start a local libsql dev server backed by db/local.db:
pnpm db:localIn another terminal, run migrations:
pnpm dbmOptional: open Drizzle Studio
pnpm dbsOptional: seed sample data into db/local.db:
sqlite3 db/local.db < sample_data.sqlpnpm dev # start Next.js (Turbopack)
pnpm build # build
pnpm start # run production buildpnpm test # run unit/component tests
pnpm test --watch # watch mode
pnpm test tests/components/test-details-panel.test.tsxNotes:
- Integration tests are skipped by default; to enable, set
NEXT_PUBLIC_DATABASE_URLto a reachable libsql endpoint.
The application is fully containerized for reproducible deployments and local development.
-
Configure Environment: Copy
.env.exampleto.envand fill in the required secrets.cp .env.example .env
-
Start Application:
# For standard development docker compose up --build # For production-optimized profile docker compose -f docker-compose.prod.yml up --build -d
-
Stop Application:
docker compose down
The system uses a multi-stage Alpine-based container to minimize footprint and maximize security.
graph TD
Client[Browser/Client] -->|port 3000| App[Automaspec App Container]
App -->|Drizzle ORM| DB[(External libSQL / local.db)]
subgraph "Docker Environment"
App
end
| Environment | CPU Limit | Memory Limit | Restart Policy |
|---|---|---|---|
| Development | 1.0 | 1.5 GB | unless-stopped |
| Production | 2.0 | 2.0 GB | always |
| Variable | Description | Required |
|---|---|---|
NEXT_PUBLIC_DATABASE_URL |
Primary database connection string (cloud or local) | Yes |
DATABASE_AUTH_TOKEN |
Auth token for cloud libSQL | If cloud |
OPENROUTER_API_KEY |
API key for AI features | Optional |
GEMINI_API_KEY |
API key for AI features | Optional |
PORT |
Container internal/external port (default: 3000) | No |
Common scripts (see package.json):
dev,build,starttestdb:local,dbg(generate),dbm(migrate),dbs(studio),dbup(generate+migrate)lint,format,typecheck(lefthook-driven jobs)
- Changelog:
CHANGELOG.md - Versioning policy:
VERSIONING.md - Release process + release notes template:
RELEASING.md
- The app reads database credentials from
NEXT_PUBLIC_DATABASE_URLandDATABASE_AUTH_TOKEN(seedb/index.tsanddrizzle.config.ts). - Better Auth trusted origins use
VERCEL_URLin production if set.