8000 GitHub - emilefrey/django-react-postgres-boilerplate at v1.0
[go: up one dir, main page]

Skip to content

A basic Django (DRF) backend & React frontend boilerplate app with token authentication, login/logout, and password reset functionality. The app can be easily spun up with docker-compose, customized, and repurposed.

Notifications You must be signed in to change notification settings

emilefrey/django-react-postgres-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

django-react-postgres-boilerplate

Prerequisites

Install Docker Desktop

Installation

There are 3 .env files provided. Note in particular the .env files in backend/ and postgres/; there, you can adjust the database credentials, debug mode, secret key, allowed hosts, etc. Things should run just fine without any changes, but just know these files are there.

The included sample helloyou django app can be easily removed by removing 'helloyou' from INSTALLED_APPS in django mainapp/settings.py, removing the associated helloyou path in mainapp/urls.py and deleting the entire helloyou folder. On the frontend, delete/replace the contents of Home.tsx.

Change the boilerplate app name (shown in header and footer) by changing the constant APP_NAME in frontend/src/settings.tsx.

The Material UI Theme can be adjusted in frontend\src\Theme.tsx

NOTE: If you change your database name/credentials, but have already run the steps below, you may need to delete the associated postgres docker image in order to get things to work.

For development mode without NGINX server, run the following command:

docker-compose -f "docker-compose.dev.yml" up -d --build

The react frontend should be available at http://localhost:3000/ and django backend at http://localhost:8000/ (django admin at http://localhost:8000/admin/). This mode supports both react hot reloading and django auto-refresh with changes.

For development with the NGINX server run:

docker-compose -f "docker-compose.yml" up -d --build

The server should be available at http://127.0.0.1/. This mode will not hot reload since it's running a production build (npm build).

NOTE: This repo is still largely a work in progress, but it should be a good starting point. Suggestions/feedback in discussions tab are greatly appreciated.

TODO:

  • Backend Testing
  • Frontend Testing (React Testing Library)
  • Readme (setup and how to remove remnants of dummy stuff)
  • Material UI Theme
  • Auto redirect to login with Failed Request
  • Auto Generation of Left Nav based on Routes?
  • Fix NGINX Docker Compose
  • Axios Interfaces
  • Update and Pin versions (remove anything unused)
  • fix django admin not serving css files on admin page
  • error context
  • show password errors
  • loading icon on login
  • forgot password functionality (email)
  • add logo holder
  • ability to customize background on login

About

A basic Django (DRF) backend & React frontend boilerplate app with token authentication, login/logout, and password reset functionality. The app can be easily spun up with docker-compose, customized, and repurposed.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published
0