Building a Serverless Student Management System using AWS Lambda, API Gateway, and DynamoDB
Hey, I'm Computer Scientist with a strong passion for cloud computing and creative writing. I'm writing about Cloud & DevOps for beginners. My goal is to help others through my blogs.
Introduction
In this project, I built a Serverless Student Management System using:
AWS Lambda (for backend logic)
API Gateway (for REST API endpoints)
Amazon DynamoDB (for database)
Amazon S3 & CloudFront (for frontend hosting)
AWS CodePipeline (for CI/CD automation)
Architecture Overview
Frontend → API Gateway → AWS Lambda → DynamoDB
↑
S3 + CloudFrontCloudFront accelerates global delivery of the frontend.Users interact with the frontend hosted on Amazon S3, while CloudFront ensures that the content is delivered quickly and efficiently across the globe. Each action on the web app adding or deleting a student travels through API Gateway, which routes the request to the correct lambda function.
The Lambda function, written in Node.js, serves as the brain of the application. It performs all the backend logic, from handling CORS and validating requests to connecting with DynamoDB, where all student data is securely stored. The frontend of the application is hosted on Amazon S3, which acts as a static web hosting service.The backend logic resides in AWS Lambda, where the function handles these Add, and Delete. Each of these operations communicates directly with DynamoDB using AWS SDK. Lambda’s biggest advantage is that it scales automatically running only when triggered by a request making it cost-effective and efficient. Combined with DynamoDB, it forms a robust data layer that requires zero maintenance.
All functions are connected through API Gateway, which manages endpoints securely and enables CORSto allow communication between the S3 frontend and the backend APIs.
focused on automation. Using AWS CodePipeline, I connected my GitHub repository directly to AWS. This means every time I update my Lambda code or frontend files and push changes to GitHub, the pipeline automatically deploys those updates to AWS.
CodePipeline continuously monitors the repository, fetches the latest commits, builds them (if necessary), and deploys them to the appropriate services S3 for the frontend and Lambda for the backend.
Here, I have written the detailed steps of my project, so you can follow them to create the project.
Step 1: Setting up DynamoDB Table
Set Primary Key: studentid (String).
This table will store all student data.
Step 2: Creating AWS Lambda Function
Open AWS Lambda → Create function.
Runtime: Node.js 18.x
Function name: studentHandler
You can copy the full Lambda code from this repository:
https://github.com/noorkhanzada/serverless-student-management
This code:
Adds a student record (POST)
Deletes a student (DELETE)
Handles CORS properly
Step 3: Connect Lambda with API Gateway
Go to Amazon API Gateway → Create API
Choose REST API
Create a resource named /student
Add methods: POST, DELETE
Integrate each method with your Lambda function
Enable CORS
Deploy the API and copy the Invoke URL
Step 4: Frontend
You can copy the frontend https://github.com/noorkhanzada/serverless-student-management
This is the index.html file hosted on S3, which connects directly to your API Gateway endpoint.
Step 5: Hosting Frontend on AWS S3
In my previous blog, I already explained the complete process of hosting a static website on AWS S3.
Therefore, I’m not repeating the detailed hosting steps here.
Step 6: CI/CD Automation
Use AWS CodePipeline to automate deployment from GitHub.
Configuration:
Source: GitHub repository
Deploy: Lambda / S3
Once the pipeline is configured, every time you push changes to your GitHub repository, AWS automatically deploys the latest version of your project.
Conclusion
With this setup, you have successfully built a fully serverless web application using AWS services with no EC2 instances or manual servers.
The project is scalable, cost-efficient, and automated through CI/CD using CodePipeline.


