Flask React Auth
Authentication with Flask, React, and Docker
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
About The Project
The repo represents my learning progress with the testdriven.io course with Flask and Docker.
Live demo available on Heroku.
Built With
- Flask
- Flask-RESTful
- Docker
- pytest
- Jest
- React
- React Testing Library
Getting Started
To get a local copy up and running follow these steps.
Prerequisites
- Docker 19.03.4
- docker-compose 1.25.0
Installation
- Get the flask-react-auth repository
or, if you have Node.js on your machine:
git clone https://github.com/sophiabrandt/flask-react-auth.git
npx degit https://github.com/sophiabrandt/flask-react-auth.git flask-react-auth
- Set environment variables
export REACT_APP_USERS_SERVICE_URL=http://localhost:5001
- Build docker containers
docker-compose build
- Run docker containers
docker-compose up -d
- Navigate to
http://localhost:3007
to see the React app.
Usage
-
Run pytest:
docker-compose exec users pytest "project/tests" -p no:warnings
-
Recreate database:
docker-compose exec users python manage.py recreate_db
-
Seed database:
docker-compose exec users python manage.py seed_db
-
Run flake8, black, isort:
docker-compose exec users flake8 project docker-compose exec users black project docker-compose exec users /bin/sh -c "isort project/*/*.py"
-
Run React tests:
docker-compose exec client npm run test
-
Run eslint, prettier:
docker-compose exec client npm run lint docker-compose exec client npm run formatfix:check docker-compose exec client npm run formatfix:write
Roadmap
See the open issues for a list of proposed features (and known issues).
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Please note that this is a learning repository, not a real project.
As the code is not mine, I can't give it an open-source license.
License
Code is © Michael Herman 2019, with minor modifications by Sophia Brandt.
Contact
Sophia Brandt - @hisophiabrandt
Project Link: https://github.com/sophiabrandt/flask-react-auth