π€ AI-Assisted Development Project
This project demonstrates a modern approach to software development using LLM agents (Large Language Models) as intelligent AI assistants. Development follows a human-in-the-loop model: I define the architecture, make key decisions, and control code quality, while the AI agent serves as a powerful tool for accelerating routine tasks and generating boilerplate code.
- ποΈ Architectural Decisions: choosing the technology stack, designing modular application structure (Feature-Sliced Design)
- π¨ UX/UI Design: interface concept, user scenarios, visual aesthetics
- π Code Review: reviewing generated code, refactoring, optimization
- π§ͺ Testing: functionality verification, debugging edge cases
- π Project Management: feature planning, task prioritization, documentation maintenance
- β‘ Code Generation: creating components, services, validation schemas based on technical specifications
- π§ Refactoring: automatic linter fixes, import optimization, code style unification
- π Documentation: generating comments, READMEs, technical descriptions
- π Debugging: error analysis, solution suggestions, type fixing
- π Migrations: dependency updates, adapting code to new library versions
β
Development Speed: routine tasks are solved 5-10x faster
β
Code Consistency: uniform style throughout the entire project
β
Current Best Practices: using modern patterns and approaches
β
Documentation: automatic synchronization of code and documentation
β
Edge Case Coverage: AI helps identify potential issues
This project uses OpenSpec β a spec-driven development methodology. All features go through Proposal β Implementation β Archive stages to ensure transparency and quality.
π OpenSpec Workflow Guide β read this to understand how to work with AI assistant on this project.
Application for learning using flashcards and spaced repetition (inspired by Anki). Required features:
- Creating topics/courses
- Quick addition of new cards to a course
- General settings typical for such systems
- Individual settings for each course; by default, taken from general settings, but can be edited for each course separately
- Ability to set time of day (from which hour to which hour) for training sessions; application should not offer new cards for learning if less than 4 hours remain until the end of the current day, since the first repetition step is 4 hours
- Application should trigger system notifications (Windows/Linux/macOS) when it's time to review cards
- Application should minimize to system tray on "minimize" button click and restore from tray on icon click
- Memory system used: user-customized FSRS (using library https://github.com/open-spaced-repetition/ts-fsrs): user wants to adapt intervals to their needs, for example, make the first short interval 4 hours instead of one day
- Development Philosophy
- Technical Specifications
- Technology Stack
- Architecture
- Application Features
- Launch and Build
interface Course {
id: number;
name: string;
description: string;
createdAt: string;
updatedAt: string;
}interface Card {
id: number;
courseId: number;
front: string;
back: string;
state: CardState; // New, Learning, Review, Relearning
due: string; // ISO Date
stability: number; // FSRS
difficulty: number; // FSRS
scheduledDays: number;
reps: number;
lapses: number;
lastReview?: string;
stepIndex?: number; // For learning steps
}interface Settings {
// Time Range
trainingStartTime: string; // "HH:MM" format (e.g., "08:00")
trainingEndTime: string; // "HH:MM" format (e.g., "22:00")
// FSRS Parameters
learningSteps: number[]; // Minutes (e.g., [10, 1440, 4320])
requestRetention: number; // 0.0-1.0 (default 0.9)
maximumInterval: number; // Days (default 36500)
enableFuzz: boolean; // Add randomness to intervals
// Global Daily Limits (aggregate across all courses)
globalNewCardsPerDay: number; // Default 20
globalMaxReviewsPerDay: number; // Default 200
// Default Course Limits (fallbacks for courses without custom settings)
newCardsPerDay: number; // Default 20
maxReviewsPerDay: number; // Default 200
// Session Limits
newCardsPerSession: number; // Default 10
maxReviewsPerSession: number; // Default 50
// Notifications
notificationsEnabled: boolean;
}
interface CourseSettings extends Partial<Settings> {
courseId: number;
// null values inherit from global settings
}- Vue 3 (v3.5+) β Composition API,
<script setup> - Vue Router (v4.6+) β Hash mode for
lmorozanki://protocol - Vite (v6.0+) β Build tool and dev server
- Tailwind CSS (v4.0+) β Utility-first CSS framework
- Pinia β State management
- Axios (v1.7+) β HTTP client for API requests
- Bootstrap Icons β Icon set
- @vueuse/core β Composition utilities
- Node.js + TypeScript (v5.7+)
- Express (v4.21+) β Web framework
- Electron (v33.2+) β Desktop application
- Zod (v3.24+) β Schema validation
- Better-SQLite3 + Kysely β Database & ORM
- ts-fsrs β Spaced repetition algorithm
- Pino β Logging
- Feature-Sliced Design β Architectural methodology for frontend
- Custom Protocol β
lmorozanki://for resource loading - IPC Communication β Electron preload API for secure interaction
frontend/src/
βββ app/ # Application initialization
β βββ main.js
β βββ App.vue
β βββ router/
βββ pages/ # Pages
β βββ home/
β βββ course/
β βββ training/
β βββ settings/
βββ widgets/ # Composite UI blocks
β βββ title-bar/ # Custom window title bar
β βββ course-list/
β βββ card-list/
β βββ settings-form/
βββ features/ # Business features
β βββ create-course/
β βββ add-card/
β βββ spaced-repetition/
βββ entities/ # Business entities
β βββ course/
β βββ card/
β βββ settings/
βββ shared/ # Reusable code
βββ ui/ # UI components (Button, Input, Card, Modal)
βββ api/ # HTTP client & Services
βββ lib/ # Utilities
βββ types/ # TypeScript types
backend/src/
βββ electron/ # Electron main process
β βββ main.ts # Entry point, lmorozanki:// protocol
β βββ preload.ts # IPC bridge
βββ routes/ # API endpoints (courses, cards, settings, etc.)
βββ services/ # Business logic
β βββ database/ # Kysely schema & migrations
β βββ fsrs/ # Spaced repetition algorithm
β βββ repositories/# Data access layer
βββ schemas/ # Zod validation schemas
βββ config/ # Configuration
βββ utils/ # Utilities (logger, etc.)
βββ server.ts # Express server
- Course Management: Full CRUD operations with statistics.
- Card Management: Full CRUD with visual feedback and progress tracking.
- Batch Operations:
- Batch Add mode (text-based
question | answerformat) - Batch Delete with selection mode and custom checkboxes
- Delete All Cards with confirmation
- Batch Add mode (text-based
- Quick Add: Inline mode for rapid card creation.
- Card Editing: Edit cards with automatic progress reset and visual feedback (scroll + bounce animation).
- Course Statistics: Home page displays total cards, new cards count, and last training date.
- FSRS v5 Algorithm: Full integration of
ts-fsrswith customizable parameters. - Training Mode: Card-based review interface with flip animations.
- 4-Tier Limits System:
- Global daily limits (aggregate across all courses)
- Course daily limits (per-course with inheritance)
- Session limits (per training session)
- Daily progress tracking with
trainingStartTime-based reset
- Visual Training UI: Answer buttons (Again/Hard/Good/Easy) with color coding.
- Session Management: Real-time counter, limit badges, completion states.
- Global Settings: Training hours, FSRS parameters, daily/session limits.
- Course Settings: Full override capability with inheritance from global settings.
- Custom Time Pickers: Scroll-based hour/minute selection (generic, reusable component).
- Learning Steps: Configurable intervals (e.g., 10min, 1day, 3days).
- FSRS Configuration: Request retention, maximum interval, learning steps, fuzz.
- Design System: Systemized CSS variables, dark/light theme support.
- Custom Title Bar: Frameless acrylic design with window controls.
- Custom Dialogs: Replaced native
alert()/confirm()with:- Toast notifications (vue3-toastify) for alerts
- Custom
ConfirmDialogcomponent with theme support
- Animations: Smooth transitions, flip effects, bounce animations, hover states.
- Responsive Design: Mobile-optimized with slide-out panels.
- Database: SQLite with migration system, transaction support.
- REST API: Full API coverage for all features.
- Validation: Strict Zod v4 schemas for all inputs.
- Repositories: Clean data access layer (courses, cards, settings, progress).
- Services: Business logic separation (FSRS, limits, daily progress).
- System Tray Integration: Minimize to tray instead of closing.
- System Notifications: Native OS notifications for due cards.
- Deep Linking: Open app directly in training mode from notification.
- Learning progress statistics dashboard.
- Course import/export (JSON/Anki format).
- Media support in cards (images, audio).
- Card search and filtering.
- Tags and categories system.
Version: 0.6.2 (MVP Feature Complete + Retention Settings)
β Core Features Complete
- Architecture: Electron + Vue 3 + Express, Feature-Sliced Design
- Database: SQLite with migrations, transaction support, repositories
- FSRS Algorithm: Full ts-fsrs v5 integration with custom parameters
- Course Management: CRUD, statistics, settings inheritance
- Card Management: CRUD, batch operations, visual feedback, progress reset
- Training System: Review interface, 4-tier limits, session management, FSRS scheduling
- Settings: Global + Course-specific, time pickers, FSRS config, limits config
- UI/UX: Custom dialogs, toast notifications, animations, responsive design, dark/light themes
π Next Phase (v0.6-0.9 β v1.0)
Priority 1 (Desktop Integration):
- System Tray: Minimize to tray, restore from tray
- System Notifications: Native OS notifications for due cards
- Deep Linking: Open app in training mode from notification
Priority 2 (Enhancements):
- Statistics dashboard with charts
- Import/Export (JSON, Anki)
- Media support (images, audio)
- Search and filtering
v1.0 Release Criteria: All Priority 1 features + stable production build
Make sure you have installed:
- Node.js v22.0.0 or higher
- npm v10.0.0 or higher
-
Clone the repository:
git clone https://github.com/lmoroz/anki-tiny.git cd anki-tiny -
Install dependencies for all workspaces:
npm install
All commands are run from the project root:
-
Run full application (Electron + Frontend HMR)
npm run app:dev
This command automatically rebuilds native dependencies, starts the frontend dev server, and launches the Electron app.
-
Run backend API only
npm run dev --workspace=backend
Starts the Express server with Nodemon (usually on port 3000). Useful for API testing without Electron.
-
Run frontend only
npm run dev --workspace=frontend
Starts the Vite dev server (http://localhost:5173).
-
Run both servers (Frontend + Backend API) without Electron
npm run dev
Useful for development in a browser or inspecting both services simultaneously.
npm run bundleThis command will:
- Build frontend (
npm run buildin frontend workspace) - Compile backend TypeScript code
- Create installer via electron-builder
Ready installer will appear in dist folder.
-
Lint all workspaces (ESLint + Markdown):
npm run lint
-
Lint Markdown only:
npm run lint:md
-
Auto-fix Markdown issues:
npm run lint:md:fix
-
Format code in all workspaces (Prettier):
npm run format
This formats JavaScript, TypeScript, Vue, JSON, CSS, and Markdown files.
-
Format Markdown only:
npm run format:md
-
Commands for specific workspace:
npm run <script> --workspace=frontend npm run <script> --workspace=backend
The project uses husky and lint-staged to automatically check and format code before committing:
- ESLint runs on staged
.js,.ts,.vuefiles - Markdownlint runs on staged
.mdfiles - Prettier formats staged
.json,.css,.scss,.mdfiles
These checks run automatically on git commit. If errors are found, the commit will be rejected.
To bypass pre-commit hooks (not recommended):
git commit --no-verify -m "message"