This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel (or oxc when used in rolldown-vite) for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
The React Compiler is currently not compatible with SWC. See this issue for tracking the progress.
If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the TS template for information on how to integrate TypeScript and typescript-eslint in your project.
Follow these steps to get the local development environment up and running.
-
Clone the repository:
git clone [YOUR-NEW-REPO-URL] cd [repository-name] -
Install dependencies: This project uses
pnpm.pnpm install
-
Run the application:
pnpm run dev
The application will be available at
http://localhost:5173.
This repository is a common frontend for 5 microservices. To allow 5 pairs to work in parallel without conflicts, we follow a strict domain isolation architecture.
The golden rule is: Each pair "owns" their service files, their pages, and their components.
-
src/api/: INFRASTRUCTURE. Contains theaxiosClientthat automatically injects the JWT into all requests.- Rule: Nobody touches this folder. Import and use the client it exports.
-
src/services/: EACH PAIR'S DOMAIN. This is the most important "plot" of land. All communication logic with your backend lives here.- Rule: Each pair creates and maintains their own service file (e.g.,
beatsService.js). Modifying another pair's service file is prohibited.
- Rule: Each pair creates and maintains their own service file (e.g.,
-
src/pages/: EACH PAIR'S DOMAIN. This is where views (full pages) are created. Each page must import data exclusively from theserviceslayer.- Rule: Create your pages and add them to the router in
src/App.jsx.
- Rule: Create your pages and add them to the router in
-
src/components/ui/: SHARED (UI Kit). This is your Shadcn/UI component library.- Rule: It is mandatory to use these components (Button, Input, Card, etc.) to maintain visual consistency. Do not use native HTML tags like
<button>or<input>.
- Rule: It is mandatory to use these components (Button, Input, Card, etc.) to maintain visual consistency. Do not use native HTML tags like
-
src/components/auth-provider.jsx: INFRASTRUCTURE (Owned by Pair 1). This is the global state manager for authentication.- Rule: Nobody (except Pair 1) should touch this file. The rest of the team consumes it via the
useAuth()hook.
- Rule: Nobody (except Pair 1) should touch this file. The rest of the team consumes it via the
- NO direct
fetch()oraxios(): NEVER call an API from a page or component. Always use your file fromsrc/services/.- USE the UI Kit: Don't invent components. Use the ones in
src/components/ui/to keep the app consistent.- DON'T touch another's Service: Respect the "plots". If you need data from another microservice, talk to that pair so they can expose a function in their service for you to import.
- USE GitHub Flow: * The
mainbranch is protected. * Create feature branches frommain(e.g.,feat/P3/upload-beat-page). * Make Pull Requests (PRs) to integrate your changes. * Approval from at least 1 teammate (who is not you) is required to merge.