Demo Todo API#
A simple Todo API built with Express and TypeScript. This repo is designed as a demo for showcasing the Letta Code Action.
Quick Start#
npm install
npm run dev
The API will be running at http://localhost:3000.
Endpoints#
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /health |
Health check | No |
| GET | /todos |
List all todos | Yes |
| GET | /todos/:id |
Get a todo | Yes |
| POST | /todos |
Create a todo | Yes |
| PUT | /todos/:id |
Update a todo | Yes |
| DELETE | /todos/:id |
Delete a todo | Yes |
Authentication#
Protected endpoints require a Bearer token:
curl -H "Authorization: Bearer demo-token-123" http://localhost:3000/todos
Demo with Letta Code Action#
This repo has the Letta Code Action pre-configured. To use it:
- Push this repo to GitHub
- Add
LETTA_API_KEYto your repository secrets - Create an issue and mention
@letta-code
Demo Scenarios#
Try these prompts in GitHub issues:
-
Explain the codebase:
@letta-code can you explain how authentication works in this API?
-
Find a bug:
@letta-code I think there might be a bug in the auth middleware. Can you review it?
-
Add a feature (shows memory persistence):
@letta-code add input validation to the POST /todos endpoint
-
Create a PR:
@letta-code can you create a PR to fix the issues you found?
Project Structure#
src/
├── index.ts # Express app setup
├── routes/
│ └── todos.ts # Todo CRUD routes
├── middleware/
│ └── auth.ts # Auth middleware
└── types/
└── todo.ts # TypeScript types
License#
MIT