Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ezeparziale/flask-auth-google-template
:key: Flask app with Google Auth login
https://github.com/ezeparziale/flask-auth-google-template
bootstrap flask flask-login google-auth postgres pydantic-v2 sqlalchemy
Last synced: about 13 hours ago
JSON representation
:key: Flask app with Google Auth login
- Host: GitHub
- URL: https://github.com/ezeparziale/flask-auth-google-template
- Owner: ezeparziale
- Created: 2022-08-19T00:50:56.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-06T23:16:41.000Z (14 days ago)
- Last Synced: 2025-01-07T00:27:30.262Z (14 days ago)
- Topics: bootstrap, flask, flask-login, google-auth, postgres, pydantic-v2, sqlalchemy
- Language: Python
- Homepage:
- Size: 120 KB
- Stars: 5
- Watchers: 3
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# :key: Flask auth google template
Flask app with Google auth login and postgres db
## :floppy_disk: Installation
```bash
python -m venv env
``````bash
. env/scripts/activate
``````bash
pip install --upgrade pip
``````bash
pip install -r requirements.txt
```## :wrench: Config
Create `.env` and `.env.db` files. Check the examples `.env.example` and `.env.db.example`
:globe_with_meridians: Google Auth credentials:
Create your app and obtain your `client_id` and `secret`:
```http
https://developers.google.com/workspace/guides/create-credentials
```:construction: Before first run:
Run `docker-compose` :whale: to start the database server
```bash
docker compose -f "docker-compose.yml" up -d --build adminer db
```and init the database with alembic:
```bash
alembic upgrade head
```:key: How to create cert and key
For run the `option 2` or `option 3` you need a `cert.pem` and `key.pem`.
Create a self-signed certificate with openssl:
```bash
openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365
```## :runner: Run
### :1st_place_medal: Option 1
Run the database with docker and the app with flask using a cert adhoc.
- Database:
```bash
docker compose -f "compose.yaml" up -d --build adminer db
```- Flask app:
```bash
flask --debug run --cert=adhoc
```### :2nd_place_medal: Option 2
Run the database with docker and the app with flask using your certificate.
- Database:
```bash
docker compose -f "compose.yaml" up -d --build adminer db
```- Flask app:
```bash
flask --debug run --cert=cert.pem --key=key.pem
```### :3rd_place_medal: Option 3
Run the database and the flask app with docker. This option use a cert and key.
In this option Flask run over gunicorn.- Database and flask app:
```bash
docker compose -f "compose.yaml" up -d --build
```## :pushpin: Features
- [x] Google Auth login
- [x] Sign up new users
- [x] Bootstrap
- [x] Flask
- [x] Alembic
- [x] Docker
- [x] Docker compose