{"id":20046988,"url":"https://github.com/flatypus/soki","last_synced_at":"2026-06-10T17:30:59.976Z","repository":{"id":290879787,"uuid":"975430751","full_name":"flatypus/soki","owner":"flatypus","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-01T04:27:30.000Z","size":2027,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-01T04:29:11.268Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flatypus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-30T09:52:28.000Z","updated_at":"2025-05-01T04:27:33.000Z","dependencies_parsed_at":"2025-05-01T04:29:13.606Z","dependency_job_id":"cb68ba16-3aa2-4920-b78d-cdb72177e012","html_url":"https://github.com/flatypus/soki","commit_stats":null,"previous_names":["flatypus/soki"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/flatypus/soki","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flatypus%2Fsoki","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flatypus%2Fsoki/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flatypus%2Fsoki/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flatypus%2Fsoki/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flatypus","download_url":"https://codeload.github.com/flatypus/soki/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flatypus%2Fsoki/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34163253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T11:32:31.733Z","updated_at":"2026-06-10T17:30:59.952Z","avatar_url":"https://github.com/flatypus.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sōki (想起)\n\n\u003cimg width=\"1177\" alt=\"image\" src=\"https://github.com/user-attachments/assets/e5bdab91-461c-4157-8cdc-652ba1fb1eef\" /\u003e\n\n## Project Overview\n\nThis project is a web application designed to help users learn Japanese Kanji and phrases using a spaced repetition system (SRS). It features user authentication, tracks learning progress, and presents flashcards in an optimal order based on user knowledge and character/phrase dependencies (also a cool attempt to test out Manus lol)\n\n## Features\n\n*   **Kanji \u0026 Phrase Learning:** Includes a database of Kanji characters and related phrases.\n*   **Spaced Repetition System (SRS):** Tracks user familiarity with each Kanji and phrase, scheduling reviews at increasing intervals.\n*   **Learning Order:** Ensures users learn individual Kanji characters before encountering phrases that contain them. Constituent Kanji are prioritized before the phrases themselves.\n*   **User Authentication:** Secure user registration and login using JWT (JSON Web Tokens) for session management.\n*   **Progress Tracking:** Users can view a summary of their learning progress.\n*   **Flashcard Interface:** A simple web interface for reviewing Kanji and phrases.\n\n## Technology Stack\n\n*   **Frontend:** Next.js (React Framework), TypeScript, Tailwind CSS, shadcn/ui\n*   **Backend:** Next.js API Routes, TypeScript\n*   **Database:** PostgreSQL\n*   **ORM:** Drizzle ORM\n*   **Authentication:** JWT (jsonwebtoken), bcrypt (for password hashing)\n*   **Runtime/Build Tool:** Bun\n\n## Setup Instructions\n\n### Prerequisites\n\n*   Node.js (v20+ recommended)\n*   Bun (v1.x+ recommended)\n*   PostgreSQL Server\n\n### Installation\n\n1.  **Clone the repository (or extract the provided zip file):**\n    ```bash\n    # If you have the zip file:\n    unzip kanji-practice.zip\n    cd kanji-practice\n    ```\n2.  **Install dependencies:**\n    ```bash\n    bun install\n    ```\n\n### Database Setup\n\n1.  **Create a PostgreSQL database and user:**\n    ```sql\n    -- Example commands (run as postgres superuser)\n    CREATE DATABASE kanji_db;\n    CREATE USER kanji_user WITH PASSWORD 'password';\n    GRANT ALL PRIVILEGES ON DATABASE kanji_db TO kanji_user;\n    ```\n2.  **Configure Environment Variables:** Create a `.env` file in the project root (`/home/ubuntu/kanji-practice/.env`) with the following content, replacing placeholders with your actual database credentials and a secure JWT secret:\n    ```env\n    DATABASE_URL=\"postgresql://kanji_user:password@localhost:5432/kanji_db\"\n    JWT_SECRET=\"replace_this_with_a_very_strong_and_secret_key\"\n    ```\n3.  **Run Database Migrations:** Apply the Drizzle schema to your database.\n    ```bash\n    bun run db:prod-m\n    ```\n4.  **Import Data:** Populate the database with Kanji and phrase data.\n    ```bash\n    bun run /home/ubuntu/kanji-practice/scripts/save-to-db.ts\n    ```\n\n### Running the Application\n\n1.  **Build the application:**\n    ```bash\n    bun run build\n    ```\n2.  **Start the production server:**\n    ```bash\n    bun run start -p 3000 -H 0.0.0.0\n    ```\n    The application should now be running on `http://localhost:3000` (or the specified host/port).\n\n## API Endpoints\n\n*   `POST /api/auth/register`: User registration.\n*   `POST /api/auth/login`: User login, returns JWT.\n*   `GET /api/cards/next`: (Protected) Fetches the next Kanji or Phrase card for the user based on SRS and learning order.\n*   `POST /api/cards/review`: (Protected) Updates the user's progress for a specific card after review.\n*   `GET /api/progress/summary`: (Protected) Retrieves a summary of the user's learning progress.\n\n_(Protected endpoints require a valid JWT in the `Authorization: Bearer \u003ctoken\u003e` header)._\n\n## Usage\n\n1.  Access the application URL.\n2.  **Register:** Create a new user account.\n3.  **Login:** Log in with your credentials.\n4.  **Flashcards:** The main page will display the next flashcard (Kanji or Phrase). Reveal the answer and indicate your recall difficulty (e.g., Easy, Good, Hard) to update the SRS schedule.\n5.  **Progress:** View your learning summary.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflatypus%2Fsoki","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflatypus%2Fsoki","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflatypus%2Fsoki/lists"}