
Weekend Productivity Challenge: MoodSpark — Turn Your Mood Into Creative Momentum
MoodSpark is a personal AI-powered productivity companion that turns your current mood or thoughts into a creative spark. Built with AWS serverless services, it helps reduce the friction of getting started by transforming emotional context into something motivating, expressive, and actionable.
Vision & What MoodSpark Does
Productivity is not always about managing tasks, calendars, or to-do lists. Sometimes the hardest part is simply getting started.
MoodSpark was created around this idea: a person's emotional state can affect their ability to begin a task, express an idea, or regain momentum. Instead of asking users to organize their thoughts into a complicated workflow, MoodSpark provides a simple creative starting point.
The user describes what is on their mind, chooses a creative format, and receives a short creative "Spark" based on that input.
MoodSpark currently supports six formats:
- Poem
- Short Story
- Meme Caption
- Rap Verse
- Image Prompt
- Motivational Quote
The experience is intentionally simple:
Mood or thought → Creative Spark → Momentum
The goal is not to replace a traditional productivity application. MoodSpark focuses on a smaller part of productivity: helping users overcome the friction of getting started.
For example, someone returning home after a difficult day could enter their mood and choose "Poem." Instead of staring at a blank page, they immediately receive something they can read, share, develop further, or simply use as a small positive reset.
MoodSpark turns a moment of emotional friction into a small creative starting point.
How I Built It
I built MoodSpark as a lightweight full-stack web application using a React and Vite frontend with a serverless AWS backend.
The project is organized as a monorepo with separate frontend, backend, and infrastructure directories.
The frontend provides the user interface, including the mood input, creative-format selection, loading state, error handling, and generated-result display.
The backend is implemented as an AWS Lambda function. It receives the user's request, validates the input, generates the requested creative content, and returns a JSON response to the frontend.
I used AWS SAM (Serverless Application Model) to define and deploy the backend infrastructure. This made the deployment reproducible and allowed me to validate the infrastructure configuration before deploying it to AWS.
The Lambda function is exposed through a Lambda Function URL, which provides an HTTPS endpoint that the React application can call directly.
For the frontend deployment, I connected the GitHub repository to AWS Amplify Hosting. Amplify builds the Vite application from the frontend directory and publishes the generated dist directory.
The production frontend uses the VITE_API_URL environment variable so that the browser knows which Lambda Function URL to call.
AWS Architecture
The final architecture is intentionally simple and serverless:
GitHub → AWS Amplify Hosting → React/Vite frontend → Lambda Function URL → AWS Lambda → Creative Engine → JSON response → MoodSpark UI
The frontend is hosted by AWS Amplify and deployed automatically from the GitHub repository.
When a user creates a Spark, the frontend sends an HTTPS POST request to the Lambda Function URL.
AWS Lambda processes the request without requiring a continuously running server. The function validates the request and generates the selected creative format.
The result is returned as JSON and displayed immediately in the browser.
This architecture keeps the application small while still demonstrating a real cloud-hosted frontend, a serverless backend, infrastructure as code, and an API connection between the two.
AWS Services Used
AWS Amplify Hosting
AWS Amplify hosts the MoodSpark frontend and connects directly to the GitHub repository.
The application is configured as a monorepo, with the frontend located in the frontend directory. Amplify runs the frontend build command and deploys the resulting dist directory.
This provides a simple continuous deployment workflow for the web application.
AWS Lambda
AWS Lambda powers the MoodSpark backend.
The Lambda function validates incoming requests and generates the requested creative response. Because Lambda is serverless, there is no server infrastructure that I need to maintain or keep running.
Lambda Function URL
The Lambda Function URL provides the HTTPS endpoint used by the frontend.
This was a deliberate simplicity decision. For a small application like MoodSpark, a direct Lambda Function URL avoids adding unnecessary API infrastructure while still providing a secure HTTPS interface.
AWS SAM
AWS Serverless Application Model is used to define the Lambda infrastructure as code.
The SAM template defines the Lambda function, runtime, environment variables, Function URL configuration, permissions, and application outputs.
I used SAM validation and deployment commands to verify and deploy the infrastructure.
Challenges I Faced
One of the most useful parts of the project was debugging the connection between the browser and the serverless backend.
The Lambda function initially worked correctly when tested directly with curl, but the browser reported a CORS error because the Access-Control-Allow-Origin header was being returned more than once.
The issue came from configuring CORS both in the Lambda response and in the Lambda Function URL configuration.
I simplified the implementation so that the Function URL handled the browser CORS configuration while the Lambda response focused on returning the application JSON.
After rebuilding and redeploying the SAM stack, the frontend was able to communicate with Lambda successfully.
Another challenge was validating the SAM infrastructure. An initial CORS configuration used an invalid HTTP method value, causing SAM lint validation to fail. I corrected the configuration and confirmed that the template passed sam validate --lint before deploying it.
I also tested the deployed Lambda endpoint independently with curl before connecting it to the production frontend. This helped separate backend problems from frontend problems during debugging.
What I Learned
This project taught me that a complete web application does not necessarily require a large backend architecture.
Using AWS Amplify and AWS Lambda allowed me to build a complete frontend-to-backend workflow with very little infrastructure to maintain.
I learned how to:
- Deploy a React/Vite application using AWS Amplify.
- Connect Amplify to a GitHub repository.
- Configure a monorepo frontend correctly.
- Build and deploy AWS Lambda using AWS SAM.
- Expose Lambda through a Function URL.
- Configure CORS for browser-to-Lambda communication.
- Use environment variables to connect frontend and backend environments.
- Test a deployed serverless API independently using curl.
- Debug browser network and CORS errors.
- Treat infrastructure as code instead of configuring everything manually.
The biggest lesson was that debugging cloud applications requires testing each layer independently. Testing Lambda with curl first made it much easier to identify that the later browser issue was a CORS configuration problem rather than a backend failure.
Live Demo and Source Code
The MoodSpark application is deployed using AWS Amplify and its backend is running on AWS Lambda.
Live application:
Source code:
The repository contains the frontend, backend, tests, and AWS SAM infrastructure used to deploy the application.
Future Improvements
The next version of MoodSpark could expand the creative engine with a managed generative AI service such as Amazon Bedrock, allowing the application to produce more context-aware and personalized creative responses.
Additional improvements could include conversation history, personalized creative preferences, richer mood analysis, and optional integrations with productivity workflows.
The current version intentionally keeps the architecture small so that the core experience remains fast, understandable, and inexpensive to operate.
Conclusion
MoodSpark started from a simple question: what if a person's current mood could become the beginning of something productive?
The result is a small serverless application that turns a user's thoughts into a creative Spark through a simple interaction.
By combining GitHub, AWS Amplify, AWS Lambda, Lambda Function URLs, and AWS SAM, I was able to build, deploy, and connect a complete cloud application while keeping the architecture straightforward.
For me, the most important part of the project is not the generated poem, story, caption, or quote itself. It is the idea behind the interaction: sometimes productivity begins with a very small spark.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article