Skip to content

Commit f38289a

Browse files
committed
start
1 parent 4b1ac73 commit f38289a

35 files changed

Lines changed: 448 additions & 1710 deletions

.course/ci/verify.sh

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
cd "$(dirname "${BASH_SOURCE[0]}")/../.."
5+
6+
status_for_lesson() {
7+
if [[ "$1" == "true" ]]; then
8+
printf "done"
9+
else
10+
printf "pending"
11+
fi
12+
}
13+
14+
check_exists() {
15+
local target="$1"
16+
[[ -e "$target" ]]
17+
}
18+
19+
check_contains() {
20+
local target="$1"
21+
local needle="$2"
22+
[[ -f "$target" ]] && grep -q "$needle" "$target"
23+
}
24+
25+
check_build() {
26+
npm run build >/dev/null 2>&1
27+
}
28+
29+
lesson001_node_modules=false
30+
lesson001_build=false
31+
lesson002_component=false
32+
lesson002_nav=false
33+
lesson003_dependency=false
34+
lesson003_router=false
35+
lesson004_catalog=false
36+
lesson005_fetch=false
37+
lesson006_tailwind=false
38+
lesson007_build=false
39+
40+
check_exists node_modules && lesson001_node_modules=true
41+
check_build && lesson001_build=true && lesson007_build=true
42+
check_exists src/components/Header.tsx && lesson002_component=true
43+
check_contains src/components/Header.tsx "nav" && lesson002_nav=true
44+
check_contains package.json "react-router-dom" && lesson003_dependency=true
45+
check_contains src/App.tsx "BrowserRouter" && lesson003_router=true
46+
check_contains src/App.tsx "Catalog" && lesson004_catalog=true
47+
check_contains src/App.tsx "fetch(" && lesson005_fetch=true
48+
check_contains src/App.tsx "grid" && lesson006_tailwind=true
49+
50+
cat <<JSON
51+
{
52+
"course_id": "vite-react-starter",
53+
"lessons": [
54+
{
55+
"id": "001",
56+
"status": "$(status_for_lesson "$([[ "$lesson001_node_modules" == true && "$lesson001_build" == true ]] && echo true || echo false)")",
57+
"checks": {
58+
"node_modules": $lesson001_node_modules,
59+
"build_ok": $lesson001_build
60+
},
61+
"messages": {}
62+
},
63+
{
64+
"id": "002",
65+
"status": "$(status_for_lesson "$([[ "$lesson002_component" == true && "$lesson002_nav" == true ]] && echo true || echo false)")",
66+
"checks": {
67+
"header_component": $lesson002_component,
68+
"header_nav": $lesson002_nav
69+
},
70+
"messages": {}
71+
},
72+
{
73+
"id": "003",
74+
"status": "$(status_for_lesson "$([[ "$lesson003_dependency" == true && "$lesson003_router" == true ]] && echo true || echo false)")",
75+
"checks": {
76+
"router_dependency": $lesson003_dependency,
77+
"router_usage": $lesson003_router
78+
},
79+
"messages": {}
80+
},
81+
{
82+
"id": "004",
83+
"status": "$(status_for_lesson "$lesson004_catalog")",
84+
"checks": {
85+
"catalog_data": $lesson004_catalog
86+
},
87+
"messages": {}
88+
},
89+
{
90+
"id": "005",
91+
"status": "$(status_for_lesson "$lesson005_fetch")",
92+
"checks": {
93+
"fetch_usage": $lesson005_fetch
94+
},
95+
"messages": {}
96+
},
97+
{
98+
"id": "006",
99+
"status": "$(status_for_lesson "$lesson006_tailwind")",
100+
"checks": {
101+
"tailwind_classes": $lesson006_tailwind
102+
},
103+
"messages": {}
104+
},
105+
{
106+
"id": "007",
107+
"status": "$(status_for_lesson "$lesson007_build")",
108+
"checks": {
109+
"final_build": $lesson007_build
110+
},
111+
"messages": {}
112+
}
113+
]
114+
}
115+
JSON

