30-Day Cloud & DevOps Challenge: Day 2 — Building My First Backend API
<p><strong>The journey continues!</strong> After setting up my project structure on Day 1, today was all about building the heart of my microservices platform: the backend API.</p> <p><em>If you missed Day 1, you can catch up here: [<a href="https://dev.to/michellewanjiru/day-1-of-my-30-day-cloud-devops-challenge-project-setup-2a5a?trk=public_post_comment-text">https://dev.to/michellewanjiru/day-1-of-my-30-day-cloud-devops-challenge-project-setup-2a5a?trk=public_post_comment-text</a>]</em></p> <h2> What I Set Out to Do Today </h2> <p>Build a working REST API that can:</p> <ul> <li>Respond to HTTP requests</li> <li>Return JSON data</li> <li>Serve as the foundation for my microservices platform</li> </ul> <p><strong>Simple, right?</strong> Well... let me share how it actually went.</p> <h2>
The journey continues! After setting up my project structure on Day 1, today was all about building the heart of my microservices platform: the backend API.
If you missed Day 1, you can catch up here: [https://dev.to/michellewanjiru/day-1-of-my-30-day-cloud-devops-challenge-project-setup-2a5a?trk=public_post_comment-text]
What I Set Out to Do Today
Build a working REST API that can:
-
Respond to HTTP requests
-
Return JSON data
-
Serve as the foundation for my microservices platform
Simple, right? Well... let me share how it actually went.
The Tech Stack I Chose
I decided to go with Node.js + Express for my backend because:
-
JavaScript is everywhere (frontend, backend, even DevOps tools)
-
Express is lightweight and beginner-friendly
-
I already had Node.js installed on my Ubuntu system
Step-by-Step: What I Actually Did
1. Initial Setup
cd backend npm init -y # Creates package.json npm install express # Web framework npm install --save-dev nodemon # Auto-restarts server on changescd backend npm init -y # Creates package.json npm install express # Web framework npm install --save-dev nodemon # Auto-restarts server on changesEnter fullscreen mode
Exit fullscreen mode
What I learned: package.json is like a shopping list for your project. Every tool you add gets listed there, making it easy to share your project with others.
2. Writing My First Server
I created server.js with three endpoints:
const express = require('express'); const app = express(); const PORT = 8000;const express = require('express'); const app = express(); const PORT = 8000;// Root endpoint app.get('/', (req, res) => { res.json({ message: 'Welcome to the Microservices Platform API', status: 'running' }); });
// Health check endpoint app.get('/health', (req, res) => { res.json({ status: 'healthy', service: 'backend-api', timestamp: new Date().toISOString() }); });
// Users endpoint (mock data for now) app.get('/users', (req, res) => { res.json([ { id: 1, name: 'Alice', email: '[email protected]' }, { id: 2, name: 'Bob', email: '[email protected]' }, { id: 3, name: 'Charlie', email: '[email protected]' } ]); });
app.listen(PORT, () => {
console.log( Server running on http://localhost:${PORT});
});`
Enter fullscreen mode
Exit fullscreen mode
Understanding each part:
-
app.get() defines what happens when someone visits a URL
-
(req, res) => {} is a function that handles the request and sends a response
-
res.json() sends data back as JSON (the language of APIs)
3. The Challenge That Almost Stopped Me
I tried running my server with:
npm run dev
Enter fullscreen mode
Exit fullscreen mode
And got this error:
npm error Missing script: "dev"
Enter fullscreen mode
Exit fullscreen mode
My reaction: 😅 Wait, what? I thought I had this!
How I diagnosed it:
npm run # Shows all available scripts
Enter fullscreen mode
Exit fullscreen mode
Only test was showing. I had completely forgotten to add the "dev" script to my package.json!
The fix: I opened package.json and added:
"scripts": { "start": "node server.js", "dev": "nodemon server.js" }"scripts": { "start": "node server.js", "dev": "nodemon server.js" }Enter fullscreen mode
Exit fullscreen mode
Lesson learned: Never assume your configuration is correct. Always verify with simple commands.
4. The Moment It Finally Worked
After fixing the script, I ran:
npm run dev
Enter fullscreen mode
Exit fullscreen mode
And saw:
Server running on http://localhost:8000
Enter fullscreen mode
Exit fullscreen mode
Then in another terminal:
curl http://localhost:8000/
Enter fullscreen mode
Exit fullscreen mode
Response:
{"message":"Welcome to the Microservices Platform API","status":"running"}
Enter fullscreen mode
Exit fullscreen mode
I literally cheered in my chair.🎉 My first API was alive!
Testing All Endpoints
Here's what each endpoint returned:
Endpoint Response
GET /
Welcome message
GET /health
Service status with timestamp
GET /users
List of 3 mock users
All working perfectly!
Key Learnings from Day 2
Technical Concepts I Gained:
-
HTTP Methods: GET is how you retrieve data from a server
-
JSON: The universal language of APIs — both request and response
-
Ports: Think of them like doors — 8000 is the door my API listens on
-
Endpoints: Specific URLs that do specific things (/health, /users)
-
Package.json scripts: Custom commands to automate repetitive tasks
Problem-Solving Skills:
-
Diagnosing errors: npm run helped me see what was actually available
-
Reading error messages: "Missing script" told me exactly what was wrong
-
Step-by-step verification: Test each piece before assuming everything works
Mindset Shifts:
-
Done is better than perfect: My first API doesn't have a database yet, and that's okay
-
Celebrate small wins: Getting that first curl response was genuinely exciting
-
Embrace mistakes: The missing script error taught me more than if everything worked perfectly
Tips for Anyone Starting Their Own API
-
Start simple. My API only does 3 things right now — that's enough!
-
Test as you go. Don't write 100 lines of code before testing. Test after each endpoint.
-
Use curl or browser. It's satisfying to see your API respond in real-time.
-
Save your package.json changes. I almost forgot this one!
-
Keep notes. Document what you learn, especially the mistakes.
A Quick Thank You
To everyone following along and the community helping me debug, your support means everything. Special shoutout to those who reminded me to check my package.json scripts!
What's Next (Day 3)
Tomorrow, I'm building a frontend that will:
-
Fetch data from my API
-
Display the list of users
-
Show the health status
It's going to be the first time my frontend and backend talk to each other!
Links & Resources
-
GitHub Repository: Production-Ready-Microservices-Platform
-
Express Documentation: expressjs.com
-
Nodemon: nodemon.io
Let's Connect!
Are you also learning backend development? Building your first API? I'd love to hear about your journey!
Drop a comment below or connect with me on LinkedIn at https://www.linkedin.com/in/michelle-wanjiru-420877275/?lipi=urn%3Ali%3Apage%3Ad_flagship3_detail_base%3BHw%2F74ryNQ7CjXqDkL3k7eQ%3D%3D. Let's learn together!
This is Day 2 of my 30-Day Cloud & DevOps Challenge. Follow along as I build a complete microservices platform from scratch!
DEV Community
https://dev.to/michellewanjiru/30-day-cloud-devops-challenge-day-2-building-my-first-backend-api-2ed5Sign in to highlight and annotate this article

Conversation starters
Daily AI Digest
Get the top 5 AI stories delivered to your inbox every morning.
More about
availableproductplatformPenguin Ai Launches Gwen, a Build-Your-Own AI Platform for Healthcare Operations - PR Newswire
<a href="https://news.google.com/rss/articles/CBMi0AFBVV95cUxQWGI4amcyQlBxRmlLNTMzMUNwdUdDejhReXdKQ1EwZzhleUdDRnh5cDdkWU16NnV2ZXdRTThQT1VmMDJxVWttQTdzVWRRX2VOdFJCWERRWHJBaFFfSWhOejI1NVFjODhtRXVCUGpNby1HcmFqR2sybEhRYnZFQXFKME04eEp4cU41b2xxcGZ5X0VpeE10eTd6SEhZR3QxY25xYk9Na1BENlQyZG93QnBzWS01TVE5c1MtdWt1NXBIYWtHektUZWY4c1ZxYjdFYk8w?oc=5" target="_blank">Penguin Ai Launches Gwen, a Build-Your-Own AI Platform for Healthcare Operations</a> <font color="#6f6f6f">PR Newswire</font>
Anthropic Responsible Scaling Policy v3: A Matter of Trust
Anthropic has revised its Responsible Scaling Policy to v3. The changes involved include abandoning many previous commitments, including one not to move ahead if doing so would be dangerous, citing that given competition they feel blindly following such a principle would not make the world safer. Holden Karnofsky advocated for the changes. He maintains that the previous strategy of specific commitments was in error, and instead endorses the new strategy of having aspirational goals. He was not at Anthropic when the commitments were made. My response to this will be two parts. Today’s post talks about considerations around Anthropic going back on its previous commitments, including asking to what extent Anthropic broke promises or benefited from people reacting to those promises, and how we
March 2026 Links
Why We Have Prison Gangs : Q&A whose ultimate answer is that gangs are a form of governance in a place that has little. Skarbek also talks about what being in a gang is like, rules they have in place (bedtime, taxes, no affiliating with sex offenders or former LEOs), similarities. Plane Crash : Delian gives a play-by-play of his plane engine cutting off mid-flight, culminating in him crash landing on a golf course. The lessons learned extended elsewhere, namely where else did he simply say "I'll do it later", when later wasn't guaranteed? Sirat is not about the end of the world : A great perspective on Sirat that contains spoilers. Everything you ever wanted to know about Roblox, but were afraid to ask a 12-year-old Maybe there's a pattern here? : Technology, no matter what its original pu
Knowledge Map
Connected Articles — Knowledge Graph
This article is connected to other articles through shared AI topics and tags.
More in Products
Beyond the Hype: A Practical Guide to Integrating AI into Your Development Workflow
<h2> The AI Tidal Wave: Are You Building Boats or Waiting for the Tsunami? </h2> <p>Another week, another flood of "Will AI Replace Developers?" articles. While that existential debate rages, a quiet revolution is already underway in the trenches. The real question isn't about replacement; it's about <strong>augmentation</strong>. How can you, as a developer, harness AI tools today to write better code, solve complex problems faster, and free up your mental bandwidth for truly creative engineering?</p> <p>This guide moves past the hype. We'll explore practical, actionable strategies for integrating AI into your daily development workflow, complete with code examples and real-world use cases. Let's stop speculating about the future and start building it.</p> <h2> The AI Toolbox: More Than J
Why LLM orchestration is broken (and how cryptographic agent identities fix it)
<p>Last week, a “helpful” coding agent opened a PR, commented on the issue, triggered CI, and then tried to deploy to staging.</p> <p>The weird part? Nobody could answer a basic question:</p> <p><strong>What rights did that agent actually have, and who gave them?</strong></p> <p>Not “which API key did it use.”<br> Not “which workflow ran.”<br> Not even “which model generated the output.”</p> <p>I mean: <strong>which agent</strong> took the action, <strong>what it was allowed to do</strong>, and <strong>whether that authority was delegated intentionally</strong>.</p> <p>That’s the orchestration rights problem, and it’s getting worse as teams wire up Claude, Cursor, Copilot, Devin, internal bots, MCP servers, GitHub Actions, and homegrown tools into one giant autonomous spaghetti pile.</p> <
Scan Any Document to a Searchable PDF — For Free, Right in Your Browser
<p>If you've ever had a printed contract, a handwritten note, or a physical receipt that you desperately needed as a PDF — and found yourself wrestling with apps that either upload your files to some random server, slap a watermark on the result, or charge you after three free scans — you know the frustration.<br> There's a better way. And it runs entirely in your browser.</p> <p>What DocScan Actually Does<br> DocScan is a browser-based document scanner. You open it, point your phone or laptop camera at a piece of paper, and it spits out a clean, flat, searchable PDF — with no account required, no file ever leaving your device, and absolutely no watermark.<br> It's the kind of tool that should have always existed. Here's what happens under the hood when you hit that shutter button.</p> <p>
Scan Any Document to a Searchable PDF For Free, Right in Your Browser
<p>If you've ever had a printed contract, a handwritten note, or a physical receipt that you desperately needed as a PDF — and found yourself wrestling with apps that either upload your files to some random server, slap a watermark on the result, or charge you after three free scans — you know the frustration.<br> There's a better way. It's called ihatepdf.cv, and it runs entirely in your browser.</p> <p>What ihatepdf.cv Actually Does<br> ihatepdf.cv is a free browser-based document scanner. You open it, point your phone or laptop camera at a piece of paper, and it spits out a clean, flat, searchable PDF — with no account required, no file ever leaving your device, and absolutely no watermark.<br> It's the kind of tool that should have always existed. Here's what happens under the hood whe

Discussion
Sign in to join the discussion
No comments yet — be the first to share your thoughts!