Skip to content

A simple To Do application built with Express and PostgreSQL. Users can add, update, and delete tasks through a web interface. The app connects to a PostgreSQL database to persist task data and uses EJS for dynamic rendering of tasks. It features basic CRUD operations for managing tasks and is designed for easy setup and customization.

Notifications You must be signed in to change notification settings

Manish312002/To_Do_App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task Manager Express

A simple Task Manager application built with Express.js and PostgreSQL. This app allows users to manage tasks by adding, updating, and deleting them. It uses EJS for rendering tasks and connects to a PostgreSQL database to persist data.

Features

  • Add new tasks
  • Update existing tasks
  • Delete tasks
  • View tasks in a web interface

Installation

Prerequisites

  • Node.js
  • PostgreSQL

Steps

  1. Clone the repository:

    git clone https://github.com/Manish312002/task-manager-express.git
    cd task-manager-express
    
  2. Install dependencies:

  • npm i
  1. Set up PostgreSQL database:
  • Create a PostgreSQL database named Web Dev and set up a table named to_do with the following schema:
     CREATE TABLE to_do (
       id SERIAL PRIMARY KEY,
       title VARCHAR(255) NOT NULL
     );
    
  1. Configure database connection:

    const db = new pg.Client({
     user: "postgres",
     password: "root",
     database: "Web Dev",
     host: "localhost",
     port: 5432
    });
    
  2. Start the server:

  • node index.js

API Endpoints

  • GET /: Renders the main page with the list of tasks.
  • POST /add: Adds a new task.
    • req.body.newItem - The title of the new task.
  • POST /edit: Updates an existing task.
    • req.body.updatedItemId - The ID of the task to be updated.
    • req.body.updatedItemTitle - The new title for the task.
  • POST /delete: Deletes a task.
    • req.body.deleteItemId - The ID of the task to be deleted.

About

A simple To Do application built with Express and PostgreSQL. Users can add, update, and delete tasks through a web interface. The app connects to a PostgreSQL database to persist task data and uses EJS for dynamic rendering of tasks. It features basic CRUD operations for managing tasks and is designed for easy setup and customization.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published