This is a fullstack reusable capstone project that handles multi user roles authentication system built with Django, React and Redux.
I've always been fascinated by how applications with multiple user roles and permissions are run, developed, and configured. As a learning challenge, I decided to uncover and dig beneath the hood.
- IDE of your choice
- Python 3.6 +
- Django 4.0.1 +
- Django Rest Framework
- More depedancies listed in backend/requirements.txt
- Javascript
- Node
- Express
- Redux
- Clone this repository
git clone https://github.com/John-Kimani/MULTI_USER_ROLE_AUTHENTICATION.git
- Navigate into project base folder
cd MULTI_USER_ROLE_AUTHENTICATION
- Open project in your IDE. i.e VsCode users
code .
Move into the backend folder to configure the backend server.
Create virtual envirionment.
virtualvenv venv
Activate the virtual environment
pipenv shell
Install all the required dependacies.
pip install requirements.txt
Create a .env file to hold your hidden project environment variables.
Create a postrgress database for my production and development configuration alrather set mode to lite to user the preinstalled SQLite3 database
- SECRET_KEY='django-secret-key' or 'you-will-never-guess'
- MODE='dev' // development
- DEBUG=True
- DEV_DB_NAME='blackpanther22'
- DEV_DB_USER='postgres user' or 'allowed psql user'
- DEV_DB_PASSWORD='you-will-never-guess' or Null
- DEV_DB_HOST=provide default
- ALLOWED_HOSTS=provide for localhost
- CLOUDINARY_CLOUD_NAME=your cloudinary username
- CLOUDINARY_API_KEY=your cloudinary api
- CLOUDINARY_API_SECRET=your cloudinary secret key
- CSRF_TRUSTED_ORIGINS =[ALLOWED_HOSTS]
- DISABLE_COLLECTSTATIC=0
Make migrations to the new database.
python manage.py makemigrations
Migrate new configurations to database.
python manage.py migrate
If successfull you can now configure the frontend application. Move back to projects root folder MULTI_USER_ROLE_AUTHENTICATION
cd ..
An expressJs server engine is used to handle and fix CORS related issues during development by technically having the client app rendered and sending requests from a proxy host.
From base folder navigate into frontend folder.
cd frontend
To install required package dependancies run;
npm install
Navigate into the frontend folder to set up the client-side server.
frontend/client
cd client
Install required package for the SPA application dependancies run;
npm install
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
This project was designed and developed by : Kimani John