Fastify backend for lifetrackerbuddy.com, an application to manage OKRs. It is an advanced task manager with main focus on the goal, goal achievement, and current progress. It should answer the question: "How far am I away from achieving my goals?" Paired with the Vue frontend.
- Fastify server handles routing and business logic
- PostgreSQL stores users, goals, and tasks
- REST API for managing users, goals, and tasks
- User management with authentication
- Tasks and goals scoped to the authenticated user
- Relational data model: users → goals → tasks
- Nested goals via parent reference
- Recurring tasks with batch creation, update, and deletion
- Deployable on Vercel with Neon
- Full CRUD with relational integrity and cascading updates/deletes
- JSON Schema validation for all endpoints
- Timestamps for scheduling and lifecycle tracking
- Demo user reseeded with sample data on login
- Database migrations with
Postgrator - Auto-generated API docs with
Swagger
erDiagram
users {
serial4 id PK
varchar(150) username UK
varchar(255) password
bool is_active
}
goals {
bigserial id PK
varchar(100) name
timestamptz planned
text description
int8 parent FK
int4 user_id FK
}
tasks {
bigserial id PK
varchar(100) name
timestamptz planned
int2 target
int2 performance
timestamptz done
text description
jsonb performance_history
varchar(40) group_id
int8 goal FK
int4 user_id FK
}
goals }o..|| goals : goals_parent_fkey
goals }o--|| users : goals_user_id_fkey
tasks }o..|| goals : tasks_goal_fkey
tasks }o--|| users : tasks_user_id_fkey
- Install PostgreSQL
- Create a new database
- Create
.env&.postgratorrc.jsonto store sensitive configuration values
npm install
npx postgrator
npm run dev
- Log in to Neon account
- Set up a new project
- Create a new Database
- Add tables using the Neon SQL Editor
- Log in to Vercel account
- Set up a new project
- Import Git Repository
- Set Environment Variables