How kadiryazadzhi/judgex works
Main Components
• User Interface (UI) / Presentation Layer:
– HTML pages: index.html, profile.html, system.html, test.html (each representing different “views” for home, user profile, and system functionalities).
– CSS directories (Style/For All, Style/Home, Style/Profile, Style/System, etc.) that implement the design and responsive behaviors including dark/light modes.
• Client-Side Logic / Script Layer:
– JavaScript files bundled into functional modules:
▪ For All: General utilities and common functionality (e.g., chat-bot logic, clock, and shared constants).
▪ Home: Controls the home page features such as header features, animations, language cards, leaderboard, map, etc.
▪ Profile: Manages user interactions in the profile area (e.g., badge handling, certificate generation, profile notifications, image modifications).
▪ System: Deals with core judging system functionalities (e.g., code compilation, exercise submissions, problem document downloads, sidebar logic, and interactive elements like timers and validation routines).
▪ Other: Special scripts such as the 404 page logic and external connections (like firebase).
• Exercise Content Repository:
– The “Exercise” directory contains the coding challenges, grouped by difficulty (Easy, Medium, Hard, Insane, Special). Each exercise is stored as a document that possibly provides a problem statement.
– This separation highlights the modular design where different coding challenges are categorized and can be dynamically loaded or referenced by the system.
• JSON Configuration / Data Layer:
– JSON files (found in the “Json” folder) hold key data:
▪ chat-bot phrases,
▪ exercises-answers data,
▪ system information (perhaps guiding dynamic behavior).
• Assets / Static Resources:
– Image directory for badges and other visual elements.
– Static HTML error pages (403.html, 404.html) to handle user navigation errors.
Relationships and Interactions
• The UI sends user events (clicks, form inputs, navigation events) to the respective JavaScript modules.
• Each UI section (Home, Profile, System) interacts with its dedicated script set, which processes inputs, controls animations, data loading from JSON, and even dynamic updates of the DOM.
• The Exercise repository provides problem data that the system component (under Script/System) fetches or references to display problems, validate responses, or update solutions.
• The JSON data plays a role in supplying configuration details (such as system parameters, language options, and preset answers) that the scripts can load at runtime.
• Styling (CSS) connects with the UI to render components correctly and to reflect dynamic changes (like theme switching triggered via Script/System).
Key Architectural Patterns and Design Principles
• Modularization: Clear separation of concerns where different directories address different UI pages (Home, Profile, System) and separate logic modules.
• Layering: UI (HTML/CSS) is cleanly separated from Client-Side Logic (JS), which further communicates with static data sources (JSON files).
• Reusability: Shared scripts in “For All” enable common functionality across multiple areas.
• Extensibility: The clear segregation of exercises (by difficulty) and dedicated script folders facilitates easy addition of new challenges and features.
Elements
• Clear Nodes: Represent each major component (UI Pages, Script Modules for Home, Profile, System, JSON/Exercise Data, Assets).
– User Interaction → UI Page → JavaScript Module.
– JavaScript Module → JSON/Exercise Data (for loading challenge data).
– JavaScript Module → CSS/Style updates (for theme changes and responsive behavior).
– Start with the end-user at the top, driving interactions with the Web Browser.
– The browser displays different pages: Home, Profile, System. Each page is linked to a particular set of CSS and JavaScript modules.
– Next, indicate how these scripts access static JSON data for configuration and exercise details.
– Clearly separate the “Exercise” folder content as a distinct module that serves as the content repository for challenges.
– Also, show that shared utility scripts and assets (images, configuration files) are accessed across modules.
– Finally, include ancillary components (error pages, additional scripts from the “Other” folder) and point out their roles (e.g., handling 404 errors or integrating with third-party services like Firebase).