Skip to content

KobenjiSan/KotoKatsuyou-Backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Katsuyou-API

This is the backend API for the KotoKatsuyou project — a Japanese verb conjugation learning tool.

The API uses Node.js, Express, and MongoDB (via Mongoose) to serve verb data and support frontend conjugation features.


Features

  • RESTful endpoint to retrieve verb data by hiragana or kanji
  • Integrated MongoDB for storing structured verb entries
  • Modular controller/router structure
  • Seed script for preloading the database
  • Ready for deployment with environment variable config

Getting Started

1. Clone the Repo

git clone https://github.com/yourname/katsuyou-api.git
cd katsuyou-api

2. Install Dependencies

npm install

3. Set Up Environment Variables

Create a .env file in the root of the project using the provided .env.example:

cp .env.example .env

Edit your .env file to point to your local MongoDB or MongoDB Atlas instance:

MONGO_URI=mongodb://localhost:27017/katsuyou-db
PORT=5000

4. Seeding the Database

To load predefined verb data into MongoDB:

node scripts/seed.js

This will:

  • Connect to MongoDB
  • Delete existing verb entries
  • Insert all entries from data/verbs.json

API Routes

GET /api/katsuyou/verb/:word Returns a single verb entry matching either hiragana or kanji. Example:

GET /api/katsuyou/verb/たべる

Response:

{
  "hiragana": "たべる",
  "kanji": "食べる",
  "meaning": "to eat",
  "type": "ichidan",
  "exampleTemplate": "ごはんを",
  "exampleMeaning": "I [verb] rice."
}

Related Project

Frontend Repo (KotoKatsuyou) — React-based UI that consumes this API


License

License: CC BY-NC-ND 4.0

This project is for personal, non-commercial use only.
You may not redistribute, modify, or republish this code without explicit permission from the author.


About

Express + MongoDB API for Japanese verb conjugation. Serves structured verb data used by the KotoKatsuyou frontend.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors