Coder Social home page Coder Social logo

kryzen-backend's Introduction

Todo App Backend

This repository contains the backend implementation of a simple Todo application using Node.js, Express.js, MongoDB, and JWT for authentication.

Features

  • User Authentication: Users can sign up and log in securely using JWT authentication.
  • Todo Management: Users can create, read, update, and delete todo items.
  • Secure Password Storage: User passwords are securely hashed using bcrypt before storing them in the database.

Prerequisites

Before running the application, make sure you have the following installed:

  • Node.js
  • MongoDB

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/todo-app-backend.git
  2. Install dependencies:

    cd todo-app-backend
    npm install
  3. Set up environment variables:

    Create a .env file in the root directory and add the following variables:

    SECRET_KEY=your_secret_key
    
  4. Run the application:

    npm start

Endpoints

User Authentication

  • POST /signup: Register a new user.
  • POST /login: Log in an existing user.

Todo Management

  • GET /todos: Retrieve all todo items for the authenticated user.
  • POST /todos/create: Create a new todo item.
  • PUT /todos/:id: Update an existing todo item.
  • DELETE /todos/:id: Delete a todo item.

Usage

User Authentication

To sign up a new user, send a POST request to /signup with the following JSON body:

{
  "name": "Your Name",
  "email": "[email protected]",
  "password": "your_password"
}

To log in an existing user, send a POST request to /login with the following JSON body:

{
  "email": "[email protected]",
  "password": "your_password"
}

Todo Management

To perform CRUD operations on todo items, use the corresponding endpoints listed above. Make sure to include the JWT token in the Authorization header for authenticated requests.

License

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

Acknowledgments

Special thanks to Express.js and MongoDB for making this project possible.

kryzen-backend's People

Contributors

kamalakanta01 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.