How atcoder-novisteps/atcodernovisteps works
Main Components
• Frontend UI: Built using Svelte/SvelteKit. All the view files are in the “src/routes” and “src/lib/components” directories. These include pages for login, signup, workbooks, problem lists, user profiles, and administrative views.
• Backend Server/Routes: The SvelteKit server endpoints (files with “+page.server.ts” and other server entry points) handle server-side logic including authentication and data processing.
• Database & Data Access Layer: The “prisma” folder contains the database schema, migrations, seed files, and utility scripts. This shows that Prisma is the chosen ORM, managing the connection to the database.
• External API Clients: Located in “src/lib/clients”, these modules (e.g., aizu_online_judge.ts, atcoder_problems.ts) encapsulate integrations with external programming contest services.
• Business Logic/Services: Under “src/lib/services” you see several modules (e.g., tasks, workbooks, users) that act as the core business logic layer interacting between the frontend/server and the database.
• Testing Infrastructure: With dedicated “src/test” and “tests” directories, the project includes unit and integration tests (including Playwright and other testing frameworks), showing emphasis on quality and stability.
• DevOps & Deployment: With Dockerfile, compose.yaml, GitHub workflows, and container configuration under “.devcontainer”, the project is set up to support containerized development and continuous integration/deployment.
Relationships and Interaction Flows
• Users interact with the Frontend (UI components in “src/lib/components” and pages in “src/routes”) to perform actions such as logging in, updating problem status, and viewing workbooks.
• The Frontend communicates via HTTP/API calls to SvelteKit “server” endpoints (e.g., the “+page.server.ts” files) which serve as the controllers.
• Server endpoints call business logic services (in “src/lib/services”) that encapsulate application rules such as recording answers, updating workbook data, and processing submissions.
• The services interact with the database via Prisma (using configuration files and schema in the “prisma” directory) to perform CRUD operations and maintain synchronization of user data.
• Some services also use external API clients (in “src/lib/clients”) to fetch or update contest problems and data from platforms like AtCoder and Aizu Online Judge.
• The testing components (both unit tests in “src/test” and the end-to-end tests in “tests”) verify that each layer is working correctly and that the data flows between these components adhere to expectations.
Architectural Patterns and Design Principles
• Separation of Concerns: The project is structured to separate the UI (Svelte components), server-side routing (in “src/routes”), business logic/services (in “src/lib/services”), and data access via Prisma (in “prisma”).
• Modular Design: Each group of related functionalities (e.g., authentication, workbook management, task/result updates) is kept in its own module or subdirectory, simplifying maintenance and testing.
• MVC-Like Flow: Although not a strict MVC framework, the use of SvelteKit’s routing (controllers), Svelte components (views), and services/Prisma (model) provide a clear separation much like the MVC paradigm.