An end‑to‑end example that turns a business URL, target audience, and optional logo upload into a ready‑to‑use ad concept. The TypeScript Express backend and React frontend leverage ATXP to:
- Generate ad theme, concise copy, and subreddit targeting via the ATXP LLM Gateway
- Create a square ad image asynchronously using the ATXP Image MCP server
- Persist uploaded logos with the ATXP Filestore MCP server
- Stream live progress updates to the UI over SSE and track per‑call costs
To learn more about the underlying patterns, see the Express + React agent tutorial.
- Node.js (v14 or higher)
- npm or yarn
-
Create a repo using the template.
-
Clone your newly created repo:
git clone git@github.com:your-github-user/your-new-repo cd your-new-repo -
Install all dependencies:
npm run install-all
-
Create an
backend/.envand set theATXP_CONNECTION_STRINGenv var with your connection string from https://accounts.atxp.ai. See the docs for more information on creating an ATXP account.cp backend/env.example backend/.env
-
Start both frontend and backend in development mode:
npm run dev
This will start:
- Backend server on
http://localhost:3001 - Frontend development server on
http://localhost:3000
- Backend server on
-
Open your browser and navigate to
http://localhost:3000
- Backend only:
npm run server - Frontend only:
npm run client
-
Build both frontend and backend for production:
npm run build
-
Start the production server:
npm start
agent-demo/
├── backend/ # Express server
│ ├── server.ts # Main server file (TypeScript)
│ ├── stage.ts # Progress tracking utilities (TypeScript)
│ ├── tsconfig.json # TypeScript configuration
│ ├── package.json # Backend dependencies
│ └── env.example # Environment variables template
├── frontend/ # React application
│ ├── public/ # Static files
│ ├── src/ # React source code
│ │ ├── App.tsx # Main React component (TypeScript)
│ │ ├── App.css # Component styles
│ │ ├── index.tsx # React entry point (TypeScript)
│ │ └── index.css # Global styles
│ ├── tsconfig.json # TypeScript configuration
│ └── package.json # Frontend dependencies
├── package.json # Root package.json with scripts
├── .gitignore # Git ignore rules
└── README.md # This file
- Express Backend: RESTful API with endpoints for form submission and retrieval
- React Frontend: Modern, responsive UI with real-time updates
- Development Mode: Hot reloading for both frontend and backend
- CORS Enabled: Cross-origin requests supported
- Error Handling: Comprehensive error handling and user feedback
npm run dev- Start both frontend and backend in development modenpm run server- Start only the backend server (TypeScript with hot reload)npm run client- Start only the frontend development servernpm run build- Build both frontend and backend for productionnpm run build:backend- Build only the backend TypeScript codenpm run build:frontend- Build only the frontend for productionnpm run install-all- Install dependencies for all packages and build backendnpm start- Start the production server
GET /api/ads- Retrieve all adsPOST /api/ads- Create a new ad (multipart/form-data; fields:businessUrl,targetAudience, optional filelogo)GET /api/progress- Server-Sent Events stream for progress updatesGET /api/health- Health check endpoint
- Express.js - Web framework
- TypeScript - Type-safe JavaScript development
- CORS - Cross-origin resource sharing
- Body Parser - Request body parsing
- Nodemon - Development server with auto-reload
- ts-node - TypeScript execution for development
- React - UI library
- TypeScript - Type-safe JavaScript development
- Axios - HTTP client for API calls
- CSS3 - Modern styling with responsive design
MIT