Skip to content

Add app-lite — frontend-only Starklings app - #300

Open
shramee wants to merge 16 commits into
mainfrom
app-lite
Open

shramee wants to merge 16 commits into
mainfrom
app-lite

Conversation

@shramee

@shramee shramee commented Aug 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds ./app-lite, a React frontend-only version of the Starklings web app with no
backend (no Express API, Postgres, or scarb runner). All visual/UI features of
app/client are preserved — Home, Workspace (Monaco editor, hints, compile/test,
sidebar progress, edit dialog), FinalScreen, GitHub OAuth login, Starknet wallet
drawer (braavos/argent), About, and the Basecamp modal — with progress persisted in
localStorage only.

What changed

  • New app-lite/ CRA app (react-scripts 5.0.1), copied and adapted from app/client.
  • Embedded exercise data: a codegen script (scripts/generate-exercises.js) reads
    info.toml, the 55 .cairo sources, and app/api/anti-cheat.json, emitting a lightweight
    src/data/exercises.json index plus one per-exercise JSON file, loaded on demand as
    separate chunks.
  • LocalStorage progress: completions, saved solutions, and current exercise per user;
    progress merges into the GitHub identity on login.
  • Removed backend-dependent UI: Graduates, Student Progress, and Student Evaluation
    routes, the header Assessment menu, and related queries/types — these need the
    database.
  • GitHub OAuth still works client-side directly against GitHub's endpoints.
  • Compile/test still uses the shared Cairo WASM runner.
  • gh-pages deploy: npm run deploy publishes to https://shramee.github.io/starklings
    (root of the gh-pages branch on origin), with PUBLIC_URL-prefixed asset paths and
    .nojekyll.

Files

  • app-lite/** — the entire new app (~130 files)
  • Also includes unrelated pre-existing branch changes to README*.md and src/main.rs,
    plus swept-in .commandcode/taste/ files.

Verification

  • npm run build compiles cleanly (per-exercise chunks confirmed separate from the main
    bundle).
  • npm test passes (router-wrapped smoke test; added Jest transformIgnorePatterns +
    TextEncoder polyfill for the starknet ESM deps).
  • Asset paths verified prefixed for the gh-pages subpath/root.

How to run / deploy

cd app-lite
npm install
npm start # http://localhost:4000
npm run deploy # publishes to shramee.github.io/starklings

shramee and others added 16 commits August 5, 2026 17:28
Copy the frontend structure (public assets, src components, types,
context, hooks, utils, queries) as the base for a frontend-only
variant. Backend wiring is still present and gets replaced next.

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
Generate a lightweight exercises.json index plus one JSON file per
exercise (code, description, hint, antiCheat) from info.toml, the
.cairo sources, and app/api/anti-cheat.json. Add a localStorage
progress util and app-lite package/env scaffolding.

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
useGetExercises reads the generated index and overlays local
completions; useGetExercise/useGetHint dynamic-import the per-exercise
JSON; useMarkExerciseDone writes localStorage; useMatchUserToGitHubAccount
is a no-op; useGetGraduates is empty. GitHub token/user-data queries now
call GitHub's endpoints directly instead of the backend proxy, and the
unused useCompileCairo hook is removed.

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
Workspace edits now open the main repo (no fork), the edit dialog no
longer requires a fork, and progress is stored locally. Check pages
show local progress only for the logged-in user (or an empty state),
and student evaluation is a no-op with an explanatory note.

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
Add axios and @types/linkify-it deps, type the exercise index mode and
optional path/disabled fields, fix implicit-any callbacks, add a
Jest transformIgnorePatterns for ESM starknet packages, polyfill
TextEncoder for tests, and replace the broken default App test with a
router-wrapped smoke test.

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
Add homepage base URL, gh-pages devDependency, predeploy/deploy
scripts (deploying the build to the app-lite/ subpath on the
gh-pages branch), and a .nojekyll marker so the JS chunks deploy
without Jekyll processing.

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
Use process.env.PUBLIC_URL for all runtime asset references (logo,
wallet icons, modal image) so they resolve under the gh-pages subpath.
Remove the graduates/student-progress/evaluation routes, the header
Assessment menu, the Check/Evaluate pages, and the unused graduates
query and type — these features need the backend database.

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
Publish the build to the gh-pages branch of origin (shramee/starklings)
at the repo root instead of an app-lite subpath.

Co-Authored-By: CommandCodeBot <noreply@commandcode.ai>
… wasm

Swap the remote runner API for the cairo-runner wasm package so compile/test
works offline with zero network calls.

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
Display compilation errors in a monospace pre block across both apps and
reword the error message now that compilation happens locally.

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
…nner

Add a wasm integration test suite (node --test) for the cairo-runner package
and jest unit tests for compileCairoCode's logic with the runner mocked.

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
…ript

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant