From f243847216279cbd43879de8b5ef6dcceb3a2f1d Mon Sep 17 00:00:00 2001 From: polwex Date: Thu, 29 May 2025 14:08:02 +0700 Subject: lets see --- CLAUDE.md | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 CLAUDE.md (limited to 'CLAUDE.md') diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..2b82961 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,90 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +This is a language learning application built with React, Waku, and Bun. It focuses on Thai language learning with features for: + +- Flashcard-based study using Spaced Repetition System (SRS) +- Detailed phonetic analysis and syllable breakdown +- Tone pattern visualization and practice +- User progress tracking +- Lessons and organized learning content + +## Commands + +### Development + +```bash +# Start the development server +bun run dev + +# Build the project +bun run build + +# Start the production server +bun run start +``` + +## Architecture + +### Framework and Runtime + +- **Waku**: Server-side rendering (SSR) framework +- **React**: UI framework (v19.1) +- **Bun**: JavaScript runtime +- **TypeScript**: Type system + +### Database + +The project uses SQLite databases (managed in `src/lib/db/`) with schemas for: + +- User accounts and progress tracking +- Language expressions and translations +- Syllable breakdowns and phonetic information +- Flashcards and lessons +- Spaced repetition data + +### Key Components + +1. **Server Actions** (`src/actions/`) + - Server-side functions marked with `"use server";` + - Handle database operations and server-side logic + - Examples: authentication, database operations, language processing + +2. **Client Components** (`src/components/`) + - React components marked with `"use client";` + - Import and call server actions + - Manage UI state and user interactions + +3. **SRS System** (`src/lib/services/srs*.ts`) + - Implements spaced repetition algorithms + - Tracks user progress and schedules reviews + - Multiple implementations for different tracking approaches + +4. **Language Processing** (`src/lib/lang/`, `src/zoom/`) + - Thai language syllable parsing and phonetic analysis + - Tone pattern visualization and analysis + - Text parsing and hierarchical display + +5. **Database Handlers** (`src/lib/db/`) + - Connection management + - CRUD operations for all entities + - Query functions for app features + +### Data Flow + +1. Server components fetch initial data +2. Client components render UI and handle user interactions +3. User actions trigger server actions +4. Server actions update the database +5. UI updates with new data from server actions + +### Key Files + +- `waku.config.ts`: Waku framework configuration +- `src/lib/db/schema.sql`: Main database schema +- `src/lib/db/prosodyschema.sql`: Phonetic analysis schema +- `src/lib/services/srs_streamlined.ts`: Main SRS implementation +- `src/actions/`: Server actions for various features \ No newline at end of file -- cgit v1.2.3