How jyboy/subject-rankings works
Main Components
a. Frontend (Client):
• Located in the “client” folder.
• Built with React and Redux. It includes UI layout, styling (SCSS), assets (fonts and images), and pages (e.g., subject and university pages).
• Handles user interactions, internationalization, and responsive design for both PC and mobile.
b. Backend (Server):
• Located in the “server” folder.
• Developed with TypeScript and provides API endpoints for subjects and universities.
• Manages data access (e.g., interacting with an SQLite3 database found in “server/data/db.sqlite3”) and includes modules for models, routes, and types.
• Incorporates CI/CD and testing (includes Vitest configurations, tests for models and routes, and linting/formatting settings).
• Configuration and deployment settings are further supported by files such as tsconfig.json, wrangler.toml (hinting at Cloudflare services), and environment/type definition files.
c. Database:
• The backend includes an SQLite3 database used for storing and retrieving subject ranking data.
d. External and Supporting Services:
• Cloudflare: As indicated by the “wrangler.toml” and the provided Cloudflare badge, the application leverages Cloudflare’s deployment/CDN services.
• CI/CD and Testing: GitHub Actions (workflows in .github/workflows) are used for automated testing and deployment. Cypress tests in the client verify end-to-end functionality.
Relationships and Interactions
• The client sends API calls to the backend server to retrieve or update ranking data.
• The server interacts with the SQLite database for persistent storage.
• Users’ actions on the UI flow through the React components (with Redux managing state) and eventually hit the backend API, forming a clear separation between frontend presentation and backend business logic/data handling.
• Testing pipelines (unit tests, integration tests, and E2E tests) help ensure that both components interact correctly.
• CI/CD workflows tie together development, testing, and deployment.
Architectural Patterns and Design Principles
• Separation of Concerns: Clearly divides the project into a client (presentation/UI) and server (API/data) layer.
• MVC-like or API-Driven Architecture (for the backend): Routes and models are separated, suggesting that the server adheres to a modular design for handling data operations and HTTP endpoints.
• Responsive and Internationalized UI: The client is built with entry points and configuration for languages and device responsiveness.
• Emphasis on automated Quality Assurance (using ESLint, Prettier, testing scripts, and GitHub workflows).
Including Relevant Technologies, Frameworks, and Libraries
• Client: React, Redux, Cypress (for E2E testing), SCSS, and related front-end tooling.
• Server: Node.js, TypeScript, SQLite (as a lightweight DB), and Cloudflare services (suggested by wrangler configuration).
• CI/CD: GitHub workflows, possibly integrated with Cloudflare Pages for deployment.
• Testing: Vitest and Cypress for establishing strong testing coverage.