Skip to content

Precixphantom/blog-platform

Repository files navigation

EchoHub 🗣️

A community-driven blog platform where ideas echo across users. Share your thoughts, read perspectives, and engage with a community of thinkers.

Live Demo Node.js MongoDB License: MIT

Live Demo | Report Bug | Request Feature


⚠️ Important Note

First load may take 30-60 seconds. The application is hosted on Render's free tier, which spins down after periods of inactivity. As a junior developer building in public, I'm using free hosting to keep the project accessible while I continue learning and improving it.


🎯 What is EchoHub?

EchoHub is a blog platform I built to solve a simple problem: giving people a space to share their thoughts on topics that matter to them, while allowing others to discover and engage with those perspectives.

I wanted to understand what happens behind the scenes when you log into a website, create content, and see it persist across sessions. This project became my playground for learning authentication, authorization, database design, and server-side rendering.

The Vision

Currently, users can write and publish their thoughts. The platform distinguishes between your own blogs and others' content, creating a personalized reading experience.

Recent update: Comments API is now live. Authenticated users can create and delete comments on any blog post via API endpoints.

Still coming: Likes, sharing, and search to complete the community experience

✨ Features

Current Features

  • 🔐 User Authentication - Secure registration and login with password hashing
  • ✍️ Create & Publish - Write and publish blog posts
  • 📖 Read & Discover - Browse blogs from all users
  • 👤 Personal Dashboard - View and manage your own blogs separately
  • ✏️ Edit & Delete - Full CRUD operations on your content
  • 🎨 Responsive Design - Works across desktop and mobile devices
  • 💬 Comments (API) - Backend endpoints for creating, fetching, and deleting comments. Frontend UI coming soon.

Roadmap (What's Next)

  • Email verification for new users
  • Dark/Light theme toggle
  • Comment system (API complete, frontend coming soon)
  • Like and share functionality
  • User profiles with avatars
  • Search and filter blogs
  • Rich text editor for better formatting
  • Categories and tags

🛠️ Built With

Backend:

Authentication & Security:

Frontend:

  • EJS - Templating engine
  • Vanilla CSS - Styling

Development:


🚀 Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • MongoDB (local installation or Atlas account)
  • npm or yarn

Installation

  1. Clone the repository

    git clone https://github.com/Precixphantom/blog-platform.git
    cd blog-platform
  2. Install dependencies

    npm install
  3. Set up environment variables

    Create a .env file in the root directory:

    PORT=5000
    MONGODB_URI=your_mongodb_connection_string
    SECRET_KEY=your_secret_key_here

    How to get these:

    • MONGODB_URI: Get from MongoDB Atlas (free tier available)
    • SECRET_KEY: Generate with node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
  4. Start the development server

    npm run dev
  5. Open your browser

    http://localhost:5000
    

📂 Project Structure

blog-platform/
├── controllers/       # Route logic and business logic
├── middleware/        # Authentication, validation, and error handling
├── models/           # Mongoose schemas and models
├── routes/           # API route definitions
├── utils/
│   ├── AppError.js   # Custom error class
│   └── catchAsync.js # Async error wrapper
├── views/            # EJS templates
├── public/
│   └── css/         # Stylesheets
├── .env             # Environment variables (not in repo)
├── .gitignore       # Git ignore rules
├── server.js        # Application entry point
└── package.json     # Dependencies and scripts

🎓 What I Learned

Building EchoHub taught me more than I expected:

The Biggest Challenges

  1. EJS Templating - Understanding how to pass data from the backend to views and render dynamic content
  2. Authentication Flow - Implementing secure user authentication and ensuring users only see/edit their own content
  3. Deployment - Dealing with environment variables, database connections, and the differences between local and production environments

Key Takeaways

  • Authentication ≠ Authorization - Logging in is one thing; ensuring users can only access their own resources is another
  • State management matters - Sessions, cookies, and JWTs each solve different problems
  • Error handling is crucial - Things break in production in ways they never do locally
  • Centralized error handling - AppError and catchAsync remove repetition and make errors consistent across the entire app

What I'd Do Differently Now

Three months later, I'd approach several things differently:

  • Use TypeScript for better type safety
  • Implement comprehensive input validation from the start
  • Write tests alongside features (not after)
  • Use a REST API architecture instead of pure server-side rendering
  • Add proper logging and monitoring from day one

🐛 Known Limitations

Being honest about where the project stands:

  • Cold starts: Render free tier sleeps after inactivity (30-60s initial load)
  • Basic UI: Functional but not polished—design improvements coming
  • No real-time features: Comments/likes will need page refreshes initially
  • Limited error feedback: User-facing error messages could be more helpful

I'm aware of these limitations and actively working to address them as I learn more.


🤝 Contributing

I'm learning in public and contributions are welcome! Whether you're a beginner like me or an experienced developer, your input helps me grow.

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Areas Where I'd Love Help

  • Code reviews and best practice suggestions
  • Security improvements
  • UI/UX enhancements
  • Documentation improvements
  • Bug fixes

📝 License

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


👨‍💻 About Me

I'm Precious Afolabi, a Backend Developer learning in public and building projects to understand how things work behind the scenes. I'm curious about authentication, databases, APIs, and everything that powers modern web applications.

This project is actively evolving as I learn. I revisit and improve it with every new concept I pick up — and I'm proud of shipping something functional while continuing to make it better.

Let's Connect

I'm open to feedback, mentorship, and opportunities. If you're reviewing this as a potential employer or mentor, I'd love to hear your thoughts on how I can improve—both this project and as a developer.


🙏 Acknowledgments

  • Thanks to everyone who's contributed feedback
  • The Node.js and MongoDB communities for excellent documentation
  • Every developer who's shared their learning journey publicly—you inspired me to do the same

📊 Project Status

Active Development - I'm continuously improving this project as I learn new concepts and best practices. Check the Issues page to see what I'm working on next.

Last Updated: March 2026


Built with curiosity, improved through feedback, and shared with the hope it helps other learners. 🚀

About

A simple blog platform built with Node.js, Express, MongoDB, and EJS. Users can create, read, update, and delete blog posts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors