This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
npm install # Install dependencies
npm start # Start dev server on http://localhost:3000
npm run build # Build for production (outputs to /build)
npm run preview # Preview production build
npm test # Run tests once
npm run test:watch # Run tests in watch modeDocker deployment:
docker build -t ethics-net-frontend .
docker run -p 80:80 ethics-net-frontendEthicsNet is a React application for annotating images and videos with ethical considerations. It uses Vite as the build tool.
Global state uses React Context API with hooks (no Redux). The Store.jsx component wraps the app and provides:
IsLogged- Authentication state (synced with localStorage)Loading- Global loading stateNotification- Toast notifications via SonnerImageToSave- Image data being processedVideoInfoContext- Video data being processed
src/globals.jsx exports a configured Axios instance with:
- Bearer token auth from
localStorage.token - Automatic error handling via interceptors
- Base URL switches between localhost (dev) and production server
Uses React Router with HashRouter. Route protection is handled via wrapper components in src/RoutesTypes/index.jsx:
PrivateRoute- RequireslocalStorage.isLogged === 'true'PublicRoute- Optional redirect for logged-in users whenrestricted={true}AdminRoutes- ChecksisAdminflag from API
Uses tss-react/mui (makeStyles) with MUI v7. Each component folder typically has:
index.jsx- Component logicstyle.jsx- ExportsuseStyleshook with component styles
Theme defined in Store.jsx with primary color rgb(49, 54, 57).
Uses Vitest with React Testing Library. Test files use .test.jsx extension. Setup file at src/test/setup.js.