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.
- Add new kanji entries
- Update review states based on user interactions
- Retrieve words associated with kanji that are ready for review
- Fastify: Server framework
- MongoDB: Database for storing kanji and review data
- TypeScript: For type safety and modern JavaScript features
- Node.js
- MongoDB
-
Clone the repository:
git clone <repository-url>
-
Navigate to the project directory:
cd <project-directory>
-
Install dependencies:
npm install
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.
To build and run the application, execute:
npm run build
npm start
The server will start on port 3000
.
- POST
/kanji
- Request body:
{ "character": "漢", "readings": ["かん", "おう"], "words": [{ "value": "漢字", "reading": "かんじ", "translation": "kanji" }] }
- POST
/kanji/:id/review
- Request body:
{ "correct": true }
- GET
/kanji/:id/review