Getting Started
Relevant source files
The following files were used as context for generating this wiki page:
The Solo Leveling Penalty System is a gamified task management application designed to track user progress through physical, mental, and disciplinary activities. Users earn experience points (XP) and advance through ranks based on their performance, while failure to complete daily tasks results in system-enforced penalties.
The system operates as a client-side web application, leveraging local storage for data persistence and a time-based cycle to reset tasks and apply penalties according to the Saudi Arabian time zone (Asia/Riyadh).
Sources: index.html:10-25, Quest.html:150-165
System Architecture and Data Flow
The application is structured as a single-page interface that manages state through a central systemData object. This object tracks points, the last update timestamp, the current set of daily tasks, and the most recent penalty applied.
Data Persistence
The system uses the browser's localStorage to maintain the user's state across sessions. The key solo_penalty_v1 stores the serialized JSON representation of the user's progress.
let systemData = JSON.parse(localStorage.getItem('solo_penalty_v1')) || {
points: 0,
lastUpdate: '',
dailyTasks: [],
lastPenalty: 0
};
Sources: index.html:115-117, Quest.html:115-117
Daily Cycle Logic
The application performs a check on startup to determine if a new day has started. This cycle is critical for task generation and penalty application.
The system validates the current date against Asia/Riyadh time to ensure consistency regardless of the user's local machine settings.
Sources: index.html:167-185, Quest.html:167-185
Progression System
The core of the system is the Rank and Leveling logic. Ranks range from 'F' to 'R', with each rank increasing the difficulty of requirements and the weight of rewards/penalties.
Rank Configuration
Ranks are determined by total points. Each rank has specific configurations for rewards, penalties, and XP requirements for leveling up.
| Rank | Min Points | Task Reward | Failure Penalty | Level Req | Difficulty Key |
|---|---|---|---|---|---|
| F | 0 | 2 | 3 | 10 | f |
| E | 70 | 2 | 3 | 10 | f |
| D | 150 | 3 | 5 | 12 | d |
| C | 300 | 3 | 5 | 15 | d |
| B | 500 | 4 | 6 | 20 | d |
| A | 800 | 4 | 6 | 25 | a |
| S | 1200 | 4 | 6 | 30 | a |
| SS | 2000 | 6 | 8 | 40 | r |
| R | 3000 | 6 | 8 | 50 | r |
Sources: index.html:120-131, Quest.html:120-131
Level Calculation
Levels are calculated dynamically based on a cumulative requirement system. While the first 5 levels require a flat 5 points each, subsequent levels scale based on the requirements defined in the Rank configuration.
Sources: index.html:133-142, Quest.html:133-142
Task Management
Tasks are categorized into three types: Physical, Discipline, and Mental. The difficulty of the tasks presented to the user scales based on their current rank.
Task Database Structure
The taskDatabase contains arrays of task objects. Each object provides different descriptions based on the difficulty level (f, d, a, r).
- Physical: Includes Push-ups (ضغط), Squats (سكوات), and Plank (بلانك).
- Discipline: Includes bed tidying, organization, and water intake.
- Mental: Includes reading assignments.
Sources: index.html:100-113, Quest.html:100-113
Generation Logic
When a new day is detected, the generateTasks() function selects a subset of tasks:
- 2 Physical tasks
- 2 Discipline tasks
- 1 Mental task
The specific version of the task (e.g., 10 vs 100 pushups) is selected using the diff key provided by the current rank configuration.
Sources: index.html:158-165, Quest.html:158-165
Penalty Mechanics
The "Penalty System" aspect of the application is enforced during the checkDailyCycle. If systemData.lastUpdate does not match the current date, the system iterates through dailyTasks from the previous session.
For every task where task.d (done) is false, the penalty value (config.pen) associated with the user's rank at that time is subtracted from the total points. The UI then displays a specific warning message to the user.
Sources: index.html:171-180, Quest.html:171-180