This project serves as a starter template for building a website agent using ATXP. It uses a TypeScript Express backend and TypeScript React frontend.
Follow the Express + React agent tutorial to build your first ATXP-powered agent.
- 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 text submission and retrieval
- React Frontend: Modern, responsive UI with real-time updates
- Development Mode: Hot reloading for both frontend and backend
- Production Ready: Build system for deployment
- 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/texts- Retrieve all submitted textsPOST /api/texts- Submit new textGET /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