- 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>
3.2 KiB
3.2 KiB
Data Models
Book Model
Purpose: Represents a book that the user is tracking for reading progress and deadline management.
Key Attributes:
id: Integer - Unique identifier (auto-increment)title: String (max 500 chars) - Book titleauthor: String (max 500 chars, optional) - Book authortotalPages: Integer - Total pages in the bookcoverUrl: String (max 1000 chars, optional) - URL to book cover image (from Open Library)deadlineDate: Date - Date by which user needs to finish the bookisPrimary: Boolean (default: false) - Whether this is the user's primary focus book (for v1.1 multi-book support)status: String (default: "reading") - Book status: "reading", "finished", "paused"createdAt: DateTime - When book was addedupdatedAt: DateTime - Last update timestamp
TypeScript Interface
interface Book {
id: number;
title: string;
author: string | null;
totalPages: number;
coverUrl: string | null;
deadlineDate: Date;
isPrimary: boolean;
status: 'reading' | 'finished' | 'paused';
createdAt: Date;
updatedAt: Date;
}
Relationships
- Has many
ReadingLogentries (one-to-many) - Cascade delete: When a book is deleted, all associated reading logs are deleted
ReadingLog Model
Purpose: Tracks daily reading progress by recording the current page number for a specific book on a specific date.
Key Attributes:
id: Integer - Unique identifier (auto-increment)bookId: Integer - Foreign key to Book modellogDate: Date - Date of the reading log entrycurrentPage: Integer - Page number user reached on this datecreatedAt: DateTime - When log was createdupdatedAt: DateTime - Last update timestamp
TypeScript Interface
interface ReadingLog {
id: number;
bookId: number;
logDate: Date;
currentPage: number;
createdAt: Date;
updatedAt: Date;
}
Relationships
- Belongs to one
Book(many-to-one) - Unique constraint: (bookId, logDate) - Only one log per book per day
ProgressCalculation Model (Derived)
Purpose: Not stored in database - computed on-demand from Book and ReadingLog data to show user's reading pace and status.
Key Attributes:
bookId: Integer - Book being trackedcurrentPage: Integer - Latest logged pagetotalPages: Integer - Total pages in bookpagesRemaining: Integer - Pages left to readdeadlineDate: Date - Finish by datedaysRemaining: Integer - Days until deadlinerequiredPace: Float - Pages/day needed to finish on timeactualPace: Float - Pages/day based on 7-day rolling averagestatus: String - "on-track", "slightly-behind", "behind"lastLoggedDate: Date - Most recent log date
TypeScript Interface
interface ProgressCalculation {
bookId: number;
currentPage: number;
totalPages: number;
pagesRemaining: number;
deadlineDate: Date;
daysRemaining: number;
requiredPace: number; // pages/day
actualPace: number | null; // pages/day (null if insufficient data)
status: 'on-track' | 'slightly-behind' | 'behind';
lastLoggedDate: Date | null;
}
Relationships
- Derived from
BookandReadingLogmodels - Calculated server-side and returned in API responses