Project Structure Overview
Relevant source files
The following files were used as context for generating this wiki page:
- index.html
- Quest.html
- README.md
- style.css (Extracted from embedded styles in index.html)
- script.js (Extracted from embedded scripts in index.html)
The Solo System project is a gamified task management application inspired by the "Solo Leveling" series. Its primary purpose is to track daily physical, mental, and disciplinary tasks, rewarding users with experience points (XP) and ranks while imposing penalties for uncompleted objectives. The application is built as a single-page-style web interface using HTML, CSS, and vanilla JavaScript, with data persistence handled via the browser's LocalStorage.
Sources: index.html:1-10, Quest.html:1-10, README.md:1
Core Architecture and Data Flow
The system operates on a client-side logic loop that synchronizes the user's progress with the current date (specifically tuned to the Asia/Riyadh timezone). It manages a central state object called systemData which stores points, task history, and timestamps.
State Management
The application maintains the following data structure in localStorage under the key solo_penalty_v1:
| Field | Type | Description |
|---|---|---|
points | Number | The cumulative XP of the user. |
lastUpdate | String | The last date (YYYY-MM-DD) the system was accessed. |
dailyTasks | Array | A list of task objects for the current day. |
lastPenalty | Number | The amount of XP deducted during the last daily reset. |
Sources: index.html:121-123, Quest.html:121-123
Daily Cycle Logic
The system uses a "Daily Cycle" check to determine if a new day has started. If the current date differs from lastUpdate, it calculates penalties for incomplete tasks and generates a new set of randomized tasks.
The flow diagram above illustrates how the system resets progress and applies penalties during the transition to a new calendar day.
Sources: index.html:164-187, Quest.html:164-187
Ranking and Leveling System
The system implements a dynamic progression logic where task difficulty and rewards scale based on the user's total points.
Rank Configuration
The getRankConfig function defines the thresholds for different ranks, ranging from 'F' to 'R'. Each rank determines the reward for completing a task and the penalty for failing one.
| Rank | Min Points | Reward | Penalty | Requirement (XP/LVL) |
|---|---|---|---|---|
| F/E | 0 - 70 | 2 | 3 | 10 |
| D | 150 | 3 | 5 | 12 |
| C | 300 | 3 | 5 | 15 |
| B | 500 | 4 | 6 | 20 |
| A | 800 | 4 | 6 | 25 |
| S | 1200 | 4 | 6 | 30 |
| SS | 2000 | 6 | 8 | 40 |
| R | 3000 | 6 | 8 | 50 |
Sources: index.html:125-136, Quest.html:125-136
Level Calculation Logic
Levels are calculated iteratively. For levels 1-5, the requirement is fixed at 5 XP. From level 6 onwards, the requirement is determined by the current rank's req value.
This sequence shows the interaction between a user action and the subsequent recalculation of levels and UI updates.
Sources: index.html:138-146, Quest.html:138-146
Task Generation Engine
Tasks are categorized into three types: Physical, Discipline, and Mental. The system pulls from a hardcoded taskDatabase and selects a specific number of tasks per category daily.
Task Database Structure
The database provides variations of tasks based on the current difficulty level (f, d, a, r) mapped to the user's rank.
- Physical: 2 tasks (e.g., Pushups, Squats, Plank)
- Discipline: 2 tasks (e.g., Bed making, Water intake)
- Mental: 1 task (e.g., Reading)
Sources: index.html:108-119, Quest.html:108-119
Implementation of Task Generation
function generateTasks() {
const config = getRankConfig(systemData.points);
const diff = config.diff;
const shuffle = (arr) => arr.sort(() => Math.random() - 0.5);
const p = shuffle([...taskDatabase.physical]).slice(0, 2).map(t => ({n: t[diff] || t['f'], c: 'جسدي', d: false}));
// ... logic for discipline and mental categories
return [...p, ...d, ...m];
}
Sources: index.html:154-162, Quest.html:154-162
UI and Visual Representation
The interface is designed with a dark "system" aesthetic, utilizing CSS variables for theme consistency (--system-blue, --penalty-red). It features a real-time clock synchronized to the Saudi Arabia (Riyadh) timezone and a progress bar representing XP towards the next level.
- Stats Panel: Displays Level, Rank, and Total XP.
- XP Bar: Visualizes progress using the
calculateLevelfunction output. - Task Cards: Interactive elements that toggle completion status and trigger the
toggleTaskfunction.
Sources: index.html:12-80, Quest.html:12-80, index.html:200-202
The project structure effectively combines simple web technologies with complex gamification logic, ensuring a persistent and engaging user experience through automated penalty systems and dynamic difficulty scaling.