Modern React application for the Apex AI-powered project requirements management platform.
| Technology | Purpose |
|---|---|
| React 18 | UI library |
| TypeScript | Type safety |
| Vite | Build tool & dev server |
| React Router 6 | Client-side routing |
| Zustand | State management |
| Tailwind CSS | Utility-first styling |
| Radix UI | Accessible UI primitives |
| Better Auth | Authentication client |
| Lucide React | Icon library |
frontend/
├── src/
│ ├── components/
│ │ ├── ui/ # Reusable UI components (Button, Card, etc.)
│ │ ├── layout/ # Layout components (Sidebar, DashboardLayout)
│ │ ├── signin-form.tsx # Sign in form component
│ │ ├── signup-form.tsx # Sign up form component
│ │ ├── project-card.tsx # Project card display
│ │ ├── document-card.tsx # Document card display
│ │ ├── task-card.tsx # Task card display
│ │ ├── requirement-card.tsx # Requirements display
│ │ ├── file-uploader.tsx # File upload component
│ │ ├── create-task-dialog.tsx # Task creation dialog
│ │ └── typewriter-text.tsx # Animated text effect
│ │
│ ├── pages/
│ │ ├── HomePage.tsx # Landing page
│ │ ├── SignInPage.tsx # Sign in page
│ │ ├── SignUpPage.tsx # Sign up page
│ │ └── dashboard/
│ │ ├── DashboardPage.tsx # Main dashboard
│ │ ├── ProjectsPage.tsx # Projects list
│ │ ├── CreateProjectPage.tsx # Create new project
│ │ ├── DocumentsPage.tsx # Project documents
│ │ ├── RequirementsPage.tsx # Project requirements
│ │ ├── TasksPage.tsx # Project tasks
│ │ ├── ProgressPage.tsx # Project progress
│ │ ├── ChatPage.tsx # AI Q&A chat
│ │ └── ValidationPage.tsx # Validation page
│ │
│ ├── services/
│ │ ├── api.ts # Base API client with auth
│ │ ├── projects.ts # Projects API
│ │ ├── documents.ts # Documents API
│ │ ├── requirements.ts # Requirements API
│ │ ├── tasks.ts # Tasks API
│ │ ├── chat.ts # Chat/assistant API (SSE)
│ │ └── validation.ts # Validation API
│ │
│ ├── stores/
│ │ ├── projectStore.ts # Projects state
│ │ ├── documentStore.ts # Documents state
│ │ ├── requirementStore.ts # Requirements state
│ │ ├── taskStore.ts # Tasks state
│ │ ├── chatStore.ts # Chat messages state
│ │ └── validationStore.ts # Validation state
│ │
│ ├── lib/
│ │ ├── auth-client.ts # Better Auth client setup
│ │ └── utils.ts # Utility functions (cn, etc.)
│ │
│ ├── hooks/
│ │ └── use-mobile.tsx # Mobile detection hook
│ │
│ ├── types/
│ │ └── index.ts # TypeScript type definitions
│ │
│ ├── config/
│ │ └── index.ts # App configuration
│ │
│ ├── styles/
│ │ └── globals.css # Global styles & Tailwind
│ │
│ ├── App.tsx # App root component
│ ├── router.tsx # Route definitions
│ └── index.tsx # Entry point
│
├── public/ # Static assets
├── index.html # HTML template
├── vite.config.ts # Vite configuration
├── tailwind.config.js # Tailwind configuration
├── tsconfig.json # TypeScript configuration
├── components.json # shadcn/ui configuration
└── package.json # Dependencies & scripts
- Node.js 18+
- npm or yarn
# Install dependencies
npm install
# Create environment file
cp .env.example .envCreate a .env file in the frontend directory:
VITE_API_URL=http://localhost:5000# Start development server
npm run devThe application will be available at http://localhost:5173
# Type check and build for production
npm run build
# Preview production build
npm run preview# Run ESLint
npm run lint| Route | Page | Description |
|---|---|---|
/ |
HomePage | Landing page with sign in/up links |
/signin |
SignInPage | User authentication |
/signup |
SignUpPage | User registration |
/dashboard |
DashboardPage | Main dashboard overview |
/dashboard/projects |
ProjectsPage | List all user projects |
/dashboard/projects/new |
CreateProjectPage | Create a new project |
/dashboard/projects/:id/documents |
DocumentsPage | Upload and manage project documents |
/dashboard/projects/:id/requirements |
RequirementsPage | View extracted requirements |
/dashboard/projects/:id/tasks |
TasksPage | Manage project tasks |
/dashboard/projects/:id/progress |
ProgressPage | Track project progress |
/dashboard/projects/:id/chat |
ChatPage | AI-powered Q&A chat |
/dashboard/projects/:id/validation |
ValidationPage | Validation and conflicts |
The app uses Zustand for state management with separate stores for each domain:
projects- List of user projectscurrentProject- Currently selected projectfetchProjects()- Load all projectscreateProject()- Create new projectdeleteProject()- Delete a project
documents- Project documentsuploadDocument()- Upload and process documentdeleteDocument()- Remove document
messages- Chat historystreamingContent- Real-time streaming responseprogressMessage- Processing status messagessendMessage()- Send query to AI assistantfetchHistory()- Load chat history
tasks- Project taskscreateTask()- Create new taskupdateTaskStatus()- Update task status (TODO, IN_PROGRESS, DONE)
Authentication is handled by Better Auth with the React client:
import { authClient, useSession, signIn, signUp, signOut } from '@/lib/auth-client'
// Check session
const { data: session, isPending } = useSession()
// Sign in
await signIn.email({ email, password })
// Sign up
await signUp.email({ email, password, name })
// Sign out
await signOut()All API calls are made through service functions that use a configured fetch wrapper with authentication:
// services/api.ts
export const api = {
get: (url) => fetch(baseURL + url, { credentials: 'include' }),
post: (url, data) => fetch(baseURL + url, {
method: 'POST',
credentials: 'include',
body: JSON.stringify(data)
}),
// ...
}The chat feature uses Server-Sent Events for real-time streaming:
// services/chat.ts
export const sendChatMessage = async (projectId, message, onChunk) => {
const eventSource = new EventSource(`${baseURL}/api/assistant/${projectId}/chat`)
eventSource.onmessage = (event) => {
onChunk(JSON.parse(event.data))
}
}Built with Radix UI primitives and styled with Tailwind CSS:
Button- Primary action buttonsCard- Content containersDialog- Modal dialogsInput- Form inputsBadge- Status indicatorsProgress- Progress barsSidebar- Navigation sidebarAvatar- User avatarsDropdown Menu- Context menusTooltip- Hover tooltips
- Tailwind CSS for utility-first styling
- CSS Variables for theming (light/dark mode support)
- Class Variance Authority (CVA) for component variants
- tailwind-merge for class deduplication
The project includes a vercel.json for easy deployment:
# Install Vercel CLI
npm i -g vercel
# Deploy
vercel# Build the project
npm run build
# The `dist` folder contains the production build
# Deploy to any static hosting service| Script | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run preview |
Preview production build |
npm run lint |
Run ESLint |
ISC License