Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WriteFlow

WriteFlow is a full-stack blogging application that enables users to securely create, manage, and interact with posts through a scalable REST API powered by Node.js, Express.js, PostgreSQL, and JWT Authentication.


🚀 Tech Stack

Backend

  • Node.js
  • Express.js
  • PostgreSQL
  • pg
  • JWT Authentication
  • bcrypt
  • cookie-parser
  • cors
  • dotenv

Frontend

  • HTML
  • CSS
  • JavaScript

✨ Features

  • 🔐 User Authentication
  • 🍪 HTTP-only Cookie Authentication
  • 📝 CRUD Operations for Posts
  • 💬 CRUD Operations for Comments
  • 🔍 Search Posts
  • 📄 Pagination
  • 👤 Author-only Update/Delete
  • 🛡️ Admin Authorization
  • 🏗 Layered Architecture
  • ⚡ RESTful API

📂 Project Structure

src/
│
├── controllers/
├── services/
├── repositories/
├── routes/
├── middlewares/
├── validators/
├── utils/
│
├── app.js

🗄 Database

Current tables

  • Users
  • Posts
  • Comments

🔐 Authentication Routes

Method Endpoint Description Protected
POST /api/auth/register Register a new user
POST /api/auth/login Login user
POST /api/auth/logout Logout user
GET /api/auth/me Get current authenticated user

📝 Post Routes

Method Endpoint Description Protected
POST /api/post/create Create a new post
GET /api/post Get all posts
GET /api/post/:id Get post by ID
PATCH /api/post/:id Update own post
DELETE /api/post/:id Delete own post/Admin

💬 Comment Routes

Method Endpoint Description Protected
POST /api/post/comment/:id Create comment on a post
GET /api/post/comment/:id Get comments of a post
PUT /api/post/comment/:id Update own comment
DELETE /api/post/comment/:id Delete own comment/Admin

⚙️ Installation

Clone the repository

git clone https://github.com/lavishlohiya/writeflow.git

Move into the project

cd writeflow

Install dependencies

npm install

Create a .env file

PORT=1002
DATABASE_URL=your_database_url
JWT_SECRET=your_secret_key

Run the server

npm start

📸 Screenshots

Dashboard

Screenshot 2026-06-29 122119

Login

Screenshot 2026-06-29 122207

🚧 Future Improvements

  • 🖼 Image Uploads
  • ❤️ Like System
  • 👤 User Profiles
  • 🏷 Categories & Tags
  • 📂 File Storage
  • 🐳 Docker
  • 🧪 Unit & Integration Tests
  • 🚀 CI/CD Pipeline

📄 License

Licensed under the MIT License.


Author

Lavish Lohiya

About

WriteFlow is a full-stack blogging application that enables users to securely create, manage, and interact with posts through a scalable REST API powered by Node.js, Express.js, PostgreSQL, and JWT Authentication.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages