Next.js 15 Web Application providing the user interface for managing AI-powered service dispatch, bookings, and customer interactions.
The Frontend is a modern React application built with Next.js 15, Material-UI, and TypeScript, delivering a comprehensive dashboard for managing services, viewing call logs, scheduling appointments, and configuring AI settings.
- Framework: Next.js 15 (App Router)
- UI Library: Material-UI (MUI) v6
- Styling: Emotion (CSS-in-JS), Styled Components
- State Management: Redux Toolkit + RTK Query
- Form Handling: React Hook Form + Zod validation
- Date Management: date-fns, dayjs, react-big-calendar
- HTTP Client: Axios
- Charts: MUI X Charts
- Language: TypeScript 5.8
apps/frontend/
βββ src/
β βββ app/ # Next.js App Router
β β βββ (public)/ # Public pages
β β β βββ landing/ # Landing page
β β β βββ features/ # Features page
β β β βββ products/ # Products page
β β β βββ blogs/ # Blog listing & detail
β β β βββ pricing/ # Pricing page
β β β βββ about/ # About us
β β β βββ login/ # Login page
β β β βββ signup/ # Signup page
β β β βββ terms/ # Terms of service
β β β βββ privacy/ # Privacy policy
β β βββ admin/ # Dashboard pages (protected)
β β β βββ overview/ # Dashboard overview
β β β βββ booking/ # Service bookings
β β β βββ calendar/ # Calendar view
β β β βββ inbox/ # Call logs & transcripts
β β β βββ ai-setup/ # AI phone setup
β β β βββ service-management/ # Services CRUD
β β β βββ settings/ # User settings
β β β βββ billing/ # Billing & subscriptions
β β βββ onboarding/ # User onboarding
β β βββ auth/ # Auth callbacks
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Home page
β βββ components/ # Reusable components
β β βββ layout/ # Layout components
β β β βββ admin-layout/ # Dashboard layout
β β β βββ main-layout/ # Public layout
β β β βββ dashboard-layout/ # Sidebar layout
β β β βββ ...
β β βββ providers/ # Context providers
β β βββ ui/ # UI components
β βββ features/ # Feature modules (RTK slices)
β β βββ auth/ # Authentication
β β βββ subscription/ # Subscriptions
β β βββ service/ # Services
β β βββ calendar/ # Calendar
β β βββ callog/ # Call logs
β β βββ transcript/ # Transcripts
β β βββ settings/ # Settings
β β βββ ...
β βββ redux/ # Redux store
β β βββ store.ts # Store configuration
β βββ types/ # TypeScript types
β βββ lib/ # Utility libraries
β βββ utils/ # Helper functions
βββ public/ # Static assets
β βββ assets/ # Images, icons
β βββ dashboard/ # Dashboard assets
β βββ ...
βββ package.json # Dependencies
βββ next.config.ts # Next.js config
βββ tsconfig.json # TypeScript config
βββ Dockerfile.dev # Development Docker
βββ Dockerfile.uat # UAT Docker
Marketing homepage with hero, features, pricing, testimonials
Detailed feature showcase with comparison table
Product information with FAQ section
Blog listing and detail pages
Subscription plans and features
Authentication pages with Google OAuth
Main dashboard with activity, campaign progress, recent bookings
Components:
- ActivitySection - Recent activity feed
- CampaignProgressSection - Call statistics
- RecentService - Recent service bookings
Service booking management with calendar view
Features:
- Filter bookings by status
- Search bookings
- View booking details
- Manage booking lifecycle
Calendar view of appointments and bookings
Features:
- Monthly, weekly, daily views
- Task cards with status colors
- Task detail modal
- Drag & drop (future)
Call logs, transcripts, and conversation history
Features:
- Filter by date, caller, status
- Search transcripts
- View full conversation
- Transcript chunks modal
- Delete call logs
Phone number configuration for AI assistant
Features:
- Device type selection (Apple/Android)
- QR code setup (instant)
- Manual setup instructions
- Test call functionality
- Troubleshooting guide
CRUD interface for services
Features:
- Create/edit/delete services
- Custom form fields
- Service pricing
- Description & duration
- Grid/card layout
User and company configuration
Sections:
- User Profile - Name, email
- Company Info - Business details
- Greeting Message - Custom AI greeting
- Calendar Integrations - Google/Outlook
- Verification - Phone verification
- Billing Address
Subscription and payment management
Features:
- View current plan
- Upgrade/downgrade plans
- Payment history
- Invoices
- Refund history
Interactive chat-based onboarding
Steps:
- Welcome & introduction
- Business information collection
- Service setup
- Phone number verification
- AI configuration
- Completion
AdminPageLayout: Dashboard page wrapper with title and padding
DashboardLayout: Sidebar navigation layout
MainLayout: Public pages layout with navbar & footer
OnboardingLayout: Onboarding chat interface
AddressAutocomplete: Google Places address autocomplete
StatusChip: Status badges (Confirmed, Cancelled, Done)
ProFeatureModal: Upgrade prompts for premium features
CalendarView: Calendar display with multiple views
TaskCard: Booking/appointment card
DeleteCallLogModal: Confirmation modal
TranscriptionChunksModal: Transcript chunks display
authApi: Authentication endpoints
endpoints: {
login, signup, googleLogin, logout, me
}serviceBookingApi: Service booking endpoints
endpoints: {
getBookings, createBooking, updateBooking, deleteBooking
}calllogApi: Call log endpoints
endpoints: {
getCallLogs, getCallLog, getMetrics
}transcriptApi: Transcript endpoints
endpoints: {
getTranscript, createTranscript, updateTranscript
}calendarApi: Calendar integration
endpoints: {
getAuthUrl, callback, saveToken, getToken
}subscriptionApi: Subscription management
endpoints: {
getSubscription, updateSubscription, getInvoices, getRefunds
}settingsApi: Settings management
endpoints: {
getUser, updateUser, getCompany, updateCompany, verifyPhone
}-
Install dependencies:
cd apps/frontend pnpm installNote: This project uses pnpm as the package manager. If you don't have pnpm installed:
npm install -g pnpm
-
Set up environment:
# Create .env.local NEXT_PUBLIC_API_URL=http://localhost:4000/api NEXT_PUBLIC_AI_URL=http://localhost:8000/api NEXT_PUBLIC_GOOGLE_CLIENT_ID=your_client_id NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=your_maps_key -
Run development server:
pnpm dev
-
Access application:
- Local: http://localhost:3000
pnpm dev # Development server
pnpm build # Production build
pnpm start # Start production server
pnpm lint # Lint with ESLint
pnpm type-check # Type check with TypeScript# Lint
pnpm lint
# Fix linting issues
pnpm lint -- --fix
# Type check
pnpm type-check# Build
docker build -f Dockerfile.dev -t dispatchai-frontend:dev .
# Run
docker run -p 3000:3000 dispatchai-frontend:dev
# Or use docker-compose
docker compose up frontend/- Landing/features- Features/products- Products/blogs- Blog listing/blogs/[id]- Blog detail/pricing- Pricing/about- About us/login- Login/signup- Signup/terms- Terms/privacy- Privacy
/admin/overview- Dashboard/admin/booking- Bookings/admin/calendar- Calendar/admin/inbox- Inbox/admin/ai-setup- AI Setup/admin/service-management- Services/admin/settings- Settings/admin/billing- Billing/onboarding- Onboarding
/auth/callback- OAuth callback
- Login: Email/password or Google OAuth
- Session: JWT stored in HTTP-only cookie
- Guards: Protected routes require valid session
- Refresh: Auto-refresh on API calls
RTK Slice: features/auth/authSlice.ts
API: features/auth/authApi.ts
Hook: useCSRFToken()
Store: src/redux/store.ts
Slices:
authSlice- User authentication statepublicApi- Public API endpointsauthApi- Auth endpointsserviceApi- Service endpointssubscriptionApi- Subscription endpointscalllogApi- Call log endpointstranscriptApi- Transcript endpointscalendarApi- Calendar endpointssettingsApi- Settings endpoints
Persistence: Redux Persist for offline support
Provider: components/providers/ThemeProvider.tsx
Theme Configuration:
- Primary/secondary colors
- Typography scales
- Spacing
- Breakpoints
- Components overrides
Emotion: Primary styling (CSS-in-JS)
Styled Components: Legacy components
SX Prop: Inline styling
Global Styles: src/app/globals.css
Button: components/GoogleOAuthButton.tsx
Config: Environment variables
Redirect: /auth/callback
Component: components/ui/AddressAutocomplete.tsx
Usage: Address autocomplete in forms
API Key: NEXT_PUBLIC_GOOGLE_MAPS_API_KEY
Google Calendar: OAuth flow
Outlook: Microsoft Graph API
UI: app/admin/settings/CalendarIntegrations.tsx
- next: 15.1.7 - Framework
- react: 19.0.0 - UI library
- @mui/material: 6.1.9 - Component library
- @reduxjs/toolkit: 2.8.2 - State management
- axios: 1.9.0 - HTTP client
- react-hook-form: 7.56.4 - Form handling
- zod: 3.25.17 - Schema validation
- @hookform/resolvers: 5.0.1 - Zod resolver
- @mui/icons-material: 6.1.9 - Icons
- @mui/x-charts: 8.9.2 - Charts
- @mui/x-date-pickers: 8.9.0 - Date pickers
- react-big-calendar: 1.19.4 - Calendar
- date-fns: 4.1.0 - Date manipulation
- dayjs: 1.11.13 - Date library
- lodash: 4.17.21 - Utilities
# Run tests (when available)
pnpm test
# Watch mode
pnpm test:watch
# Coverage
pnpm test:coverageFix: Check NEXT_PUBLIC_API_URL and backend service is running
Fix: Verify NEXT_PUBLIC_GOOGLE_CLIENT_ID and redirect URI
Fix: Check NEXT_PUBLIC_GOOGLE_MAPS_API_KEY and billing
Fix: Run pnpm type-check, ensure dependencies match
Fix: Clear .next folder, run pnpm build again
- Next.js Docs: https://nextjs.org/docs
- Material-UI Docs: https://mui.com
- Redux Toolkit: https://redux-toolkit.js.org
- React Hook Form: https://react-hook-form.com
- Zod: https://zod.dev
When adding new features:
- Create feature module in
src/features/ - Add RTK Query endpoints
- Create UI components in
src/components/ - Add pages in
src/app/ - Update navigation/sidebar
- Add TypeScript types
- Test thoroughly
- Update this README