- Initialize Git repository with main branch - Create comprehensive .gitignore for Node.js, React, and environment files - Set up directory structure (frontend/, backend/, docs/) - Create detailed README.md with project overview and setup instructions - Add .env.example with all required environment variables - Configure Prettier for consistent code formatting All acceptance criteria met: ✅ Git repository initialized with appropriate .gitignore ✅ Directory structure matches Technical Assumptions ✅ README.md created with project overview and setup docs ✅ .env.example file with all required environment variables ✅ Prettier config files added for code formatting consistency 🤖 Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
7.4 KiB
Epic 1: Foundation & Core Infrastructure
Epic Goal: Set up the complete development environment and project infrastructure including Git repository, frontend/backend scaffolding, database schema, Docker configuration, and a health check endpoint to validate the entire stack works end-to-end before building features.
Story 1.1: Project Initialization & Repository Setup
As a developer, I want a properly structured monorepo with frontend and backend directories, so that I have a clean foundation for building the application with all necessary tooling configured.
Acceptance Criteria:
- Git repository initialized with appropriate
.gitignorefor Node.js, React, and environment files - Directory structure matches Technical Assumptions section (frontend/, backend/, docs/)
- README.md created with project overview, setup instructions, and tech stack documentation
.env.examplefile created listing all required environment variables- Root-level
package.jsoncreated (if using monorepo workspace tools) or separate package.json files in frontend/ and backend/ - EditorConfig or Prettier config files added for consistent code formatting
Story 1.2: Frontend Scaffolding with Vite + React
As a developer, I want a Vite + React application scaffold with Tailwind CSS configured, so that I can start building UI components with the chosen tech stack.
Acceptance Criteria:
- Vite project created in
frontend/directory usingnpm create vite@latest - React 18+ configured as the framework
- Tailwind CSS installed and configured (
tailwind.config.js,postcss.config.js) - Base styles imported in main CSS file (
@tailwind base; @tailwind components; @tailwind utilities;) - Sample component renders successfully showing Tailwind styles work
- ESLint and Prettier configured for React/JavaScript
- Development server runs successfully on
http://localhost:5173(or configured port) package.jsonscripts include:dev,build,preview,lint
Story 1.3: Backend Scaffolding with Node.js + Express
As a developer, I want a Node.js Express API scaffold with basic middleware configured, so that I can start building REST API endpoints.
Acceptance Criteria:
- Express application created in
backend/src/server.js - Required dependencies installed:
express,cors,helmet,dotenv,express-validator - Middleware configured: CORS (allowing frontend origin), Helmet (security headers), JSON body parser
- Environment configuration loaded via
dotenvat startup - Server listens on port from environment variable (default: 3000)
- Basic error handling middleware implemented (catches errors, returns JSON response)
- Health check endpoint created:
GET /api/healthreturns{ status: "ok", timestamp: "..." } package.jsonscripts include:dev(nodemon for auto-reload),start(production)- ESLint configured for Node.js/Express patterns
Story 1.4: Database Schema Definition with Prisma
As a developer, I want a Prisma schema defining Books and ReadingLogs tables, so that I have a clear data model ready for implementation.
Acceptance Criteria:
- Prisma installed in
backend/directory (npm install prisma @prisma/client) - Prisma initialized with PostgreSQL provider (
npx prisma init) prisma/schema.prismafile defines the following models:
Books Model:
model Book {
id Int @id @default(autoincrement())
title String @db.VarChar(500)
author String? @db.VarChar(500)
totalPages Int
coverUrl String? @db.VarChar(1000)
deadlineDate DateTime @db.Date
isPrimary Boolean @default(false)
status String @default("reading") @db.VarChar(50)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
readingLogs ReadingLog[]
@@index([deadlineDate])
@@index([status])
}
ReadingLogs Model:
model ReadingLog {
id Int @id @default(autoincrement())
bookId Int
logDate DateTime @db.Date
currentPage Int
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
book Book @relation(fields: [bookId], references: [id], onDelete: Cascade)
@@unique([bookId, logDate])
@@index([bookId])
@@index([logDate])
}
- Schema includes appropriate indexes for performance (bookId, logDate, deadlineDate)
- Relationship defined: Book has many ReadingLogs (one-to-many)
- Unique constraint on ReadingLog ensures one entry per book per day
Story 1.5: Database Setup & Initial Migration
As a developer, I want the database schema migrated to a PostgreSQL database, so that the application can persist data.
Acceptance Criteria:
DATABASE_URLenvironment variable configured in.envfile- Prisma migration created:
npx prisma migrate dev --name init - Migration successfully creates
BookandReadingLogtables in PostgreSQL - Prisma Client generated and can be imported in backend code
- Database connection verified (Prisma Client can connect successfully)
- Migration files committed to Git (
prisma/migrations/) - Instructions in README.md for running migrations in new environments
Story 1.6: Docker Configuration for Local Development
As a developer, I want Docker Compose configuration for running the full stack locally, so that I can develop and test the application in a containerized environment matching production.
Acceptance Criteria:
-
Dockerfilecreated infrontend/directory:- Multi-stage build (build stage + nginx/serve stage for production)
- Development stage uses Vite dev server
- Production stage serves static build files
-
Dockerfilecreated inbackend/directory:- Node.js base image (node:20-alpine or similar)
- Installs dependencies and runs Prisma generate
- Exposes API port
- Runs
npm startcommand
-
docker-compose.ymlcreated in project root defining services:- postgres: PostgreSQL 15+ with volume for data persistence
- backend: Builds from backend/Dockerfile, depends on postgres, exposes API port
- frontend: Builds from frontend/Dockerfile, exposes dev server port, depends on backend
- Environment variables configured via
.envfile
-
docker-compose upsuccessfully starts all three containers -
Frontend accessible at
http://localhost:5173(or configured port) -
Backend API accessible at
http://localhost:3000/api/health -
Database accessible on PostgreSQL port with credentials from .env
-
Hot reload works for both frontend and backend in development mode
-
README.md updated with Docker setup and usage instructions
Story 1.7: CI/CD Deployment Configuration for Coolify
As a developer, I want deployment configuration ready for Coolify, so that I can deploy the application to production infrastructure.
Acceptance Criteria:
- Production
docker-compose.ymlor Coolify configuration file created - Environment variable template documented for Coolify deployment
- Build and deployment process documented in
docs/deployment.md:- How to configure Coolify project
- Required environment variables
- Database connection setup
- SSL/HTTPS configuration (handled by Coolify)
- Health check endpoints for monitoring
- Production Dockerfiles optimized (multi-stage builds, minimal image size)
- Database migration strategy documented (how to run migrations on deployment)
- Backup and restore procedures documented for PostgreSQL