Skip to content

πŸ”— LinkUp β€” Simple Social Media Platform for Learning REST APIs Empowering developers to master backend development through real-world CRUD operations. Built with Node.js, Express.js, and EJS, LinkUp demonstrates RESTful principles in action with a clean, educational, and beginner-friendly architecture.

Notifications You must be signed in to change notification settings

VAMSHIYADAV46/linkUp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”— LinkUp

Simple Social Media Platform for Learning REST APIs with Node.js & Express

GitHub Repo Size GitHub Stars Last Commit Issues License

Node.js Express.js EJS REST API

πŸš€ Live Demo β€’ πŸ“– Documentation β€’ πŸ› Report Bug β€’ ✨ Request Feature


🌟 Introduction

LinkUp is a lightweight social media platform designed specifically for developers learning REST API development. Built with Node.js and Express.js, it provides a hands-on experience in creating, reading, updating, and managing posts through clean and intuitive interfaces.

🎯 The Problem

Learning REST APIs can be abstract and confusing without practical implementation. Many tutorials focus on theory but lack a real-world project that ties everything together.

πŸ’‘ Our Solution

LinkUp offers a complete, working social media platform where you can see REST principles in action. Every feature is built around RESTful architecture, making it the perfect learning companion for backend development.

πŸš€ What Makes LinkUp Unique

  • πŸŽ“ Education-First: Designed specifically for learning REST APIs
  • πŸ“ Clean Codebase: Easy-to-understand code structure for beginners
  • πŸ› οΈ Practical Learning: Real-world CRUD operations implementation
  • ⚑ Lightweight: Minimal dependencies, maximum learning
  • 🎨 Simple UI: Focus on backend without complex frontend distractions

✨ Features

🎬 Core Features

  • πŸ“ Create Posts - Share your thoughts and ideas
  • ✏️ Update Posts - Edit existing content seamlessly
  • πŸ‘οΈ View Posts - Browse all posts and view details
  • πŸ›‘οΈ Error Handling - Custom error pages for graceful failures
  • 🎨 Dynamic Views - EJS templates for server-side rendering
  • πŸ”„ REST Architecture - Following RESTful best practices

πŸ›‘οΈ Learning Benefits

  • ⚑ Hands-On Practice - Real CRUD operations
  • πŸ” API Design - Understand REST principles
  • 🎯 Express Routing - Master route handling
  • πŸ“¦ Template Engines - Work with EJS
  • πŸ§ͺ Testing-Ready - Structure for easy testing
  • πŸ’» Clean Code - Industry-standard practices

πŸ—οΈ System Architecture

graph TB
    subgraph "Client Layer"
        A[Browser] --> B[EJS Templates]
        B --> C[HTML/CSS UI]
    end
    
    subgraph "Server Layer"
        D[Express.js Server] --> E[Route Handlers]
        E --> F[Middleware]
        F --> G[Controllers]
    end
    
    subgraph "Data Layer"
        H[In-Memory Storage] --> I[Posts Array]
        I --> J[CRUD Operations]
    end
    
    A -->|HTTP Requests| D
    E -->|Process| G
    G -->|Render| B
    G -->|Data Access| H
    
    style A fill:#61dafb,stroke:#000,stroke-width:2px
    style D fill:#000000,stroke:#fff,stroke-width:2px
    style H fill:#47a248,stroke:#000,stroke-width:2px
    style B fill:#b4ca65,stroke:#000,stroke-width:2px
Loading

πŸ› οΈ Tech Stack

Category Technology Description
Backend Node.js JavaScript runtime environment
Framework Express Minimalist web framework
Template Engine EJS Embedded JavaScript templating
Architecture REST RESTful API design pattern
Middleware Body Parser Request body parsing
Utilities UUID Unique ID generation

🌐 REST API Endpoints

Complete API Reference

Method Endpoint Description Request Body
GET /posts Fetch all posts -
POST /posts Create a new post { username, content }
GET /posts/:id Get specific post details -
PATCH /posts/:id Update existing post { content }

Example API Usage

πŸ“‹ Fetch All Posts

GET /posts

Response:

[
  {
    "id": "abc123",
    "username": "johndoe",
    "content": "Hello, LinkUp!"
  }
]

βž• Create New Post

POST /posts
Content-Type: application/x-www-form-urlencoded

username=johndoe&content=My first post!

Response:

{
  "success": true,
  "message": "Post created successfully"
}

πŸ” Get Specific Post

GET /posts/abc123

Response:

{
  "id": "abc123",
  "username": "johndoe",
  "content": "Hello, LinkUp!"
}

✏️ Update Post

PATCH /posts/abc123
Content-Type: application/x-www-form-urlencoded

content=Updated post content

Response:

{
  "success": true,
  "message": "Post updated successfully"
}

πŸ“¦ Installation & Setup

Prerequisites

  • Node.js 14.x or higher
  • npm or yarn package manager
  • Git installed on your system
  • Text editor (VS Code recommended)

1️⃣ Clone the Repository

git clone https://github.com/VAMSHIYADAV46/linkUp.git
cd linkUp

2️⃣ Install Dependencies

# Install all required packages
npm install

3️⃣ Project Structure

