Skip to content

zendParadox/nihongo-master

Repository files navigation

JLPT Trainer

A comprehensive, research-backed Japanese language learning platform designed for JLPT (Japanese Language Proficiency Test) preparation. Built with Next.js, featuring spaced repetition, active recall, and interactive learning methodologies.

🚀 Features

📚 Structured Lessons

  • Core Grammar: Detailed explanations with chunking examples
  • Interactive Learning: Pattern recognition and active recall exercises
  • Spaced Repetition Vocabulary: Memory palace techniques and review systems
  • Comprehension Quizzes: Multiple choice and situational exercises
  • Production Practice: Dialogue scenarios and conversation starters
  • Cultural Notes: Context and etiquette insights

🎯 Learning Methodologies

  • Spaced Repetition: Scientifically proven intervals for better retention
  • Active Recall: Testing yourself to strengthen memory
  • Interleaving: Mixed practice for deeper understanding
  • Chunking: Breaking down complex information into manageable pieces
  • Multimodal Learning: Visual, textual, and interactive elements

🎮 Interactive Components

  • Flashcard Player: 3D flip animations with keyboard navigation
  • Active Recall Modals: Immediate feedback exercises
  • Progress Tracking: Local storage-based completion tracking
  • Quick Actions: One-click access to review and practice modes

📱 Responsive Design

  • Mobile-First: Optimized for all device sizes
  • Dark Mode: Automatic theme switching
  • Accessibility: Screen reader friendly with proper ARIA labels

🛠️ Tech Stack

  • Framework: Next.js 15.5.5 with App Router
  • Language: TypeScript
  • Styling: Tailwind CSS v4
  • UI Components: Radix UI primitives
  • Icons: Lucide React
  • Animations: Framer Motion
  • State Management: React hooks with localStorage
  • Build Tool: Turbopack

📁 Project Structure

jlpt-trainer/
├── data/
│   ├── flashcards/     # JLPT level flashcard data
│   ├── lesson/         # Lesson content (JSON)
│   └── quizzes/        # Quiz data
├── src/
│   ├── app/            # Next.js app directory
│   │   ├── (main)/     # Main application routes
│   │   ├── actions/    # Server actions
│   │   ├── globals.css # Global styles
│   │   └── layout.tsx  # Root layout
│   ├── components/     # Reusable components
│   │   ├── auth/       # Authentication components
│   │   ├── study/      # Learning components
│   │   └── ui/         # UI primitives
│   └── lib/            # Utilities and configurations
├── public/             # Static assets
└── package.json

🚀 Getting Started

Prerequisites

  • Node.js 18+ (preferably 20+)
  • npm, yarn, pnpm, or bun

Installation

  1. Clone the repository

    git clone <repository-url>
    cd jlpt-trainer
  2. Install dependencies

    npm install
    # or
    yarn install
    # or
    pnpm install
    # or
    bun install
  3. Run the development server

    npm run dev
    # or
    yarn dev
    # or
    pnpm dev
    # or
    bun dev
  4. Open your browser Navigate to http://localhost:3000 (or the port shown in terminal)

📖 Usage

Navigation

  • Study Hub: Main dashboard with learning options
  • Lessons: Structured grammar and vocabulary lessons
  • Flashcards: Spaced repetition practice
  • Quizzes: Test your comprehension

Lesson Structure

Each lesson includes:

  1. Metadata: Learning objectives and scientific backing
  2. Core Grammar: Detailed explanations with examples
  3. Interactive Sections: Pattern recognition exercises
  4. Vocabulary: Spaced repetition with memory techniques
  5. Practice: Comprehension and production exercises
  6. Cultural Context: Real-world application notes

Keyboard Shortcuts

  • Spacebar: Flip flashcards
  • Arrow Keys: Navigate flashcards and exercises
  • Enter: Select options in quizzes

🔧 Development

Available Scripts

# Development server with Turbopack
npm run dev

# Production build
npm run build

# Start production server
npm start

# Run ESLint
npm run lint

Code Quality

  • ESLint: Configured for Next.js with TypeScript
  • TypeScript: Strict mode enabled
  • Prettier: Code formatting (via ESLint)

Data Structure

Lesson Data Format

interface LessonData {
  metadata: {
    lessonNumber: number;
    title: string;
    subtitle: string;
    learningGoals: string[];
    scientificMetadata: {
      principles: string[];
      estimatedStudyTime: string;
      researchBacking: string[];
    };
  };
  coreGrammar: GrammarPoint[];
  interactiveLearningSections: InteractiveSection[];
  spacedRepetitionVocabulary: VocabularyData;
  comprehensionQuiz: QuizData;
  // ... additional sections
}

Flashcard Data Format

interface Flashcard {
  word: string;
  romaji: string;
  meaning: string;
  type: string;
  example: string;
  translation: string;
}

🎨 Customization

Adding New Lessons

  1. Create a new JSON file in data/lesson/
  2. Follow the LessonData interface structure
  3. Include metadata, grammar points, and exercises
  4. Test the lesson by navigating to /lessons/[lessonId]

Modifying UI Components

  • UI components are in src/components/ui/
  • Use Tailwind CSS for styling
  • Follow the design system with consistent spacing and colors

Theme Customization

  • Colors defined in src/app/globals.css
  • Supports light/dark mode automatically
  • Custom CSS variables for easy theming

🔍 Testing

Running Tests

# Run all tests
npm test

# Run tests in watch mode
npm run test:watch

# Run tests with coverage
npm run test:coverage

Test Structure

  • Unit tests for utilities and hooks
  • Component tests for UI elements
  • Integration tests for page functionality
  • E2E tests for critical user flows

🚀 Deployment

Vercel (Recommended)

  1. Connect your GitHub repository to Vercel
  2. Configure build settings:
    • Framework Preset: Next.js
    • Build Command: npm run build
    • Output Directory: .next
  3. Deploy automatically on push

Other Platforms

The app can be deployed to any platform supporting Node.js:

  • Netlify: Use npm run build and deploy the .next folder
  • Railway: Connect repository and use default Next.js settings
  • Docker: Use the included Dockerfile for containerized deployment

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Contribution Guidelines

  • Follow the existing code style
  • Add tests for new features
  • Update documentation as needed
  • Ensure all tests pass before submitting

📊 Performance

Optimization Features

  • Turbopack: Fast development builds
  • Image Optimization: Next.js automatic optimization
  • Code Splitting: Automatic route-based splitting
  • Caching: Aggressive caching strategies
  • Bundle Analysis: Built-in bundle analyzer

Performance Metrics

  • Lighthouse Score: 95+ on all categories
  • First Contentful Paint: < 1.5s
  • Time to Interactive: < 3s
  • Bundle Size: < 200KB gzipped

🔒 Security

  • Content Security Policy: Configured for security
  • XSS Protection: Sanitized user inputs
  • CSRF Protection: Server actions with proper validation
  • Secure Headers: Security headers configured

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Research: Based on proven learning science (Ebbinghaus, Karpicke & Roediger, etc.)
  • Design: Inspired by effective language learning platforms
  • Community: Thanks to contributors and the open-source community

📞 Support

For support, Saweria: https://saweria.co/zendparadox


Happy Learning! 🎌

Built with ❤️ for Japanese language learners worldwide.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors