Giter Site home page Giter Site logo

zmaktr / django-react-auth Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 747 KB

startup fast with your app using this repo having jwt auth / react / DRF / CORS already setup and configured

Python 44.39% HTML 5.87% CSS 3.17% JavaScript 43.31% Dockerfile 2.65% SCSS 0.60%

django-react-auth's Introduction

Notes API (Django & React)

You can make notes using this API to store ideas from your lectures or reading. It will make revision easy and clarify your thinking.

Frontend (React)

Frontend is developed using ReactJS library. The UI is kept simple just to demonstrate the functionality of the app.

Backend (Django)

Backend is developed using DRF (Django Rest Framework) using both class based views (for tokenization) and function based views (for CRUD operation on Notes).

Badges

GitHub issues GitHub forks GitHub stars

JWT Authentication Features

  • Access token valid for 5000ms
  • Generate a new access token using refresh token before expiry
  • Refresh token rotation lifespan 90 days
  • Previous refresh tokens are blacklisted after rotation so save the new refresh token each time after rotation
  • Encryption algorithm used HS256
  • For Authorization use 'Bearer {access token}' as value
  • Token claim has been customized to add additional field 'username'. You can retrieve 'username' by jwt decoding either refresh or access token

API Reference

Base URL :

  https://clean-orangutan-healthslash-3ca3ec8a.koyeb.app/

Get all endpoints

  GET /api/

Signup to a create new user

  POST /api/create-user/
Parameter Type Description
username string Required. username should be unique field
password string Required. password any format is acceptable

Login for existing users

  POST /api/token/
Parameter Type Description
username string Required. existing username
password string Required. existing password

Generate new tokens (tokens expire every 5000ms)

  POST /api/token/refresh/
Parameter Type Description
refresh string Required. latest refresh token

Retrieve array of user notes

  GET /api/notes/
Parameter Type Description
access string Required. latest access token

Create a new note

  POST /api/create-notes/
Parameter Type Description
access string Required. latest access token to authenticate
body string Required. add content of note in 'body' key
  DELETE /api/delete-notes/{id}/
Parameter Type Description
access string Required. latest access token to authenticate
id string Required. id of note to be deleted
  PATCH /api/update-notes/{id}/
Parameter Type Description
access string Required. latest access token to authenticate
id string Required. id of note to be be updated

Deployment

This project is running on @docker containers deployed on @DigitalOcean droplet and managed by @NGINX reverse proxy (depreciated).

Currently, running on https://www.koyeb.com/ free instance.

Author

Zaeem Akhtar

django-react-auth's People

Contributors

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