LinkUp/
β”œβ”€β”€ views/
β”‚   β”œβ”€β”€ index.ejs       # All posts view
β”‚   β”œβ”€β”€ show.ejs        # Single post details
β”‚   β”œβ”€β”€ new.ejs         # Create new post form
β”‚   β”œβ”€β”€ edit.ejs        # Edit post form
β”‚   └── error.ejs       # Custom error page
β”œβ”€β”€ public/
β”‚   └── style.css       # Stylesheet
β”œβ”€β”€ index.js            # Main server file
β”œβ”€β”€ package.json        # Project dependencies
└── README.md           # Documentation

4️⃣ Start the Server

# Development mode
node index.js

# Or with nodemon for auto-restart
nodemon index.js

5️⃣ Access the Application

Open your browser and navigate to:

http://localhost:8080

πŸ’» Usage Guide

Getting Started

  1. View All Posts: Navigate to the homepage to see all posts
  2. Create Post: Click "New Post" button and fill in the form
  3. View Details: Click on any post to see full details
  4. Edit Post: Click "Edit" button on post details page
  5. Update Content: Modify the content and save changes

Code Examples

Creating a New Route

// GET route to display all posts
app.get('/posts', (req, res) => {
  res.render('index.ejs', { posts });
});

// POST route to create new post
app.post('/posts', (req, res) => {
  let { username, content } = req.body;
  let id = uuidv4();
  posts.push({ id, username, content });
  res.redirect('/posts');
});

Updating with PATCH

// PATCH route to update post
app.patch('/posts/:id', (req, res) => {
  let { id } = req.params;
  let newContent = req.body.content;
  let post = posts.find(p => p.id === id);
  post.content = newContent;
  res.redirect('/posts');
});

πŸ“š Learning Outcomes

What You'll Master:

🎯 REST Principles

  • Resource-based URLs
  • HTTP method semantics
  • Stateless architecture
  • Uniform interface

πŸ› οΈ Express.js Skills

  • Routing and middleware
  • Request/response handling
  • Template rendering
  • Error handling

πŸ’‘ Best Practices

  • Code organization
  • MVC pattern basics
  • RESTful naming conventions
  • Clean code principles

Key Concepts Covered:

  • βœ… CRUD Operations - Complete create, read, update workflow
  • βœ… HTTP Methods - GET, POST, PATCH usage and differences
  • βœ… Route Parameters - Dynamic URL handling with :id
  • βœ… Request Body Parsing - Working with form data and middleware
  • βœ… Template Rendering - Server-side view generation with EJS
  • βœ… Error Handling - Custom error pages and graceful failures
  • βœ… Middleware - Understanding Express middleware pipeline
  • βœ… Redirects - Proper navigation after form submissions

πŸ—ΊοΈ Roadmap

Phase 1: Core Features βœ…

  • Basic CRUD operations
  • RESTful routing
  • EJS template integration
  • Error handling

Phase 2: Enhanced Features 🚧

  • Delete post functionality
  • Input validation
  • Search and filter posts
  • Pagination support
  • Post timestamps

Phase 3: Database Integration πŸ“‹

  • MongoDB integration
  • Persistent data storage
  • User profiles
  • Post likes/reactions
  • Comments system

Phase 4: Authentication πŸ”

  • User registration
  • Login/logout system
  • Session management
  • Protected routes
  • JWT authentication

Phase 5: Advanced Features 🎯

  • Image upload support
  • Real-time updates
  • REST API documentation
  • API rate limiting
  • Comprehensive testing

🀝 Contributing

We welcome contributions from learners and developers! Here's how you can help:

How to Contribute

  1. Fork the Repository

    git clone https://github.com/VAMSHIYADAV46/linkUp.git
    cd linkUp
    
  2. Create Feature Branch

    git checkout -b feature/YourFeature
  3. Make Your Changes

    • Keep code simple and readable
    • Follow existing code style
    • Add comments for complex logic
    • Test your changes thoroughly
  4. Commit Your Changes

    git add .
    git commit -m "✨ Add YourFeature"
  5. Push to Your Fork

    git push origin feature/YourFeature
  6. Open Pull Request

    • Describe what you've added
    • Explain why it's useful for learning
    • Include screenshots if applicable

Contribution Ideas

  • πŸ“ Improve documentation
  • πŸ› Fix bugs
  • ✨ Add new features
  • 🎨 Enhance UI/UX
  • πŸ§ͺ Add tests
  • πŸ“– Create tutorials

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License

Copyright (c) 2024 MEKALA VAMSHI YADAV

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...

πŸ™ Acknowledgements

Special Thanks To:

Inspired By:

  • Twitter - For simple post-based interactions
  • Reddit - For community content sharing
  • Dev.to - For developer-focused platforms

πŸ‘¨β€πŸ’» Author

Mekala Vamshi Yadav

Full-Stack Developer & REST API Enthusiast

GitHub LinkedIn Portfolio


πŸ”— Project Links


⭐ Star this repo if you find it helpful for learning!

GitHub stars

Built with ❀️ for Developers Learning REST APIs

Happy Coding! πŸš€

About

πŸ”— LinkUp β€” Simple Social Media Platform for Learning REST APIs Empowering developers to master backend development through real-world CRUD operations. Built with Node.js, Express.js, and EJS, LinkUp demonstrates RESTful principles in action with a clean, educational, and beginner-friendly architecture.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published