Local Deployment
Relevant source files
The following files were used as context for generating this wiki page:
Local deployment of the Solo System project involves hosting a client-side web application that utilizes browser-based storage and regional time synchronization. The system is designed as a standalone "Penalty System" inspired by "Solo Leveling," requiring no backend server as it operates entirely within the user's browser environment.
The deployment focuses on rendering a responsive UI (User Interface) that manages daily tasks, experience points (XP), and rank progressions. It leverages localStorage for data persistence, ensuring that user progress is maintained across sessions on the same device.
Application Architecture
The application follows a monolithic client-side architecture where the logic, styling, and structure are contained within single HTML files. This design facilitates easy local deployment by simply opening the files in a modern web browser.
Key Components
| Component | Description | File Reference |
|---|---|---|
| UI Layer | HTML/CSS responsible for the "System Status" dashboard, XP bars, and task cards. | index.html:10-100, Quest.html:10-100 |
| Logic Controller | JavaScript functions handling rank calculation, level progression, and task generation. | index.html:115-210, Quest.html:115-210 |
| Data Persistence | LocalStorage API used to store systemData objects. | index.html:132-134, Quest.html:132-134 |
| Time Sync | Integration with Intl.DateTimeFormat for Saudi Arabia (KSA) timezone synchronization. | index.html:167-169, Quest.html:167-169 |
Data Flow and Persistence
The system relies on a centralized state object named systemData. During local deployment, the application initializes this state by attempting to fetch existing data from the browser's localStorage.
The data structure includes points, lastUpdate (date string), dailyTasks (array), and lastPenalty (integer).
Sources: index.html:132-134, Quest.html:132-134
Core Logic Modules
1. Rank and Leveling System
The system calculates the user's rank based on total points. Higher ranks increase the difficulty of tasks and modify the reward/penalty ratios.
| Rank | Min Points | Reward | Penalty | Requirement (XP) |
|---|---|---|---|---|
| R | 3000 | +6 | -8 | 50 |
| S | 1200 | +4 | -6 | 30 |
| A | 800 | +4 | -6 | 25 |
| F | 0 | +2 | -3 | 10 |
Sources: index.html:136-146, Quest.html:136-146
2. Task Generation Engine
Tasks are categorized into physical, discipline, and mental. Upon a new day (detected via Saudi Riyadh time), the generateTasks() function selects a subset of tasks from the taskDatabase based on the user's current difficulty level (diff).
Sources: index.html:158-185, Quest.html:158-185
Local Configuration and Environment
The deployment environment must support the following web technologies:
- CSS Variables: For theme management (e.g.,
--system-blue,--penalty-red). - Flexbox/Grid: For the "Stats Panel" and "Tasks Container" layouts.
- Intl API: Specifically
Intl.DateTimeFormatwith theAsia/Riyadhtimezone to ensure consistent daily resets across different local system clocks.
Saudi Arabia Time Integration
The system uses a 1-second interval to update the displayed time and a checkDailyCycle function to determine if a penalty should be applied for tasks not completed by the end of the day in the KSA timezone.
Sources: index.html:167-185, index.html:205-207, Quest.html:167-185
Summary
Local deployment of the Solo-System is achieved by serving the index.html or Quest.html files. The system effectively manages a self-contained ecosystem of habit tracking and gamification using rank-based scaling, daily penalties for inactivity, and persistent local storage.