Giter Club home page Giter Club logo

notesapi's Introduction

RESTful API for Notes sharing app

A secure and scalable RESTful API for managing and sharing notes. This project is built using Node.js, Express.js, MongoDB, and Mongoose.

Table of Contents

Project Overview

The project is implemented using Node.js and Express.js for the backend, MongoDB as the database, and Mongoose as the ODM. It includes user authentication using JsonWebToken , rate limiting, request throttling, and powerful search functionality.

API Endpoints

Authentication Endpoints

  • POST /api/auth/signup: Create a new user account.
  • POST /api/auth/login: Log in to an existing user account and receive an access token.

Note Endpoints

  • GET /api/notes: Get a list of all notes for the authenticated user.
  • GET /api/notes/:id: Get a note by ID for the authenticated user.
  • POST /api/notes: Create a new note for the authenticated user.
  • PUT /api/notes/:id: Update an existing note by ID for the authenticated user.
  • DELETE /api/notes/:id: Delete a note by ID for the authenticated user.
  • POST /api/notes/:id/share: Share a note with another user for the authenticated user.
  • GET /api/search?q=:query: Search for notes based on keywords for the authenticated user.

Project Details

  • Choice of Framework/DB/3rd Party Tools
    • Framework: Express.js was chosen for its simplicity and flexibility.
    • Database: MongoDB with Mongoose for a NoSQL solution that scales well.
    • Authentication: JWT (JSON Web Tokens) for secure authentication.
    • Rate Limiting/Request Throttling: Implemented using express-rate-limit middleware.
    • Search Functionality: MongoDB text indexing for efficient keyword-based search.

Setup and Installation

  1. Clone the repository:

    git clone https://github.com/arpit330/NotesAPI
    
  2. Run npm install

  3. Make .env file with PORT , URI , JWT_SECRET_KEY variables

  4. Run npm run dev

Run with Docker

  1. Clone the repository:

  2. Run docker build -t notes-app .

  3. RUN docker container run -d notes-app

notesapi's People

Contributors

arpit330 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.