A minimal React + Express example showing how to use the useChat hook with dedalus-react.
-
Install dependencies:
pnpm install
-
Create environment file:
cp .env.example .env
-
Add your Dedalus API key to
.env:DEDALUS_API_KEY=your-api-key-here -
Run both the server and client:
pnpm start
Or run them separately:
# Terminal 1 - Express server pnpm run server # Terminal 2 - Vite dev server pnpm run dev
-
Open http://localhost:5173 in your browser.
react-express-simple/
├── App.tsx # Chat UI component
├── main.tsx # React entry point
├── index.html # HTML template
├── server.ts # Express server with chat endpoint
├── .env.example
├── package.json
├── tsconfig.json
└── vite.config.ts