Skip to content

utkarsh23kushwaha/notes_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReadMe

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages