How nistont/schedule-generator works
Project Overview
• Project Type: This is a full-stack scheduling application, built with a Next.js (React) client and a NestJS server.
• Purpose: The application is designed to generate and manage various types of schedules (for cabinets, groups, teachers, etc.), featuring user authorization (with Telegram and email integrations), AI-powered generation enhancements, and local as well as server-side schedule saving. The README even highlights future features like notifications, multi-language support, and an admin panel.
Analyzing the File Structure
• Client (Frontend):
• The “client” folder is organized around Next.js’s file-based routing. There are clear directories for “app” pages (like authorization, documentation, profile, setting, and registration), and many reusable UI components (buttons, fields, select inputs, etc.).
• The structure is well modularized: each feature (e.g., “authorization”, “profile”) has its own folder housing pages, providers, and sometimes custom layouts.
• There are dedicated areas for API calls (client/src/api), service calls, constants, hooks, and even state management using jotai.
• Assets such as images and fonts are organized under public and fonts directories.
• Server (Backend):
• The “server” folder shows a NestJS backend structure using modules for authentication (auth), schedule management, and user management.
• It uses Prisma for database interaction (prisma/schema.prisma), and follows common NestJS patterns – controllers, services, DTOs, guards, decorators, and strategies (like JWT for authorization).
• Configuration files (e.g., nest-cli.json, tsconfig, eslint, prettier) indicate a well-structured modern Node.js backend.
a. Main Components to Include:
• Frontend Client: Next.js application with pages, API service modules, state management (jotai), and UI components.
• Backend Server: NestJS application exposing RESTful endpoints organized in modules (auth, schedule, user). Show key services like authentication, schedule generation, and management.
• Database: Represented by Prisma integrations. This will show a connection between the server and the underlying relational database.
• External Services:
– Integration with Telegram (for two-factor authentication and notifications).
– Email systems (like Yandex Mail) for notifications and API key updates.
– AI External API for enhanced schedule generation.
• Local Storage (Optional): The client may use localStorage for schedule persistence, as suggested in the README.
b. Relationships and Interactions:
• Server-to-Database: Represent the backend’s service modules communicating with the database via Prisma.
• Server-to-External Services: Highlight how the server reaches out to Telegram, Email, and AI APIs for notifications, authentication, or schedule generation support.
• Internal Client Interactions: Map out how components (like UI forms, navigation, headers, and various view providers) work together on the frontend.
c. Architectural Patterns and Design Principles:
• Separation of Concerns: Frontend (view, state management, API calls) separated from backend (business logic, database access, external integrations).
• Modular Architecture: Both client and server structures are modular – each domain (auth, profile, schedule) is encapsulated in its own sub-system.
• API-First and Service-Oriented Design: The server serves as an API layer for client interactions, following RESTful principles supported by detailed DTOs and guards.
• Use of External Integrations: Clearly mark integrations (Telegram, Email, and AI APIs) as separate external components that communicate with the backend.
d. Key Technologies/Frameworks:
• Frontend: Next.js (React framework), Tailwind CSS, and state management with jotai.
• Backend: NestJS, Prisma (for ORM), JWT based authentication.
• Development Tools: ESLint, Prettier, and configuration files for consistent coding standards.