A comprehensive platform for Japanese language learning and immersion, featuring vocabulary management, sentence examples, and user authentication.
- Features
- Tech Stack
- Prerequisites
- Getting Started
- API Documentation
- Database Management
- Project Structure
- Client (Frontend)
- Contributing
-
User Authentication & Authorization
- Multi-provider authentication (Email, Google, etc.)
- Role-based access control (RBAC)
- JWT token-based authentication
-
Vocabulary Management
- Create and manage Japanese vocabulary entries
- Multiple meanings per vocabulary
- Part of speech categorization
- Example sentences with translations
-
Audit Logging
- Track all user activities
- Comprehensive audit trail
- Backend Framework: Spring Boot 3.5.5
- Language: Java 17
- Database: PostgreSQL 16
- ORM: Hibernate/JPA
- Database Migration: Liquibase
- API Documentation: Swagger/OpenAPI 3.0
- Object Mapping: MapStruct
- Security: Spring Security + JWT
- Build Tool: Maven
- Containerization: Docker & Docker Compose
Before you begin, ensure you have the following installed:
- Java 17 or higher
- Maven 3.8+
- Docker & Docker Compose (for database)
- Git
git clone https://github.com/your-username/Japanese-Immersion-Hub.git
cd Japanese-Immersion-Hub/serverCopy the sample environment file and configure it:
cp .env.sample .envEdit .env with your configuration:
# Database Configuration
POSTGRES_URL=jdbc:postgresql://localhost:5432/japanese_immersion_hub
POSTGRES_DB=japanese_immersion_hub
POSTGRES_USER=jhub
POSTGRES_PASSWORD=jhub123
POSTGRES_PORT=5432
# Application
PORT=8386
# PgAdmin (optional)
PGADMIN_EMAIL=admin@jhub.com
PGADMIN_PASSWORD=admin123
PGADMIN_PORT=5050Copy the sample Liquibase properties:
cp liquibase.properties.sample liquibase.propertiesEdit liquibase.properties with your database credentials (should match your .env file).
Using Docker Compose:
docker-compose up -d postgresVerify the database is running:
docker psmvn liquibase:updateOr preview the SQL that will be executed:
mvn liquibase:updateSQLmvn clean installOr skip tests if you want a faster build:
mvn clean install -DskipTestsOption 1: Using Maven
mvn spring-boot:run -Dspring-boot.run.profiles=devOption 2: Using Java
java -jar target/server-0.0.1-SNAPSHOT.jar --spring.profiles.active=devThe application will start on http://localhost:8386 (or your configured PORT).
Once the application is running, access the interactive API documentation:
- Swagger UI: http://localhost:8386/api/v1/swagger-ui/index.html
- OpenAPI JSON: http://localhost:8386/v3/api-docs
POST /api/v1/auth/register- Register a new userPOST /api/v1/auth/login- Login with credentialsPOST /api/v1/auth/refresh- Refresh access token
POST /api/v1/vocab- Create new vocabulary entryGET /api/v1/vocab- Get all vocabulary entriesGET /api/v1/vocab/{id}- Get vocabulary by IDPUT /api/v1/vocab/{id}- Update vocabularyDELETE /api/v1/vocab/{id}- Delete vocabulary
GET /api/v1/users/me- Get current user profileGET /api/v1/users- Get all users (admin only)
Apply pending migrations:
mvn liquibase:updateRollback last changeset:
mvn liquibase:rollback -Dliquibase.rollbackCount=1Generate SQL without executing:
mvn liquibase:updateSQLView migration status:
mvn liquibase:statusStart all services:
docker-compose up -dStop all services:
docker-compose downView logs:
docker-compose logs -f postgresAccess PostgreSQL CLI:
docker exec -it jp_postgres psql -U jhub -d japanese_immersion_hubUncomment the pgadmin service in docker-compose.yml and run:
docker-compose up -d pgadminAccess PgAdmin at: http://localhost:5050
server/
├── src/
│ ├── main/
│ │ ├── java/com/minori/server/
│ │ │ ├── config/ # Configuration classes
│ │ │ ├── controller/ # REST controllers
│ │ │ ├── dto/ # Data Transfer Objects
│ │ │ │ ├── request/ # Request DTOs
│ │ │ │ └── response/ # Response DTOs
│ │ │ ├── entity/ # JPA entities
│ │ │ ├── enums/ # Enumerations
│ │ │ ├── exception/ # Custom exceptions
│ │ │ ├── mapper/ # MapStruct mappers
│ │ │ ├── repository/ # JPA repositories
│ │ │ ├── service/ # Business logic
│ │ │ └── ServerApplication.java
│ │ └── resources/
│ │ ├── application.yml
│ │ ├── application-dev.yml
│ │ ├── application-prod.yml
│ │ └── db/
│ │ └── changelog/ # Liquibase migrations
│ └── test/ # Test files
├── docker-compose.yml # Docker services
├── pom.xml # Maven dependencies
├── .env # Environment variables (gitignored)
├── .env.sample # Environment template
├── liquibase.properties # Liquibase config (gitignored)
└── liquibase.properties.sample # Liquibase template
mvn testThe project uses:
- Lombok - Reduce boilerplate code
- MapStruct - Type-safe bean mapping
- Validation - Bean validation with Hibernate Validator
- Create a new changeset file in
src/main/resources/db/changelog/changes/ - Add reference to
db.changelog-master.yml - Run migration:
mvn liquibase:update
Example changeset:
-- liquibase formatted sql
-- changeset author:002-add-new-table
CREATE TABLE new_table (
id BIGSERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL
);- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature/your-feature-name - Open a Pull Request
The application supports multiple profiles:
- dev - Development environment (default)
- test - Testing environment
- prod - Production environment
Switch profiles using:
mvn spring-boot:run -Dspring-boot.run.profiles=prodOr set environment variable:
export SPRING_PROFILES_ACTIVE=prod
java -jar target/server-0.0.1-SNAPSHOT.jarIf you encounter MapStruct errors during build, ensure the annotation processor configuration is correct in pom.xml:
mvn clean install- Verify PostgreSQL is running:
docker ps - Check environment variables in
.env - Test connection:
docker exec -it jp_postgres pg_isready
Change the port in .env file:
PORT=8080This project is licensed under the MIT License - see the LICENSE file for details.
- Minori Team - Initial work
- Spring Boot team for the excellent framework
- Japanese language learning community
- Contributors and testers
Võ đường Ngôn ngữ Hiện đại (Modern Language Dojo). Giao diện được thiết kế theo phong cách cực ngầu lấy cảm hứng từ Zen-Modern, Zine-inspired và đặc biệt là phong cách đồ họa của game Persona 5.
- Giao diện Persona 5: Trang chủ (Landing Page) bùng nổ, đậm chất nghệ thuật.
- Dashboard Zen: Hệ thống lưới Bento, theo dõi Streak và vòng tròn tiến độ Enso.
- Trải nghiệm đắm mình: Không gian học tập tối giản, tập trung tối đa vào kiến thức.
- Guest Access: Cho phép dùng thử ứng dụng ngay lập tức mà không cần đăng ký.
- Node.js v18+
- npm hoặc pnpm
Di chuyển vào thư mục client (đã được đổi tên từ fe):
cd clientCài đặt thư viện:
npm installnpm run devTruy cập tại: http://localhost:3000
- Framework: React 19 + Vite
- Styling: Tailwind CSS v4 (Modern Engine)
- Icons: Material Symbols (Google)
- State: React Context API (Auth, Theme)
Made with ❤️ for Japanese language learners