Customer Feedback Management System

Serverless Feedback Collection with AWS & MongoDB

Anwer Sadath Abdul Muttaliff | buildcloudwithanwer.co.uk

Project Overview

Problem Statement

Businesses struggle with efficiently collecting and analyzing customer feedback. Data is often scattered, making meaningful insights difficult to extract.

Solution

We created a serverless feedback management system enabling businesses to:

Architecture & Resources

Customer Feedback System Architecture

Architecture diagram showing the serverless feedback collection flow

Technologies Used

API Gateway

Exposes REST API endpoints for feedback submission

AWS

AWS Lambda

Processes requests & interacts with MongoDB

AWS

MongoDB Atlas

Stores customer feedback securely

MongoDB

React Frontend

User-friendly feedback submission form

React

Implementation Stages

Stage Resource Used Purpose
API Definition API Gateway Create REST endpoints (POST/GET /feedback)
Data Processing AWS Lambda Handle requests and database operations
Data Storage MongoDB Atlas Persist feedback documents
User Interface React (Vite) Web form for feedback submission

Technical Implementation

Lambda Function Code

feedbackHandler.js
const { MongoClient } = require('mongodb');
const uri = process.env.MONGODB_URI;

exports.handler = async (event) => {
    const client = new MongoClient(uri);
    
    try {
        await client.connect();
        const collection = client.db("feedbackDB").collection("feedback");
        
        if (event.httpMethod === 'POST') {
            const feedback = JSON.parse(event.body);
            await collection.insertOne(feedback);
            return { statusCode: 201, body: 'Feedback saved' };
        }
        
        if (event.httpMethod === 'GET') {
            const feedback = await collection.find().toArray();
            return { statusCode: 200, body: JSON.stringify(feedback) };
        }
        
    } finally {
        await client.close();
    }
};

System Screenshots

Key Benefits

Serverless

No infrastructure to manage, scales automatically

Secure

HTTPS encryption, IAM permissions, MongoDB network restrictions

Cost-effective

Pay-per-use pricing with free tiers available

Flexible

NoSQL database accommodates varied feedback structures

Troubleshooting Guide

Issue Solution
"Missing Authentication Token" error Ensure API is properly deployed and endpoint is correct
Lambda KeyError for 'httpMethod' Enable Proxy Integration or add Mapping Template
Feedback not storing in MongoDB Verify connection string and network access rules
React frontend fails to start Use Node.js 18+, reinstall dependencies if needed

Future Enhancements

Back to Top Back to Home