matthew-ardi / single-draw-app-reactdjango

A full-stack drawing application that allow users to create an account and save rectangle drawings. Users are allowed to edit, update, or delete saved drawings. (Stacks: React, Django, PostgreSQL)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deployed Application

https://drawing-app-dev3-backend.herokuapp.com/draw/

Supported Browsers: Chome, Firefox

Browsers not supported: Safari

Stacks Architecture

architecture

React is used for front-end component while django framework is used as the backend component. React role is in this stack is to visualize the drawing elements and it's navbar components. Using axios npm module to consume API calls available in the backend.

Django framework utilized multiple building blocks to expose API services required by front-end. This application utilize Django Rest framework to expose database contents that has its schema defined and enforced by Django Models. Two internal Django application was created, one for Drawing application and another for user management. Each of these Django applications has its own models to maintain. Both DrawApp and Users models are protected by Django Rest-Auth, a module that expose APIs to register, authenticate and manage user accounts.

Rest-Auth authentication is implemented across all exposed APIs. Hence, when API calls are made to access the resources, users would have to be logged in (indicated by authenticated token) and by default, only drawings generated by its user can be accessible for RESTful Method operation (GET, POST, PUT, DELETE).

How to run this Drawing App locally

  1. Clone this repository on the main branch
  2. Create Virtual Environment
$ python3 -m venv venv
  1. activate virtual environment
$ pip install pipenv #python2, or,
$ pip3 install pipenv #python3
  1. enter virtual environment shell
$ pipenv shell
  1. install all Django dependencies
$ pip install requirements.txt
  1. Build React front end
$ npm run build
  1. Create migrations on your virtual environment
$ python manage.py makemigrations
  1. Migrate Django backend models into DB
$ python manage.py migrate
  1. Run the application
$ python manage.py runserver

The application is now accessible at:

About

A full-stack drawing application that allow users to create an account and save rectangle drawings. Users are allowed to edit, update, or delete saved drawings. (Stacks: React, Django, PostgreSQL)


Languages

Language:JavaScript 67.1%Language:Python 29.0%Language:HTML 2.5%Language:CSS 1.4%