A modern, responsive frontend for the Marketing Tool built with Next.js 13+ and TypeScript, optimized for Vercel deployment.
- 🚀 Next.js 13+ App Router - Latest Next.js features with App Router
- 🎨 Modern UI - Built with Material UI (MUI) components and a custom warm dark design system
- 📱 Responsive Design - Works on desktop, tablet, and mobile
- 🔄 Real-time Updates - Live pipeline monitoring and status updates
- 📊 Content Management - Upload, view, delete, and manage marketing content
- ⚡ Pipeline Control - Run and monitor marketing pipelines
- 🔍 Content Analysis - Analyze content for marketing potential
- 🎯 TypeScript - Full type safety throughout the application
- Framework: Next.js 13+ with App Router
- Language: TypeScript
- Styling: Material UI (MUI) with custom design system (see DESIGN.md)
- UI Components: MUI + custom components
- State Management: TanStack Query (React Query)
- HTTP Client: Axios
- Icons: MUI Icons
- Deployment: Vercel
- Node.js 18+
- npm or yarn
- Backend API running (see main marketing-tool repository)
- Clone the repository:
git clone <repository-url>
cd marketing-frontend- Install dependencies:
npm install- Set up environment variables:
cp env.example .env.local- Update
.env.localwith your configuration:
# Backend API Configuration
NEXT_PUBLIC_BACKEND_API_BASE_URL=http://localhost:8000
NEXT_PUBLIC_BACKEND_WEBSOCKET_URL=ws://localhost:8000
# Keycloak Frontend Configuration (REQUIRED for authentication)
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-nextauth-secret-here # Generate with: openssl rand -base64 32
KEYCLOAK_CLIENT_ID=marketing-tool-frontend
KEYCLOAK_CLIENT_SECRET=your-frontend-client-secret
KEYCLOAK_ISSUER=https://your-keycloak-server.com/realms/your-realm-nameImportant: Generate a secure NEXTAUTH_SECRET:
openssl rand -base64 32- Start the development server:
npm run dev- Open http://localhost:3000 in your browser.
| Variable | Description | Example |
|---|---|---|
NEXT_PUBLIC_BACKEND_API_BASE_URL |
Backend API URL | http://localhost:8000 |
NEXT_PUBLIC_BACKEND_WEBSOCKET_URL |
WebSocket URL for real-time updates | ws://localhost:8000 |
NEXTAUTH_URL |
Base URL of your application | http://localhost:3000 |
NEXTAUTH_SECRET |
Secret for encrypting JWT tokens | Generate with openssl rand -base64 32 |
KEYCLOAK_CLIENT_ID |
Keycloak frontend client ID | marketing-tool-frontend |
KEYCLOAK_CLIENT_SECRET |
Keycloak frontend client secret | Get from Keycloak admin console |
KEYCLOAK_ISSUER |
Keycloak issuer URL | https://your-keycloak-server.com/realms/your-realm |
| Variable | Description | Default |
|---|---|---|
NEXT_PUBLIC_API_KEY |
API key for authentication (if not using Keycloak) | - |
- Follow the Keycloak Setup Guide in the backend repository
- Create a frontend client in Keycloak (public client)
- Copy the client ID and secret to your
.env.localfile - Set
KEYCLOAK_ISSUERto your Keycloak realm URL
src/
├── app/ # Next.js App Router pages
│ ├── content/ # Content management pages
│ ├── pipeline/ # Pipeline management pages
│ ├── layout.tsx # Root layout
│ └── page.tsx # Dashboard page
├── components/ # React components
│ ├── ui/ # Base UI components
│ ├── layout/ # Layout components
│ ├── content/ # Content-specific components
│ └── pipeline/ # Pipeline-specific components
├── hooks/ # Custom React hooks
├── lib/ # Utilities and configurations
├── types/ # TypeScript type definitions
└── styles/ # Additional styles
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpm run type-check- Run TypeScript type checking
- Push your code to GitHub
- Connect your repository to Vercel
- Set environment variables in Vercel dashboard
- Deploy automatically on every push
- Build the project:
npm run build- Deploy the
outdirectory to your hosting provider
The frontend integrates with the Marketing Tool backend API using a function-based pipeline architecture:
- Health Checks:
/api/v1/health,/api/v1/ready - Content Analysis:
/api/v1/analyze - Pipeline Execution:
/api/v1/pipeline(auto-routes to appropriate processor)
- Blog Processing:
/api/v1/process/blog - Transcript Processing:
/api/v1/process/transcript - Release Notes Processing:
/api/v1/process/release-notes
- Content Sources:
/api/v1/content-sources/* - Job Management:
/api/v1/jobs/* - Approvals:
/api/v1/approvals/* - File Upload:
/api/v1/upload
The backend uses a 7-step function-calling pipeline with OpenAI structured outputs for:
- ✅ Guaranteed JSON output
- ⚡ Faster execution (20% faster than legacy agents)
- 💰 Lower costs (10% cheaper)
- 🎯 Full type safety with Pydantic models
- 📊 Quality metrics (confidence scores, SEO scores, readability scores)
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.