# toyama170402/rishu-app architecture

> Architecture diagram of the GitHub repository toyama170402/rishu-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/toyama170402/rishu-app
- Repository: https://github.com/toyama170402/rishu-app

## Overview

##### Project type and purpose
- This is a multi-service, containerized monorepo that centers on a full-stack web application (“rishu-app” Next.js frontend) together with its supporting subsystems:
- A Go-based REST API (“syllabus-backend”)
- A TypeScript scraper/scheduler (“syllabus-scrape”)
- A static mock server for local HTML fixtures (“mock-page”)
- An additional syllabus-oriented frontend (“syllabus-frontend”)
- An NGINX reverse-proxy in front of all HTTP services
- A relational database (configured in the Go service)
- External data source (“risyu API” / kurisyushien.org)

##### File structure
- Top-level orchestrator:
- docker-compose.yml / docker-compose.dev.yml spins up all containers
- .devcontainer/… provides VS Code “Reopen in Container” definitions for each service
- Services under root:
- frontend/ → Next.js + React + MUI application (the rishu-app UI)
- syllabus-backend/ → Go module exposing HTTP routes, DB config, controllers, repositories, schemas
- syllabus-scrape/ → Node.js/TypeScript CLI with scheduler, Puppeteer/Cheerio scrapers, storage adapters
- mock-page/ → Dockerized HTTP server serving static HTML/TSV for local scraping tests
- syllabus-frontend/ → Another React/Remix-style app for browsing syllabus data
- nginx/ → Single Dockerfile + default.conf.template for routing

##### README for additional insights
- The README focuses on the “rishu-app” UI (frontend/)
- Technology stack: Next.js, React, MUI, TypeScript, Node.js, Docker, Dev Containers, Vercel, external risyu API
- Describes use cases: support for lottery-based course registration at Kanazawa University

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Edge
    User["User (Browser/Mobile)"]:::external

    %% Infrastructure
    Nginx["NGINX Reverse-Proxy"]:::infra
    compose["Docker Compose Orchestrator"]:::infra
    devcont["VS Code Dev Containers"]:::infra

    %% Presentation Layer
    rishu["rishu-app UI"]:::frontend
    syllabusFE["syllabus-frontend UI"]:::frontend

    %% Application/API Layer
    api["syllabus-backend API"]:::api

    %% ETL/Scheduler Layer
    scraper["syllabus-scrape Scheduler & Scraper"]:::etl

    %% Data Layer
    db["Relational Database"]:::infra

    %% External Services
    risyu["risyu API / kurisyushien.org"]:::external
    mock["Mock HTML Server"]:::external

    %% Relationships
    User -->|"HTTPS Request"| Nginx
    Nginx -->|"Routes / & /app"| rishu
    Nginx -->|"Routes /syllabus"| syllabusFE

    rishu -->|"API Requests"| api
    syllabusFE -->|"API Requests"| api

    api -->|"Reads/Writes"| db
    db -->|"Data"| api

    scraper -->|"Writes Data"| db
    scraper -->|"Fetches HTML"| risyu
    scraper -->|"Fetches HTML"| mock

    %% Orchestration connections
    compose --> Nginx
    compose --> rishu
    compose --> syllabusFE
    compose --> api
    compose --> scraper
    compose --> mock
    compose --> db

    devcont --> rishu
    devcont --> api
    devcont --> syllabusFE
    devcont --> scraper

    %% Click Events
    click Nginx "https://github.com/toyama170402/rishu-app/tree/main/nginx/"
    click rishu "https://github.com/toyama170402/rishu-app/tree/main/frontend/"
    click syllabusFE "https://github.com/toyama170402/rishu-app/tree/main/syllabus-frontend/"
    click api "https://github.com/toyama170402/rishu-app/tree/main/syllabus-backend/"
    click scraper "https://github.com/toyama170402/rishu-app/tree/main/syllabus-scrape/"
    click mock "https://github.com/toyama170402/rishu-app/tree/main/mock-page/"
    click compose "https://github.com/toyama170402/rishu-app/blob/main/docker-compose.yml"
    click devcont "https://github.com/toyama170402/rishu-app/tree/main/.devcontainer/"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0080FF,color:#000;
    classDef api fill:#D0FFD6,stroke:#00A000,color:#000;
    classDef etl fill:#FFE8A8,stroke:#FF8000,color:#000;
    classDef infra fill:#E0E0E0,stroke:#888888,color:#000;
    classDef external fill:#F0F0F0,stroke:#AAAAAA,color:#000,stroke-dasharray: 5 5;
```
