Local setup
Requirements
Section titled “Requirements”- Node.js 20+ and npm
- Git
- Build tools for the
better-sqlite3native module if no prebuilt binary matches your platform (Xcode Command Line Tools on macOS,build-essentialandpython3on Linux)
Run it
Section titled “Run it”git clone https://github.com/chmedinap/pethealth.gitcd pethealth
# Terminal 1 — API on http://localhost:3001 (data in backend/data)cd backendnpm installJWT_SECRET=dev ALLOW_REGISTRATION=true npm run dev
# Terminal 2 — UI on http://localhost:5173cd frontendnpm installnpm run devOpen http://localhost:5173. The Vite dev server proxies /api and /uploads to the backend; set BACKEND_URL if the API runs elsewhere. npm run dev in the backend uses nodemon and restarts on changes.
The first start creates backend/data/pethealth.db, the admin / admin123 user and the demo pets. Delete backend/data/ to start over.
Useful variables while developing
Section titled “Useful variables while developing”SEED_DEMO=false # start emptyLOGIN_RATE_LIMIT=0 # no login throttlingSMTP_HOST=localhost SMTP_PORT=1025 # e.g. with Mailpit/MailHog to see emailsTZ=America/New_YorkProduction build without Docker
Section titled “Production build without Docker”cd frontend && npm run build # outputs frontend/distcp -r frontend/dist backend/public # the backend serves ./public as the SPAcd backend && NODE_ENV=production JWT_SECRET=... node src/index.jsThe Docker image does exactly this (see Building the image).