Skip to content

manuelruff/HOME_TIFF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

To-Do List Site - Tiff Home Assignment

This project is a full-stack to-do list application built using React for the frontend and Node.js/Express for the backend, with a MongoDB Atlas database and deployment to AWS Lambda + API Gateway and S3 for hosting.


Live Site

(site currently down, you can run locally by creating new mongodb connection) Click here to view the live site

Project Overview

A simple and functional to-do list web application where users can:

  • Register and log in with their accounts.
  • Create, update, delete, and list tasks.
  • Mark tasks as completed or pending.
  • Toggle to hide completed tasks.

Installation

Clone the repositry:

git clone "https://github.com/manuelruff/HOME_TIFF.git"

Open the project in your favorite editor

Frontend Setup

  1. Navigate to the frontend directory:

    cd client
  2. Install dependencies:

    npm install
  3. Create .env in the client directory:

    REACT_APP_API_URL=http://localhost:5000/api
  4. Start the frontend locally:

    npm start

Backend Setup

  1. Navigate to the backend directory:

    cd server
  2. Install dependencies:

    npm install
  3. Create .env in the server directory:

    MONGO_URI=mongodb+srv://manuelr:Manuel1969@todolist.ikcih.mongodb.net/todo?retryWrites=true&w=majority&appName=ToDoList
    PORT=5000

    you can change the MONGO_URI to your db

  4. Run the backend locally:

    node index.js

    Your server will be running at http://localhost:5000.


API Endpoints

User Routes (/api/users/)

  • POST /users: Register a new user.
  • POST /users/login: Log in a user.
  • i left some as a note for debugging if needed

Task Routes (/api/tasks/)

  • POST /tasks: Add a new task.
  • GET /tasks?username=: Get tasks for the user.
  • PUT /tasks/:id: Update a task.
  • DELETE /tasks/:id: Delete a task.

Usage

Postman Requests:

  1. Registration Request:

    • URL: http://localhost:5000/api/users
    • Method: POST
    • Body (JSON):
      {
        "name": "example_user",
        "password": "example_password"
      }
  2. Login Request:

    • URL: http://localhost:5000/api/users/login
    • Method: POST
    • Body (JSON):
      {
        "name": "example_user",
        "password": "example_password"
      }
  3. Get All Tasks for a User:

    • URL: http://localhost:5000/api/tasks?username=example_user
    • Method: GET
  4. Add a Task:

    • URL: http://localhost:5000/api/tasks
    • Method: POST
    • Body (JSON):
      {
        "title": "New Task",
        "username": "example_user"
      }
  5. Update a Task:

    • URL: http://localhost:5000/api/tasks/{taskId}
    • Method: PUT
    • Body (JSON):
      {
        "title": "Updated Task Title",
        "completed": true
      }
  6. Delete a Task:

    • URL: http://localhost:5000/api/tasks/{taskId}
    • Method: DELETE

Future Improvements

  • Add JWT-based authentication for better security.

About

tiff home assignment

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors