Two terminals needed:
# Terminal 1: Backend (Python 3.12+, auto-creates .venv)
./run-server.sh # http://127.0.0.1:5000
# Terminal 2: Frontend
npm install && npm run dev # http://localhost:5173| Command | Action |
|---|---|
npm run dev |
Start Vite dev server (port 5173) |
npm run build |
Production build |
npm run preview |
Preview production build |
npm run lint |
ESLint on JS/JSX |
python3 app.py |
Start FastAPI directly (port 5000) |
python3 file_handle.py --mode split |
Split dataset into chunks |
python3 file_handle.py --mode merge |
Merge chunk files |
No tests exist in this repo.
- Frontend: Single
App.jsx(833 lines, no component splitting, no router, no state lib — justuseState) - Backend:
app.py— FastAPI with JSON file I/O (no database) - Stack: React 19 + Vite 7 + SWC + Tailwind CSS 4 / FastAPI + Pydantic + Uvicorn
- Vite proxy:
/api→http://127.0.0.1:5000(configured invite.config.js)
- Input:
data/annotated/split_0001.json - Output:
data/checked/split_0001.json data/is in.gitignore
The source dataset (../ViFABSA/data/raw/merged.json per README) must exist for a full run, but the app works with just the annotated split files.
GET /api/config, GET /api/data, POST /api/update, POST /api/update-scope, GET /api/annotated-count, GET /api/no-aspect-count, POST /api/reset-all, GET /api/stats.
annotator_id is read from .env (annotator_id=nguyenquanghuy) or env var. Vite exposes this via import.meta.env.annotator_id (configured with envPrefix: ["VITE_", "annotator_"] in vite.config.js).
Entities with attributes are defined in app.py:ENTITY_ATTRIBUTES (7 entity types). Sentiments: POSITIVE, NEGATIVE, NEUTRAL. Scopes: MICRO, MACRO.
CodeGraphContext MCP server (cgc) is configured in opencode.json for code graph queries. Index the current repo with cgc index . after install. Restart OpenCode after changing MCP config.
- Only
npm run lintfor frontend; no Python linting, typechecking, or CI workflows - No test framework or test files
file_handle.pyhas hardcoded machine-specific paths; update before using.envis not gitignored (contains an annotator ID)- Tailwind CSS 4 uses
@tailwindcss/viteplugin, not PostCSS - ESLint config: flat config (
eslint.config.js) with JS recommended + react-hooks + react-refresh