This is the React + Vite frontend for the Fullstack AgentCore Solution Template (FAST). This README focuses on local development setup and workflows.
For full stack deployment instructions, see the top-level README and deployment documentation.
- Node.js (20+ recommended)
- npm
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Start the development server:
npm run dev- Open http://localhost:3000 in your browser
By default, the app uses Cognito authentication. To test this locally:
- First deploy the full stack (see deployment docs)
- Set the redirect URI for local development:
export VITE_COGNITO_REDIRECT_URI=http://localhost:3000
npm run devFor faster local development without needing to deploy Cognito, you can disable authentication:
src/App.tsx
Change this:
export default function App() {
return (
<BrowserRouter>
<AuthProvider>
<AppRoutes />
</AuthProvider>
</BrowserRouter>
)
}To this:
export default function App() {
return (
<BrowserRouter>
<AppRoutes />
</BrowserRouter>
)
}This bypasses all authentication flows and lets you develop the UI directly.
This project uses shadcn/ui for UI components.
Install additional shadcn components as needed:
npx shadcn@latest add calendar
npx shadcn@latest add dialog
npx shadcn@latest add formBrowse the full component library at: https://ui.shadcn.com/docs/components
Popular components include:
- Button, Input, Textarea
- Dialog, Sheet, Popover
- Table, Card, Badge
- Form, Calendar, Select
- And many more...
This project includes Lucide React icons, providing a comprehensive set of beautiful, customizable icons.
Import and use any icon from the Lucide library:
import { Camera } from "lucide-react"
// Usage
const App = () => {
return <Camera color="red" size={48} />
}
export default AppBrowse all available icons at: https://lucide.dev/
Popular icons include Camera, Search, Menu, User, Settings, Download, Upload, and hundreds more.
frontend/
├── src/
│ ├── main.tsx # Application entry point
│ ├── App.tsx # Root component with routing
│ ├── routes/ # Route components
│ ├── components/
│ │ ├── ui/ # shadcn components
│ │ ├── chat/ # Chat UI
│ │ └── auth/ # Authentication components
│ ├── hooks/ # Custom hooks (useToolRenderer)
│ ├── lib/ # Utilities and configurations
│ │ └── agentcore-client/ # AgentCore streaming client, parsers, types
│ ├── services/ # API service layers
│ └── styles/ # Global styles
├── public/ # Static assets
├── index.html # HTML entry point
└── package.json
The application uses Vite environment variables with the VITE_ prefix:
VITE_COGNITO_USER_POOL_ID- Cognito User Pool IDVITE_COGNITO_CLIENT_ID- Cognito Client IDVITE_COGNITO_REGION- AWS RegionVITE_COGNITO_REDIRECT_URI- Redirect URI after authenticationVITE_COGNITO_POST_LOGOUT_REDIRECT_URI- Redirect URI after logout
These can be set in a .env file or as environment variables. The application will fall back to aws-exports.json if environment variables are not set.
npm run dev- Start the Vite development servernpm run build- Build for production (runs TypeScript check + Vite build)npm run preview- Preview the production build locallynpm run lint- Run ESLintnpm run lint:fix- Run ESLint with auto-fixnpm run clean- Clean build artifacts and dependencies
- Hot Reload: Changes auto-reload in the browser with Vite's fast HMR
- TypeScript: Full type safety with strict mode enabled
- Vibe Coding: Optimized for AI-assisted development
- Tailwind CSS: Utility-first styling with Tailwind CSS 4
This stack is designed for AI-assisted development:
- Describe your vision: "Create a document upload component with drag-and-drop"
- Leverage shadcn components: Rich building blocks that AI understands
- Iterate quickly: Make changes and see results instantly
- "Add a file upload component to the chat interface"
- "Create a sidebar with navigation using shadcn components"
- "Build a settings page with form validation"
- "Add a data table with sorting and filtering"
