Skip to content

Planner Flow is a simple yet deeply structured task manager built with Node.js, Express, and MongoDB. πŸ“‹βœ¨

License

Notifications You must be signed in to change notification settings

ShayanBlaze/Planner-Flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“‹ Planner Flow: A Simple Task Manager (Node.js & Express)

A lightweight, yet deeply structured task management application built with Node.js and Express β€” designed to showcase backend development skills and architectural understanding.


πŸš€ Features

  • βœ… Full CRUD Operations: Create, Read, Update, and Delete tasks
  • βœ… Task Completion Status: Mark tasks as completed or incomplete
  • βœ… RESTful API: Clean and well-defined API endpoints
  • βœ… Robust Error Handling:
    • Custom API errors for specific HTTP statuses
    • Asynchronous error wrapping to simplify try-catch blocks
    • Dedicated middleware for handling 404 (Not Found) routes
  • βœ… MongoDB Integration: Persistent data storage using MongoDB with Mongoose ODM
  • βœ… Basic Frontend: Simple, vanilla JavaScript-powered web interface
  • βœ… Environment Variable Management: Secure handling of sensitive data with .env

πŸ“ Project Structure

Planner Flow/
β”œβ”€β”€ controllers/            # 🚦 API endpoint logic (CRUD operations for tasks)
β”‚   └── tasks.js
β”œβ”€β”€ db/                     # πŸ’Ύ Database connection setup
β”‚   └── connect.js
β”œβ”€β”€ errors/                 # β›” Custom error classes and helpers
β”‚   └── custom-error.js
β”œβ”€β”€ middleware/             # βš™οΈ Express middleware functions (async handling, error handling, 404)
β”‚   β”œβ”€β”€ async.js
β”‚   β”œβ”€β”€ error-handler.js
β”‚   └── not-found.js
β”œβ”€β”€ model/                  # πŸ“š Mongoose data models
β”‚   └── Task.js
β”œβ”€β”€ public/                 # 🌐 Static frontend files (HTML, CSS, client-side JS)
β”‚   β”œβ”€β”€ browser-app.js
β”‚   β”œβ”€β”€ edit-task.js
β”‚   β”œβ”€β”€ favicon.ico
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ main.css
β”‚   β”œβ”€β”€ normalize.css
β”‚   └── task.html
β”œβ”€β”€ routes/                 # πŸ›£οΈ Express route definitions for API endpoints
β”‚   └── tasks.js
β”œβ”€β”€ .env                    # πŸ”‘ Environment variables (ignored by Git)
β”œβ”€β”€ .gitignore              # 🚫 Files/folders to exclude from Git tracking
β”œβ”€β”€ app.js                  # πŸš€ Main application entry point
β”œβ”€β”€ package-lock.json       # πŸ”’ Exact dependency versions
└── package.json            # πŸ“¦ Project metadata and dependencies

πŸ›  How It Works

  1. app.js initializes the Express server, sets up middleware, and defines API routes
  2. db/connect.js establishes a MongoDB connection using Mongoose
  3. routes/tasks.js defines API endpoints (/api/v1/tasks) for HTTP methods
  4. controllers/tasks.js contains the core logic for each API operation
  5. model/Task.js defines the Mongoose schema for a Task document
  6. middleware/async.js wraps async controller functions for error handling
  7. middleware/error-handler.js centrally handles all application errors
  8. public/ serves static HTML, CSS, and client-side JS (browser-app.js, edit-task.js) which interact with the backend API using axios

πŸ“¦ Installation

Prerequisites

  • Node.js: v14 or higher
  • MongoDB: Local or cloud instance (e.g., MongoDB Atlas)

Steps

  1. Clone the project:

    git clone [Your Project's GitHub Link]
    cd "Planner Flow"
  2. Install dependencies:

    npm install
  3. Configure environment variables:
    Create a .env file in the project root and add:

    MONGO_URI=mongodb+srv://<YOUR_USERNAME>:<YOUR_PASSWORD>@<YOUR_CLUSTER_URL>/TaskManagerDB?retryWrites=true&w=majority
    
    • MONGO_URI: Your MongoDB connection string
    • PORT: Server port (defaults to 6000 if not set)

▢️ Run the Server

  • Production:
    node app.js
  • Development (with auto-restart):
    npm start

πŸ§ͺ Demo Use Case

  1. Open your browser to http://localhost:PORT/
  2. Add new tasks using the input field
  3. View, edit, or delete existing tasks from the list
  4. Navigate to task.html?id=<taskID> to directly edit a specific task

🧠 Skills Demonstrated

  • Low-level understanding of Node.js HTTP server and Express.js routing
  • Building and consuming RESTful APIs
  • Database integration with MongoDB and Mongoose
  • Effective error handling strategies
  • Middleware pattern implementation
  • Frontend-backend integration using vanilla JavaScript and Axios
  • Environment variable management
  • Modular and organized project structure

πŸ“ Author

Custom-built by Shayan Sharifi as a personal project for understanding the depths of Node.js and Express.
It serves as a foundational example of a full-stack application, focusing on backend robustness and clear architecture.

Feel free to fork and expand it into your own task management system or use it as a learning resource!


βœ… License

MIT

About

Planner Flow is a simple yet deeply structured task manager built with Node.js, Express, and MongoDB. πŸ“‹βœ¨

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published