.course/course.json

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
{
2+
"id": "vite-react-starter",
3+
"version": "1.0.0",
4+
"title": "Vite + React: first application",
5+
"description": "Build a small storefront-style app in incremental GitCourse lessons.",
6+
"language": "typescript",
7+
"sections": [
8+
{
9+
"id": "setup",
10+
"title": "Project setup",
11+
"description": "Validate the starter toolchain and basic app structure.",
12+
"lessons": [
13+
{
14+
"id": "001",
15+
"title": "Clone and run",
16+
"objective": "Install dependencies and boot the app locally.",
17+
"ask_context": "The student is preparing the Vite + React repository and validating the local toolchain.",
18+
"hints": [
19+
"Run npm install first.",
20+
"Use npm run build to validate CI readiness."
21+
],
22+
"checklist": [
23+
{
24+
"id": "node_modules",
25+
"label": "Dependencies are installed",
26+
"verify": "dir_exists:node_modules"
27+
},
28+
{
29+
"id": "build_ok",
30+
"label": "The production build passes",
31+
"verify": "build_succeeds:npm run build"
32+
}
33+
]
34+
},
35+
{
36+
"id": "002",
37+
"title": "Create the header",
38+
"objective": "Add a reusable Header component with navigation links.",
39+
"ask_context": "The student is creating the first presentational React component.",
40+
"hints": [
41+
"Create src/components/Header.tsx.",
42+
"Use semantic nav markup."
43+
],
44+
"checklist": [
45+
{
46+
"id": "header_component",
47+
"label": "Header component exists",
48+
"verify": "file_exists:src/components/Header.tsx"
49+
},
50+
{
51+
"id": "header_nav",
52+
"label": "Header includes navigation markup",
53+
"verify": "file_contains:src/components/Header.tsx:nav"
54+
}
55+
]
56+
},
57+
{
58+
"id": "003",
59+
"title": "Add routing",
60+
"objective": "Prepare Home, About, and Catalog pages with react-router.",
61+
"ask_context": "The student is introducing client-side routing into the starter app.",
62+
"hints": [
63+
"Install react-router-dom when you are ready.",
64+
"Keep pages simple at first."
65+
],
66+
"checklist": [
67+
{
68+
"id": "router_dependency",
69+
"label": "react-router-dom is referenced in package.json",
70+
"verify": "file_contains:package.json:react-router-dom"
71+
},
72+
{
73+
"id": "router_usage",
74+
"label": "App.tsx uses routing components",
75+
"verify": "file_contains:src/App.tsx:BrowserRouter"
76+
}
77+
]
78+
}
79+
]
80+
},
81+
{
82+
"id": "catalog",
83+
"title": "Catalog experience",
84+
"description": "Build a small catalog view with data and styles.",
85+
"lessons": [
86+
{
87+
"id": "004",
88+
"title": "Catalog page with mock data",
89+
"objective": "Render a list of products or course cards from mock data.",
90+
"ask_context": "The student is building the first list page and shaping mock data for rendering.",
91+
"hints": [
92+
"Keep the mock data local first.",
93+
"Use map() to render cards."
94+
],
95+
"checklist": [
96+
{
97+
"id": "catalog_data",
98+
"label": "Catalog page contains mock data",
99+
"verify": "file_contains:src/App.tsx:Catalog"
100+
}
101+
]
102+
},
103+
{
104+
"id": "005",
105+
"title": "Fetch JSON data",
106+
"objective": "Load data from a local JSON source or stub API.",
107+
"ask_context": "The student is replacing inline mock data with a fetch-based data source.",
108+
"hints": [
109+
"Use useEffect for the first fetch.",
110+
"Handle loading and error states."
111+
],
112+
"checklist": [
113+
{
114+
"id": "fetch_usage",
115+
"label": "The app uses fetch()",
116+
"verify": "file_contains:src/App.tsx:fetch("
117+
}
118+
]
119+
},
120+
{
121+
"id": "006",
122+
"title": "Tailwind styling",
123+
"objective": "Apply responsive layout and dark mode friendly UI.",
124+
"ask_context": "The student is improving the layout and visual hierarchy with Tailwind.",
125+
"hints": [
126+
"Use grid utilities for the catalog.",
127+
"Keep spacing consistent."
128+
],
129+
"checklist": [
130+
{
131+
"id": "tailwind_classes",
132+
"label": "Tailwind utility classes were added to the app",
133+
"verify": "file_contains:src/App.tsx:grid"
134+
}
135+
]
136+
},
137+
{
138+
"id": "007",
139+
"title": "Production build",
140+
"objective": "Prepare the app for release and preview the result.",
141+
"ask_context": "The student is validating the final production build and preview flow.",
142+
"hints": [
143+
"The build should stay green after all previous changes.",
144+
"Use npm run preview to inspect the final bundle."
145+
],
146+
"checklist": [
147+
{
148+
"id": "final_build",
149+
"label": "The final build passes",
150+
"verify": "build_succeeds:npm run build"
151+
}
152+
]
153+
}
154+
]
155+
}
156+
]
157+
}

.course/progress.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"course_id": "vite-react-starter",
3+
"lessons": [
4+
{ "id": "001", "status": "pending", "checks": {}, "messages": {} },
5+
{ "id": "002", "status": "pending", "checks": {}, "messages": {} },
6+
{ "id": "003", "status": "pending", "checks": {}, "messages": {} },
7+
{ "id": "004", "status": "pending", "checks": {}, "messages": {} },
8+
{ "id": "005", "status": "pending", "checks": {}, "messages": {} },
9+
{ "id": "006", "status": "pending", "checks": {}, "messages": {} },
10+
{ "id": "007", "status": "pending", "checks": {}, "messages": {} }
11+
]
12+
}

.cursor/rules/course.mdc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
description: GitCourse lesson guidance
3+
globs:
4+
- "**/*"
5+
alwaysApply: true
6+
---
7+
8+
Read `.course/course.json` for the active lesson contract.
9+
10+
Read `.course/progress.json` for the current lesson status before changing code.
11+
12+
When helping with the course:
13+
- prefer small, verifiable steps
14+
- keep code comments in English
15+
- do not rewrite the whole project when a lesson asks for one focused change
16+
- explain how the change helps pass the lesson checklist

.github/workflows/course-check.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: course-check
2+
3+
on:
4+
push:
5+
branches: ["**"]
6+
workflow_dispatch:
7+
8+
jobs:
9+
verify:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: "22"
21+
cache: "npm"
22+
23+
- name: Install dependencies
24+
run: npm install
25+
26+
- name: Verify course progress
27+
run: bash .course/ci/verify.sh > .course/progress.json
28+
29+
- name: Commit progress
30+
run: |
31+
if git diff --quiet .course/progress.json; then
32+
exit 0
33+
fi
34+
git config user.name "github-actions[bot]"
35+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
36+
git add .course/progress.json
37+
git commit -m "Update course progress"
38+
git push

.gitignore

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
node_modules
22
dist
3-
build
4-
.turbo/
5-
.manual/
6-
bun.lock
7-
package-lock.json
8-
.env
3+
.DS_Store

.gitmodules

Lines changed: 0 additions & 6 deletions
This file was deleted.

.prompt/chat-grok.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)