A mobile-first web application for tracking baby care activities including feeding, sleep, medications, vaccinations, appointments, and notes. Built with offline-first architecture for reliable use even without internet connectivity.
- Feeding Tracking - Log breast, bottle, formula, and solid food feedings with duration and amounts
- Sleep Tracking - Track naps and night sleep with active session timers
- Medication Management - Manage medications with dosage schedules and dose logging
- Vaccination Records - Track vaccination schedules with auto-generated CDC recommendations
- Appointments - Schedule and manage doctor visits, checkups, and specialist appointments
- Notes - Keep pinned notes and observations about your child
- Timeline View - See all activities in a chronological feed
- Multi-child Support - Switch between multiple children in one family
- Offline-first - Works without internet, syncs when back online
- Dark Mode - Full dark mode support
- Go 1.25 - Server runtime
- Gin - HTTP web framework
- PostgreSQL - Primary database
- golang-migrate - Database migrations
- JWT - Authentication tokens
- React 19 - UI framework
- React Router 7 - Client-side routing
- TypeScript - Type safety
- Tailwind CSS 4 - Styling
- shadcn/ui - Component library (Radix UI primitives)
- TanStack Query - Server state management
- Zustand - Client state management
- Dexie - IndexedDB wrapper for offline storage
- Vite - Build tool
babytrack/
├── cmd/
│ └── server/ # Application entrypoint
├── configs/ # Configuration files
├── internal/
│ ├── app/ # HTTP server, router, handlers
│ ├── auth/ # Authentication (Google OAuth, JWT)
│ ├── db/ # Database connection and migrations
│ ├── family/ # Family and child management
│ ├── feeding/ # Feeding tracking
│ ├── sleep/ # Sleep tracking
│ ├── medication/ # Medication management
│ ├── vaccination/ # Vaccination records
│ ├── appointment/ # Appointment scheduling
│ ├── notes/ # Notes feature
│ ├── jobs/ # Background jobs
│ └── sync/ # Offline sync service
└── web/ # React frontend
├── src/
│ ├── app/ # App providers and routes
│ ├── components/ # React components
│ │ ├── ui/ # shadcn/ui components
│ │ ├── layout/ # App shell, nav, etc.
│ │ └── [feature]/
│ ├── db/ # Dexie schema and sync
│ ├── hooks/ # Custom hooks and queries
│ ├── lib/ # Utilities
│ ├── pages/ # Route pages
│ ├── stores/ # Zustand stores
│ └── types/ # TypeScript types
└── package.json
- Go 1.25+
- Node.js 20+
- pnpm
- Docker (for PostgreSQL)
- pre-commit (
brew install pre-commit) - Security tools (
brew install gitleaks gosec trivy)
-
Clone the repository
git clone https://github.com/ninenine/babytrack.git cd babytrack -
Install all dependencies and set up hooks
make install
-
Start the database
make db-up
-
Run database migrations
make migrate
-
Start development server
make dev
The app will be available at
http://localhost:8080
For frontend development with hot reload:
# Terminal 1: Start the backend
make dev
# Terminal 2: Start Vite dev server
cd web && pnpm devThe Vite dev server runs on http://localhost:5173 and proxies API requests to the Go backend.
| Command | Description |
|---|---|
make install |
Install all dependencies (Go + web) |
make dev |
Start database and run server in development mode |
make dev-web |
Start Vite dev server with hot reload |
| Command | Description |
|---|---|
make db-up |
Start PostgreSQL container |
make db-down |
Stop PostgreSQL container |
make db-reset |
Reset database (drop and recreate) |
make migrate |
Run database migrations |
| Command | Description |
|---|---|
make build |
Build web UI and server binary |
make build-web |
Build only the web UI |
make build-server |
Build web UI and server binary |
make run |
Run the built binary |
| Command | Description |
|---|---|
make lint |
Run linters (Go vet + ESLint) |
make format |
Format all code (gofmt + Prettier) |
make pre-commit |
Run all pre-commit hooks |
make test |
Run Go tests |
| Command | Description |
|---|---|
make clean |
Clean build artifacts |
This project uses pre-commit for automated code quality checks. Hooks are installed automatically via make install.
| Hook | Purpose |
|---|---|
trailing-whitespace |
Remove trailing whitespace |
end-of-file-fixer |
Ensure files end with newline |
check-yaml |
Validate YAML syntax |
check-added-large-files |
Block files > 1MB |
detect-private-key |
Block commits with private keys |
detect-aws-credentials |
Block commits with AWS credentials |
gitleaks |
Scan for secrets (API keys, tokens) |
gosec |
Go security static analysis |
go-fmt |
Format Go code |
go-vet |
Go static analysis |
go-mod-tidy |
Keep go.mod clean |
eslint |
Lint TypeScript/React code |
prettier |
Format CSS files |
commitlint |
Enforce conventional commits |
We follow Conventional Commits:
type(scope?): subject
body?
footer?
Allowed types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
Examples:
git commit -m "feat: add dark mode toggle"
git commit -m "fix: resolve login redirect issue"
git commit -m "docs: update API documentation"# Vulnerability scanning with Trivy
trivy fs --severity HIGH,CRITICAL .
# Full Go security report
gosec -fmt=html -out=gosec-report.html ./...POST /api/auth/google- Google OAuth loginGET /api/auth/me- Get current user
GET /api/families- List user's familiesPOST /api/families- Create familyPOST /api/families/:id/children- Add childPUT /api/families/:id/children/:childId- Update child
GET /api/feedings- List feedingsPOST /api/feedings- Create feedingPUT /api/feedings/:id- Update feedingDELETE /api/feedings/:id- Delete feeding
GET /api/sleep- List sleep recordsPOST /api/sleep- Start sleep sessionPUT /api/sleep/:id- Update/end sleepDELETE /api/sleep/:id- Delete sleep record
GET /api/medications- List medicationsPOST /api/medications- Create medicationPUT /api/medications/:id- Update medicationDELETE /api/medications/:id- Delete medicationPOST /api/medications/:id/deactivate- Deactivate medicationPOST /api/medications/log- Log a doseGET /api/medications/:id/logs- Get dose history
GET /api/vaccinations- List vaccinationsPOST /api/vaccinations- Create vaccinationPUT /api/vaccinations/:id- Update vaccinationDELETE /api/vaccinations/:id- Delete vaccinationPOST /api/vaccinations/generate- Generate CDC schedule
GET /api/appointments- List appointmentsPOST /api/appointments- Create appointmentPUT /api/appointments/:id- Update appointmentDELETE /api/appointments/:id- Delete appointment
GET /api/notes- List notesPOST /api/notes- Create notePUT /api/notes/:id- Update noteDELETE /api/notes/:id- Delete note
POST /api/sync- Sync offline changes
Configuration is managed via YAML files in configs/:
server:
port: 8080
base_url: http://localhost:8080
database:
dsn: postgres://babytrack:babytrack123@localhost:5432/babytrack?sslmode=disable
auth:
google_client_id: your-google-client-id
google_client_secret: your-google-client-secret
jwt_secret: your-jwt-secret-change-this-in-production
notifications:
enabled: false- Email invites - Send family invite links via email
MIT