You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An interactive platform for learning CSS through practical challenges.
4
+
An interactive platform for learning CSS and Tailwind CSS through practical challenges.
5
5
6
6
## 📚 Overview
7
7
8
-
Code Crispies is a web-based learning platform designed to help users master CSS through hands-on exercises. The application presents a series of progressive challenges organized into themed modules, allowing learners to build their skills step by step while receiving immediate feedback.
8
+
Code Crispies is a web-based learning platform designed to help users master CSS and Tailwind CSS through hands-on exercises. The application presents a series of progressive challenges organized into themed modules, allowing learners to build their skills step by step while receiving immediate feedback.
9
9
10
10
### Key Features
11
11
12
-
-**Interactive Lessons**: Learn CSS concepts through practical, hands-on challenges
12
+
-**Interactive Lessons**: Learn CSS and Tailwind concepts through practical, hands-on challenges
13
+
-**Dual Mode Support**: Switch between CSS and Tailwind CSS learning modes
13
14
-**Progressive Difficulty**: Modules are structured to build skills gradually from basic to advanced
14
-
-**Real-Time Feedback**: Get immediate validation on your code solutions
15
+
-**Real-Time Feedback**: Get immediate validation on your code solutions with comprehensive feedback
15
16
-**Progress Tracking**: Your learning progress is automatically saved in the browser
16
-
-**Visual Preview**: See the results of your CSS code in real-time
17
-
-**Comprehensive Modules**: Cover various CSS topics in organized learning paths
17
+
-**Visual Preview**: See the results of your code in real-time with live preview
18
+
-**Comprehensive Modules**: Cover various CSS and Tailwind topics in organized learning paths
19
+
-**Schema-Validated Lessons**: All lessons follow a strict JSON schema for consistency
18
20
19
21
## 🛠️ Technical Stack
20
22
21
23
- Pure JavaScript (ES Modules)
22
24
- HTML5 & CSS3
23
25
- Vite for bundling and development
24
-
- Vitest for testing
26
+
- Vitest for testing with coverage reporting
27
+
- JSON Schema validation for lesson structure
25
28
- Local Storage for progress persistence
29
+
- whatwg-fetch polyfill for compatibility
26
30
27
31
## 🚀 Getting Started
28
32
@@ -33,7 +37,7 @@ Code Crispies is a web-based learning platform designed to help users master CSS
33
37
34
38
### Installation
35
39
36
-
0. NVM (optional)
40
+
0. NVM (optional)
37
41
```bash
38
42
nvm use
39
43
```
@@ -61,105 +65,139 @@ Code Crispies is a web-based learning platform designed to help users master CSS
61
65
62
66
### Available Scripts
63
67
64
-
-`npm run dev` - Start the development server
68
+
-`npm start` - Start the development server (alias for `npm run dev`)
69
+
-`npm run dev` - Start the development server with host binding
65
70
-`npm run build` - Build for production
66
-
-`npm run preview` - Preview the production build locally
67
-
-`npm run test` - Run tests
71
+
-`npm run preview` - Preview the production build locally with debug mode
72
+
-`npm run test` - Run tests once
68
73
-`npm run test.watch` - Run tests in watch mode
69
74
-`npm run test.coverage` - Run tests with coverage report
70
-
-`npm run format` - Format source code with Prettier
75
+
-`npm run format` - Format source code with Prettier (includes config files)
71
76
-`npm run format.lessons` - Format lesson JSON files with Prettier
72
77
73
78
## 📖 Usage Guide
74
79
75
80
### How to Use Code Crispies
76
81
77
-
1.**Select a Module**: Choose a learning module from the Progress menu
78
-
2.**Read the Challenge**: Each lesson includes an objective and task instructions
79
-
3.**Write CSS Code**: Enter your CSS solution in the editor
80
-
4.**Run Your Code**: Click the "Run" button (or press Ctrl+Enter) to test your solution
81
-
5.**Review Feedback**: Get immediate feedback on your solution
82
-
6.**Progress**: Move to the next lesson once your solution is correct
82
+
1.**Select a Module**: Choose a learning module from the available options
83
+
2.**Choose Mode**: Select between CSS or Tailwind CSS learning mode (if applicable)
84
+
3.**Read the Challenge**: Each lesson includes a description, task instructions, and learning objectives
85
+
4.**Write Code**: Enter your CSS or Tailwind solution in the editor
86
+
5.**Run Your Code**: Click the "Run" button (or press Ctrl+Enter) to test your solution
87
+
6.**Review Feedback**: Get comprehensive feedback with validation messages
88
+
7.**Progress**: Move to the next lesson once your solution passes all validations
83
89
84
90
### Keyboard Shortcuts
85
91
86
92
-`Ctrl+Enter` - Run your code
87
-
-`Tab` - Insert two spaces (for indentation)
93
+
-`Tab` - Insert appropriate indentation
88
94
89
95
## 🧩 Project Structure
90
96
91
97
```
92
98
code-crispies/
93
-
├── public/ # Static assets
99
+
├── coverage/ # Test coverage reports
100
+
├── docs/ # Documentation files (multilingual)
101
+
├── lessons/ # JSON lesson definitions
102
+
├── public/ # Static assets and PWA manifests
103
+
├── schemas/ # JSON Schema definitions
104
+
│ └── code-crispies-module-schema.json
94
105
├── src/
95
-
│ ├── config/ # Configuration files
96
-
│ │ └── lessons.js # Module and lesson definitions
97
-
│ ├── helpers/ # Helper utilities
106
+
│ ├── config/ # Configuration files
107
+
│ │ └── lessons.js # Module and lesson loading logic
Lessons are defined in JSON format in the `lessons.js` file. Each lesson includes:
125
+
Lessons are defined in JSON format following the schema in `schemas/code-crispies-module-schema.json`. Each module includes comprehensive lesson definitions with validation rules.
115
126
116
-
- Title and description
117
-
- Task instructions
118
-
- HTML content for the preview area
119
-
- CSS prefix and suffix (the code before and after the user's input)
120
-
- Validation criteria
127
+
### Module Structure
121
128
122
-
Example lesson structure:
129
+
```json
130
+
{
131
+
"id": "unique-module-id",
132
+
"title": "Module Title",
133
+
"description": "Detailed description of module content and purpose",
134
+
"mode": "css", // or "tailwind"
135
+
"difficulty": "beginner", // "intermediate" or "advanced"
136
+
"lessons": [
137
+
// Lesson objects...
138
+
]
139
+
}
140
+
```
141
+
142
+
### Lesson Structure
123
143
124
-
```js
144
+
```json
125
145
{
126
-
id:"selector-basics",
127
-
title:"CSS Selectors Basics",
128
-
description:"Learn to select and style HTML elements",
129
-
lessons: [
146
+
"id": "unique-lesson-id",
147
+
"title": "Lesson Title",
148
+
"description": "Detailed lesson description and concepts",
149
+
"mode": "css", // Optional override for module mode
150
+
"task": "Specific task instructions for the student",
151
+
"previewHTML": "<div>HTML for preview</div>",
152
+
"previewBaseCSS": "/* Base styles for preview */",
153
+
"sandboxCSS": "/* Additional sandbox styles */",
154
+
"initialCode": "/* Starting code for student */",
155
+
"solution": "/* Optional solution code */",
156
+
"previewContainer": "container-id",
157
+
"validations": [
130
158
{
131
-
title:"Element Selectors",
132
-
description:"Style HTML elements using element selectors",
133
-
taskDescription:"Make all paragraphs red",
134
-
html:"<p>This is a paragraph</p><p>This is another paragraph</p>",
0 commit comments