chore: add Makefile for one-command dev setup#86
Merged
Conversation
Wrap the existing npm scripts and scripts/db-init.sh behind make targets so a fresh clone comes up with 'make setup' (install, generate .env.local secrets, start DB, migrate, seed). 'make check' mirrors the CI gates.
'make run' replaces 'make dev'. 'make doctor' reports node, .env.local, Docker daemon, the db container health, prisma client, and live migration status to troubleshoot setup issues.
Check toolchain (node/npm/openssl), every .env.local var (presence, placeholders, key length), Docker (binary/compose/daemon/db container), database TCP reachability, and Prisma (client, schema validity, migration status). Print an OK/WARN/FAIL summary and exit non-zero on any failure.
After the diagnosis, prompt to auto-fix (interactive tty only), separating failures from warnings: [e]rrors only, [a]ll, or [n]o. Fixes cover .env.local creation and secret generation, AUTH_URL/CRON_SECRET, npm install, prisma generate, db-up, and migrate deploy.
Extract the env-init and doctor shell logic out of the Makefile into scripts/env-init.sh and scripts/doctor.sh, matching scripts/db-init.sh. The env and doctor targets are now thin callers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
Makefilewrapping the existing npm scripts andscripts/db-init.sh.Why
A fresh clone needs several manual steps (install, craft
.env.localwithsecrets, start the DB, migrate, seed). This collapses them into one command.
Highlights
make setup- one-shot:install+env+db-init.make env- creates.env.localfrom.env.exampleand fillsAUTH_SECRETand
DIRECTORY_ENCRYPTION_KEYwithopenssl rand -base64 32. No-op if thefile already exists (never clobbers secrets).
make check- mirrors the CI gates (lint with zero warnings,tsc --noEmit,prisma validate, build).dev,build,lint,test,db-up/down,migrate,seed, plusmake help(default) listing every target.No behavior change to the app or existing scripts.
🤖 Generated with Claude Code