Skip to content

tera8m4/kanji-review-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kanji Review Application

Overview

This application provides a backend server for managing kanji characters and their associated review states. It uses Fastify for the server framework and MongoDB for database operations.

Features

  • Add new kanji entries
  • Update review states based on user interactions
  • Retrieve words associated with kanji that are ready for review

Technologies

  • Fastify: Server framework
  • MongoDB: Database for storing kanji and review data
  • TypeScript: For type safety and modern JavaScript features

Prerequisites

  • Node.js
  • MongoDB

Installation

  1. Clone the repository:

    git clone <repository-url>
  2. Navigate to the project directory:

    cd <project-directory>
  3. Install dependencies:

    npm install

Configuration

The server connects to a MongoDB instance running on localhost:27017 and uses the database kanji_db. Ensure your MongoDB server is up and running before starting the application.

Running the Application

To build and run the application, execute:

npm run build
npm start

The server will start on port 3000.

API Endpoints

1. Add New Kanji

  • POST /kanji
  • Request body:
    {
      "character": "",
      "readings": ["かん", "おう"],
      "words": [{
        "value": "漢字",
        "reading": "かんじ",
        "translation": "kanji"
      }]
    }

2. Update Review State

  • POST /kanji/:id/review
  • Request body:
    {
      "correct": true
    }

3. Get Words for Review

  • GET /kanji/:id/review

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published