🚀 Learning System Design by Building a URL Shortener Today I worked on building a full-stack URL Shortener to understand how real-world systems are designed and scaled. What the backend is doing: Accepts a long URL and generates a unique short code Stores the mapping in MongoDB Redirects users from short URL → original URL Tracks total clicks for each shortened link Exposes a simple analytics endpoint for URL stats Handles duplicate URLs and validates input properly Tech Stack: Frontend: Next.js, Tailwind CSS Backend: Node.js, Express.js Database: MongoDB Atlas Deployment: Vercel + Render This project helped me understand concepts like: API design Routing and controllers Database schema design URL mapping logic Analytics tracking Deployment and production debugging 🔗 Live Demo: https://lnkd.in/g_qd-WB7 💻 Source Code: https://lnkd.in/g7Kp865n Still learning and improving it step by step ⚡ Would love to hear what features you’d add next! #SystemDesign #FullStackDevelopment #WebDevelopment #Nodejs #Nextjs #MongoDB #SoftwareEngineer #BuildInPublic #BackendDevelopment #100DaysOfCode
Building a URL Shortener with Node.js and MongoDB
More Relevant Posts
-
🚀 **Day Progress: Building a Full-Stack Blog API (Node.js + MongoDB)** Today was all about strengthening my backend skills by working on a **Comment System** with real-world logic and security 🔐 💡 Here’s what I built & learned: ✅ Created **Comment API** (Add Comment to a Post) ✅ Understood how to link data using **MongoDB ObjectId (post ↔ comment ↔ user)** ✅ Implemented **JWT Authentication** (secure user identity) ✅ Learned why **userId should never come from frontend** (security best practice) ✅ Debugged real errors like: * `Comment.create is not a function` * `Cannot access 'post' before initialization` * `commentId undefined` 🔥 Built **Delete Comment API** with proper logic: * Check if comment exists * Verify logged-in user * Allow delete **only by owner** 🧠 Key Concepts I Mastered: * req.params vs req.body * Middleware vs Controller responsibilities * Authentication flow (JWT → req.user) * Database relationships using Mongoose * Debugging like a developer 💪 🚀 Feeling more confident in backend development and API design! Next Step 👉 Building: ➡️ Get Comments API with populate (username + profile) ➡️ Frontend integration #NodeJS #MongoDB #BackendDevelopment #WebDevelopment #JWT #API #CodingJourney #LearningInPublic
To view or add a comment, sign in
-
-
🚀 Built & Deployed a Full-Stack MERN Application Excited to share a project where I implemented a complete full-stack workflow — from backend APIs to database integration and live deployment. 🔗 Live Project: https://lnkd.in/gBUxUcma 💻 GitHub: https://lnkd.in/gwvkjTvM 💡 Project Overview: This is a full-stack application where I built a backend server, connected it with a MongoDB database, and deployed it to a live environment. ⚙️ Tech Stack: Node.js Express.js MongoDB (Database) Mongoose (ODM) REST APIs Render (Deployment) 🔥 Key Features: CRUD operations with MongoDB Structured API routes following REST principles Database schema design using Mongoose Full backend deployment on cloud Error handling and async operations 📚 What I Learned: How to connect and manage MongoDB in a real project Writing clean and scalable backend architecture Handling async operations and API responses Real-world deployment challenges (env variables, server configs, cold starts) ⚠️ Challenges Faced: Debugging deployment issues on Render Managing database connection in production Handling API errors properly 🎯 What’s Next: Add authentication (JWT) Build a proper frontend UI Convert this into a complete production-ready SaaS-style project This project helped me move from “just coding” → “building real-world deployable systems”. Thanks to Ankur Prajapati and Sheryians Coding School Would appreciate your feedback 🙌 #MERN #MongoDB #NodeJS #ExpressJS #FullStackDevelopment #WebDevelopment #LearningInPublic
To view or add a comment, sign in
-
🚀 Day 53–71: The Phase Where Everything Started Making Sense Until now, I was writing code… But in these days, I finally understood how real applications actually work behind the scenes. 👨🏫 Thanks to Siva Kumar Sir at DevGnan for guiding us step by step. 💭 What changed in these days? I moved from just frontend thinking → to understanding the complete flow of an application From clicking a button… to knowing where that data goes, how it travels, and where it gets stored. 🧠 Concepts I Explored ⚡ How backend works using Node.js ⚡ Building servers with Express.js ⚡ Sending responses from backend ⚡ Connecting frontend to backend (real communication) ⚡ Introduction to MongoDB ⚡ Using Mongoose to structure and store data 🔥 What I Built Instead of just learning theory, I implemented a real signup system ✔️ User enters details in frontend ✔️ Data travels through API ✔️ Backend handles it properly ✔️ Database stores it successfully 👉 For the first time, I felt like I built something real, not just practice code. 🔄 The Flow I Now Understand Clearly Frontend → Request → Server → Database → Stored Data Simple line… but powerful understanding 💡 📌 Big Realization Backend is not just code. It’s the brain of the application. And once you understand the flow, everything starts connecting. This phase gave me a lot of confidence. Now I’m not just learning… I’m building with understanding 🚀 #MERNStack #BackendDevelopment #NodeJS #ExpressJS #MongoDB #CodingJourney #FullStackDeveloper
To view or add a comment, sign in
-
Most APIs don’t fail when you build them. They fail when people actually start using them. Here’s the reality: An API that works for 10 users is completely different from one that handles 10,000. At small scale, everything looks perfect: • Fast responses • Quick database queries • No visible errors You ship it with confidence. Then traffic grows… And things start breaking. • Requests slow down • Database gets overloaded • Timeouts appear • Response times increase Nothing changed in your code. But everything changed in your load. This is where most APIs fail. Not because they were built poorly… But because they were only built to work — not built to scale. Here’s what usually goes wrong: • Too many API calls from the frontend • Repeated data fetching • No pagination or filtering • Inefficient database queries Good APIs at scale focus on: • Caching → reduce database load • Efficient queries → avoid repeated work • Rate limiting → protect the system • Pagination → control data flow • Clean API design → fewer, smarter requests The mindset shift: Stop asking → “Does it work?” Start asking → “Will it still work under pressure?” 💬 What’s one scaling issue you’ve faced in your projects? #MERN #NodeJS #MongoDB #ReactJS #ExpressJS #BackendDevelopment #WebDevelopment #API #CleanCode #CodeArchitecture #SystemDesign #JavaScript #FullStackDevelopment #SoftwareEngineering
To view or add a comment, sign in
-
-
🚀 Backend Learning Log #13 — vidTube Today, I worked on building the “Get All Videos” API for my vidTube backend. 🛠️ What I implemented: • Pagination (page & limit) for efficient data loading • Search functionality using regex (title & description) • Filtering videos by user (owner-based filtering) • Sorting (by createdAt with asc/desc control) • Calculated total videos count for better frontend handling Adding pagination, filtering, and search makes the API production-ready and frontend-friendly. 🔗 GitHub Repository: https://lnkd.in/g79x35ZC Tech stack: Node.js • Express.js • MongoDB • Mongoose #BackendDevelopment #NodeJS #ExpressJS #MongoDB #API #WebDevelopment #BuildInPublic
To view or add a comment, sign in
-
-
Scaling to Millions: Why Database Indexing is a Senior Dev’s Secret Weapon ⚡🗄️Your Frontend can be a masterpiece, but if your database takes 5 seconds to respond, your users are gone. At Codings First, we don't just "fetch data"—we architect how it travels.As we scale complex MERN applications, Database Optimization becomes the difference between a smooth UX and a total system bottleneck.My Top 3 Optimization Rules for 2026:Smart Indexing (The Library Method): A database without indexes is like a library without a catalog—you have to read every book to find one title. Proper indexing turns an $O(n)$ collection scan into a lightning-fast $O(\log n)$ index hit.The Power of Aggregation Pipelines: Instead of pulling 10,000 documents to the Frontend and filtering them in JavaScript (a junior mistake!), we use MongoDB Aggregation Framework. Filter, sort, and group data directly on the server to send only the final "result" over the wire.Compound Indexes for Complex Queries: If you frequently filter by userId AND status, a compound index is mandatory. It reduces memory usage and keeps CPU cycles low during peak traffic.In my final year of Software Engineering, I’m constantly reminded: Speed is a feature, and Optimization is a responsibility.How do you handle heavy data? Are you a fan of pre-indexing everything, or do you wait for the logs to tell you where the bottlenecks are? Let's talk data! 👇 #MongoDB #NodeJS #DatabaseOptimization #BackendPerformance #SeniorDeveloper #SoftwareEngineering #MERNStack #Scalability #CleanCode #CodingsFirst
To view or add a comment, sign in
-
-
A client called me at 10am. "The dashboard is freezing. Users are leaving." I'd built the thing 3 months earlier. Proud of it, honestly. I opened the queries. Raw .find({}) on collections with 50k+ documents. No indexes. No projection. Just pulling everything and filtering in JavaScript like some kind of monster. That was me. I wrote that. 48 hours later — compound indexes on the hot fields, $match early in every pipeline, .lean() on read-heavy routes, .select() stripping fields nobody needed. Query time: 1.8 seconds → 280ms. 40% performance gain. Zero infrastructure changes. The database wasn't slow. I just didn't know how to ask it things properly. Before you pay for more RAM or spin up another replica — read your queries. Actually read them. Something dumb is probably in there, and it was probably you who wrote it. (It was definitely me.) #MERN #MongoDB #FullStackDeveloper #NodeJS #BackendDevelopment
To view or add a comment, sign in
-
Day 65-71 of My MERN Stack Journey at DevGnan Under the guidance of Siva Kumar Sir Today Class is Complete Signup Flow: Frontend → Backend → Database (MongoDB) Ever wondered how real applications store user data from frontend forms into a database? This week, I built a complete backend integration flow using MERN Stack What I Implemented 1️⃣ Setup Express Server & CORS Enabled smooth communication between frontend and backend 2️⃣ Connected MongoDB using Mongoose Ensured database connection is successful before handling requests 3️⃣ Created .env Configuration Stored sensitive data like PORT & MONGO_URI securely using dotenv 4️⃣ Designed User Schema & Model Defined required fields and validation rules 5️⃣ Built Database Config (db.js) Centralized MongoDB connection logic 6️⃣ Created Signup API (POST) Handled user registration using req.body 7️⃣ Connected Frontend using Axios Sent form data from React to backend 8️⃣ Stored Data in MongoDB Successfully created my first user document 🔄 Flow Summary User fills form ➡️ Axios POST request ➡️ Express API ➡️ Mongoose Model ➡️ MongoDB Storage Key Learnings Backend is the backbone of real-world apps Environment variables are crucial for security Understanding full flow > just writing code API integration builds real developer confidence Result 👉 My first end-to-end working MERN feature is live ✅ ReadMe File: https://lnkd.in/ggmf8hA6 #MERNStack #MongoDB #ExpressJS #ReactJS #NodeJS #BackendDevelopment #WebDevelopment #LearningJourney #SoftwareEngineer
To view or add a comment, sign in
-
Just published a new video in my Web Development Series 🚀 This time, I covered Mongoose Schemas & Models in a very simple and beginner-friendly way. If you're learning Node.js + MongoDB, this is a must-know concept because it helps you structure and validate your data properly. In this video, I explained: • What is a Schema • What is a Model • How they work together • How to create them in Mongoose Perfect for beginners starting backend development. Check it out here 👇 https://lnkd.in/gxEdVnDW #nodejs #mongodb #mongoose #backenddevelopment #webdevelopment #javascript #learnprogramming #jdcodebase
Mongoose Schemas & Models Explained | Node.js + MongoDB Tutorial for Beginners
https://www.youtube.com/
To view or add a comment, sign in
-
🛠️ Building a Skill Matching System comes with real engineering challenges. Here is how I tackled them. Every feature has decisions hiding underneath it. Here are 2 challenges I solved while building the matching system 👇 Challenge #1 — Unifying Multiple Search Filters The browse page had three search mechanisms: A global keyword search A Skills Needed filter A Skills Offered filter Running them as independent queries created conflicting results — irrelevant projects appearing or results disappearing entirely when multiple filters were active together. Solution: Merged all active filters into one unified dynamic MongoDB query using $and logic. One request. Clean results. ✅ Challenge #2 — Keeping Skill Matching Consistent The matching logic was comparing skill names as plain strings — which meant "React" and "react" were treated as two completely different skills. Silent inconsistencies were affecting match quality across the entire platform. Solution: Normalized all skill values to lowercase at the point of entry into the database. Consistent data in. Consistent matching out. ✅ What I learned: ✅ Multiple filters must always be merged into a single unified query ✅ Normalize your data at the point of entry — consistency starts at the source Still building. Shipping one module at a time. 🚢 Follow along for the unfiltered reality of building a real product. #BuildInPublic 💬 What is the trickiest data consistency challenge you have faced? Drop it below 👇 #ReactJS #MongoDB #MERN #BuildInPublic #WebDevelopment #JavaScript #NodeJS #Pakistan #Debugging
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development
Building a URL shortener is the ultimate rite of passage for understanding system design! Since you've got the core MongoDB mapping and basic click tracking down, a great next feature would be adding Redis to cache the most frequently accessed URLs to reduce database read loads. You could also take those backend stats and build out a visual analytics dashboard on the Next.js frontend to track clicks over time. Awesome build!