You are OpenCode, an expert AI developer. Your task is to build the complete frontend for TrustVault, a comprehensive banking and financial management system. The backend (built on Node.js/Express/MongoDB) is already complete with core endpoints for Auth, Accounts, and Transactions.
- Premium Aesthetic Requirement: The frontend MUST feature a world-class, modern, and premium design. Implement glassmorphism, smooth micro-animations, vibrant gradients, and a sleek dark/light mode option. It should feel like a high-end fintech application.
- Batch Implementation Strategy: Do not attempt to write the entire app at once. Implement features step-by-step.
- Continuous Version Control:
⚠️ CRITICAL RULE: Every time you modify or add 8 to 10 files, you MUST commit the changes and push everything to GitHub. Use meaningful commit messages reflecting the batch of work completed. - Use Output Maximization: Use all your advanced capabilities to auto-resolve dependencies, fix linter errors proactively, and configure the project without asking the user for trivial decisions.
- Framework: React with TypeScript (Build with Vite).
- Styling: TailwindCSS with a premium UI library like Shadcn UI or Aceternity UI.
- Animations: Framer Motion for page transitions and interactive elements.
- State Management: Zustand for lightweight global state (auth, user session).
- Routing: React Router DOM (v6+).
- API Communication: Axios with interceptors to handle the JWT session cookies and authorization tokens.
- Create a new project folder named
Frontendin the root (if it doesn't exist) usingnpm create vite@latest Frontend -- --template react-ts. - Install core dependencies: TailwindCSS, React Router, Zustand, Axios, Framer Motion, Lucide-React.
- Set up
tailwind.config.jswith a premium color palette (e.g., deep slate backgrounds, electric blue or emerald primary accents). - Action: Push to GitHub (Commit: "chore: init frontend project and core dependencies").
- Create a reusable
componentsfolder. - Implement base components: Button, Input, Card, Modal, Sidebar, Navbar.
- Ensure all components have hover effects, focus rings, and smooth transitions.
- Action: Push to GitHub if file count threshold is reached.
- Build the
LoginandRegisterpages. - Integrate with backend endpoints (
POST /api/auth/login,POST /api/auth/register). - Design beautiful auth forms with validation and error handling.
- Implement the Zustand store
useAuthStoreto manage user sessions based on the backend JWT response. - Action: Push to GitHub (Commit: "feat: implemented auth flows and state management").
- Build a responsive layout shell: a Sidebar navigation (mobile-friendly hamburger menu) and Topbar with user profile/logout.
- Create the Main Dashboard view showing: Total Balance (aggregated from accounts), Recent Transactions list, and quick action buttons.
- Implement Protected Route wrappers so only authenticated users can view the dashboard.
- Build the Accounts Page: View all accounts, their statuses (ACTIVE/FROZEN/CLOSED), and respective balances (
GET /api/accountsandGET /api/accounts/:accountId/balance). - Build a "Create Account" modal (
POST /api/accounts). - Build the Transfers Page: A sleek form to transfer funds between accounts (
POST /api/transactions). Use idempotency keys under the hood. Include confirmation dialogs. - Action: Push to GitHub (Commit: "feat: dashboard, account management, and transactions UI").
- Add toasts/notifications for successful transfers, logins, and errors.
- Ensure all API calls have loading states (spinners or skeletons).
- Review all responsive breakpoints to ensure mobile perfection.
- Final commit and push to GitHub.
Dear OpenCode: Begin execution from Step 1 immediately. Read the backend's README.md if you need to double-check exact endpoint paths. Do not wait for user input unless absolutely blocked. Remember your GitHub push rule (every 8-10 files)!