A full-stack serverless Todo List application leveraging AWS Lambda, DynamoDB, API Gateway,AWS CloudFront AWS Cognito and a React frontend. This project demonstrates a robust CRUD (Create, Read, Update, Delete) workflow using scalable AWS serverless services.
Key Components:
- Frontend: React.js SPA (Single Page Application)
- Integrates with Cognito for user authentication
- Cognito: User authentication, linked to both Frontend and API Gateway for secure access
- API Gateway: RESTful API routing to Lambda functions
- Secured by Cognito authorizer
- Lambda Functions: Stateless compute for CRUD operations
- Uses a shared Lambda Layer for common utilities
- Monitored by CloudWatch for logging and metrics
- DynamoDB: NoSQL database for todos
- CloudFront: CDN for fast delivery, routes traffic to both S3 (static frontend) and API Gateway (backend APIs)
- S3: Static website hosting for the frontend
- CloudWatch: Centralized logging and monitoring for Lambda and API Gateway
- CloudWatch: All Lambda API invocations are logged and monitored for performance and errors
- Cognito: Provides authentication for both the frontend and API Gateway, ensuring secure access to backend APIs
- Create new todos with title, description, and priority
- List all todos
- Edit existing todos
- Delete todos
- Set priority levels (1, 2, 3...)
- Mark todos as completed or pending
- Track creation and update timestamps
Each todo item includes:
todoId: Unique identifier (string/UUID)title: Todo title (required)description: Optional detailspriority: Priority level (integer)completed: Boolean statuscreatedAt: ISO timestampupdatedAt: ISO timestamp
├── Layers/
│ ├── LambdaFunctionsWithLayer/
│ │ ├── post/ # Create todo Lambda
│ │ ├── get/ # Read todos Lambda
│ │ ├── update/ # Update todo Lambda
│ │ └── delete/ # Delete todo Lambda
│ └── nodejs/ # Shared layer code (utilities)
├── frontend/ # React frontend with Cognito auth
└── policy/ # IAM & S3 policies
GET /todo— Fetch all todosGET /todo/{id}— Fetch a specific todoPOST /todo— Create a new todoPUT /todo/{id}— Update an existing todoDELETE /todo/{id}— Delete a todo
- AWS Lambda — Stateless compute for API logic
- Amazon DynamoDB — NoSQL database
- API Gateway — REST API management
- IAM — Security and access control
- Amazon Cognito — Authentication and authorization
- React.js — UI framework
- Vite — Fast build tool
- React Router — SPA routing
- Node.js — Runtime
- AWS SDK v3 — AWS integration
- ESLint — Linting
- AWS Account
- Node.js 18+
- AWS CLI configured
- Create and configure DynamoDB table
- Deploy Lambda functions to AWS
- Set up API Gateway:
- Configure routes for all endpoints
- Enable CORS for frontend access
- Set up Cognito authorizer for protected routes
- Set up Amazon Cognito User Pool and configure authentication (connect to both API Gateway and frontend)
- Configure environment variables for Lambda
- Set up CloudFront distribution to route traffic to both S3 (for static frontend hosting) and API Gateway (for backend APIs)
cd frontend/- Install dependencies:
npm install - Set up environment variables (see
.env.exampleif available), including Cognito configuration - Build the frontend:
npm run build - Upload the contents of the
dist/folder to your S3 bucket - After each update, invalidate the CloudFront cache to reflect changes
- (For local development) Start dev server:
npm run dev
