I decided to create this project to incorporate Social Authentication in Seedstars' Django React/Redux Base Project
The project was built with the following technologies:
Frontend
- React
- React Router
- JSON Web Token JSON Web Token for API authentication
- Babel for ES6 and ES7 magic
- Webpack for bundling
- Webpack Dev Middleware
- Redux's futuristic Flux implementation
- Redux Dev Tools for next generation DX (developer experience). Watch Dan Abramov's talk
- Redux Thunk Thunk middleware for Redux - used in async actions
- React Router Redux Ruthlessly simple bindings to keep react-router and redux in sync
- fetch A window.fetch JavaScript polyfill
- style-loader, sass-loader and less-loader to allow import of stylesheets in plain css, sass and less,
- bootstrap-sass-loader and font-awesome-webpack to customize Bootstrap and FontAwesome
- ESLint, Airbnb Javascript/React Styleguide, Airbnb CSS / Sass Styleguide to maintain a consistent code style and eslint-plugin-import to make sure all imports are correct
- mocha to allow writing unit tests for the project
- redux-mock-store a mock store for your testing your redux async action creators and middleware
- expect Write better assertions
- Nock HTTP mocking and expectations library
- istanbul to generate coverage when running mocha
Backend
- Django
- Django REST framework Django REST framework is a powerful and flexible toolkit for building Web APIs
- Django REST Auth for Authtentication
- Django All Auth for Social Authtentication
- WhiteNoise to serve files efficiently from Django
- Responses a utility for mocking out the Python Requests library
$ git clone https://github.com/Seedstars/django-react-redux-base.git
$ cd django-react-redux-jwt-base
$ git submodule init
$ git submodule update
$ ./scripts/get_static_validation.sh
Remember that when you copy this repository for a new project you need to add the scripts external module using:
$ git submodule add https://github.com/Seedstars/culture-scripts scripts
-
$ npm install
-
$ npm run dev
-
$ pip install -r py-requirements/dev.txt
-
$ cd src
-
$ python manage.py migrate
-
$ python manage.py runserver
Now start your server, visit your admin pages (e.g. http://localhost:8000/admin/) and follow these steps:
-
Add a Site for your domain, matching settings.SITE_ID (django.contrib.sites app).
-
For each OAuth based provider, add a Social App (socialaccount app).
-
Fill in the site and the OAuth app credentials obtained from the provider.
Run webpack in development mode
$ npm run dev
Run Django development http server
$ cd src
$ python manage.py runserver