Skip to content

Repository files navigation

Causal Analysis Practice

Practice causal inference with a Next.js app: I formulated the questions; the UI and flow were built with Cursor to match PRD_causal_analysis_app_final.md.

Pick a method (or all of them), choose MCQ or open-ended mode, and work through shuffled questions from local JSON. Session score and a short summary stay in the tab only (no accounts, no persistence across sessions).

Repository: github.com/chandravenky/practice_causal

Features

  • Home: method card grid (including All methods), mode toggle, Start → /practice
  • Practice: one question at a time; loads from /data/<method>.json; shuffle per session; no repeats within a run
  • MCQ: four options, immediate feedback, explanation, then next
  • Open-ended: reveal model answer, key points (from key_points or skills_tested in JSON), self-rating (got it / partial / missed) with PRD scoring
  • Summary: final score as earned / total and percentage, plus a question log

Tech stack

Layer Choice
Framework Next.js (App Router)
Language TypeScript (strict)
Styling Tailwind CSS v4
UI shadcn/ui (Base UI primitives)
Font Nunito (next/font/google)
Data Static JSON under data/ (imported at build time)

Getting started

cd practice_causal
npm install
npm run dev

Open http://localhost:3000.

If npm run dev fails (caniuse-lite / data/browsers)

Dependencies sometimes install incompletely (or global npm cache permissions break). From this folder:

npm run deps:repair

If deps:repair errors on EACCES under ~/.npm, fix cache ownership (macOS example):

sudo chown -R "$(whoami)" ~/.npm

Then run npm run deps:repair again.

Scripts

Script Purpose
npm run dev Development server
npm run build Production build
npm run start Run production build
npm run lint ESLint
npm run deps:repair Clean reinstall using a project-local npm cache

Project layout (high level)

app/
  page.tsx           # Home - method + mode + start
  practice/page.tsx
  summary/page.tsx
components/          # UI pieces (home flow, practice session, mode selector, …)
data/                # One JSON file per causal method (MCQ + open-ended mixed)
lib/                 # Types, parsing, scoring, question loading
PRD_causal_analysis_app_final.md

Connecting this folder to GitHub

Remote: https://github.com/chandravenky/practice_causal

cd practice_causal
git remote add origin https://github.com/chandravenky/practice_causal.git
# If `origin` already exists:
# git remote set-url origin https://github.com/chandravenky/practice_causal.git

If the GitHub repo already has commits (e.g. an initial README) and your local history is different, merge histories once:

git fetch origin
git pull origin main --allow-unrelated-histories --no-rebase
# Resolve any conflicts (e.g. README.md), then:
git add README.md
git commit -m "Merge remote main with local project"
git push -u origin main

If you intend to replace the remote main entirely with this project (destructive):

git push -u origin main --force-with-lease

Use --force-with-lease only when you are sure no one else has pushed important work to main.

Deploy

The PRD targets Vercel. Connect the GitHub repo, use the default Next.js settings, and deploy from main.

License

Private or public as you choose on GitHub; question content is yours to license.

About

Practice causal app built using Next.js. I formulated the questions and then created this via cursor

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages