Skip to content

Latest commit

 

History

History
82 lines (61 loc) · 1.56 KB

README.md

File metadata and controls

82 lines (61 loc) · 1.56 KB

Dockerized backend with Django and frontend with React

This repo has the common backend and frontend technologies dockerized to start a new project without the concerns of installations or connexion between technologies.

Backend

  • django
    • djangorestframework
    • djangorestframework-jwt
    • django-cors-headers
  • postgres

Frontend

  • react
    • react-bootstrap
    • axios
    • react-router-dom

Note: It has CORS integration and jwt for authentication. To test this integration the project contains a CheckList app.

Setup

Proxy setup

  1. Create a proxy network where the containers will connect

    docker network create proxy
  2. Run jwilder/nginx-proxy container

    docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock:ro --restart=always --name proxy --network proxy jwilder/nginx-proxy
  3. Add the hosts for frontend and backend containers

    3.1 In your console enter to hosts file with write permissions

    nano /etc/hosts

    3.2 Add these two lines

    127.0.0.1       backend.test
    127.0.0.1       frontend.test

    3.3 Restart the proxy container

    docker restart proxy
  4. Build images and run containers

    make start
  5. Finally run the backend migrations

    make docker-migrate-up

Start

make start

Testing

make docker-test

Login view

Alt text

Checklist view

Alt text