Giter VIP home page Giter VIP logo

notes_api's Introduction

API Documentation

This document provides information about the features and usage of the Notes API.
Framework : DRF, DB : PostgresDB (ElephantSQL cloudDB instance), DB Index : GinIndexes, , Authentication Mechanism: Token Based (JWT)

Table of Contents

Authentication

The API uses token-based authentication using JSON Web Tokens (JWT). To access protected endpoints, you need to include the generated token in the Authorization header of your requests.

Rate Limiting

The API has rate limiting in place to manage server load. Exceeding the allowed number of requests within a specified time frame will result in a rate limit error. Each endpoint has different Rate Limits assigned to it

Endpoints

Signup

Endpoint: /api/auth/signup/
Method: POST
Description: Create a new user account.

Login

Endpoint: /api/auth/login/
Method: POST
Description: Log in to an existing user account and obtain an access token.

Get a Note by ID

Endpoint: /api/notes/{id}/
Method: GET
Description: Retrieve details of a specific note by providing its ID.

Create a Note

Endpoint: /api/notes/
Method: POST
Description: Create a new note by providing a title and content.

Delete a Note

Endpoint: /api/notes/{id}/
Method: DELETE
Description: Delete a specific note by providing its ID.

Edit a Note

Endpoint: /api/notes/{id}/
Method: PUT
Description: Update the title and/or content of a specific note by providing its ID.

Share a Note

Endpoint: /api/notes/{id}/share/
Method: POST
Description: Share a specific note with another user by providing their username.

Search Notes

Endpoint: /api/search/
Method: GET
Description: Search for notes based on a keyword.

Get All Notes

Endpoint: /api/notes/
Method: GET
Description: Retrieve a list of all notes owned or shared with the authenticated user.

Running and Testing

  1. Clone the repository.
  2. Navigate to test_app folder : cd notes_api/test_app
  3. Set up a virtual environment and install dependencies using pip install -r requirements.txt.
  4. Run the Django development server: python manage.py runserver
  5. In a separate terminal :
    Go to cd tests/
    Run python tests.py
  6. Follow the prompts to test all the functionalities of the API
  7. For testing purposes two users have already been registered with usernames user1 and user2 respectively. Their login passwords are same as their usernames.

notes_api's People

Contributors

utkarsh23kushwaha avatar utkarshk1607 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.