-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add black tool config * Add missing backend env files * Updated with development docs * Lint
- Loading branch information
Showing
25 changed files
with
139 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,53 @@ | ||
# CoPilot | ||
|
||
SOCFortress CoPilot | ||
|
||
# Development | ||
|
||
## Local development of backend | ||
|
||
Setup the env vars, adjust if required. | ||
|
||
``` | ||
cd backend | ||
cp .env.example .env | ||
``` | ||
|
||
Create and activate python, installing dependencies | ||
|
||
``` | ||
python3.11 -m venv.venv --copies | ||
source .venv/bin/activate | ||
pip install -U pip setuptools wheel | ||
pip install -r requirements.in | ||
``` | ||
|
||
Create a DB and apply any pending DB migrations | ||
|
||
``` | ||
FLASK_APP=copilot.py flask db upgrade | ||
``` | ||
|
||
Start local dev server | ||
|
||
``` | ||
python3 app.py | ||
``` | ||
|
||
If there any changes made to the model run the migrate command (example commment) | ||
and if any changes were detected, update your local DB instance. | ||
|
||
``` | ||
FLASK_APP=copilot.py flask db migrate -m "Add User model." | ||
FLASK_APP=copilot.py flask db upgrade | ||
``` | ||
|
||
See https://flask-migrate.readthedocs.io/en/latest/ for further information | ||
|
||
# Deployment | ||
|
||
## Production Deployment Notes | ||
|
||
``` | ||
pip install -r requirements.txt | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
DEBUG=True | ||
SECRET_KEY="not so secret" | ||
ENV=development | ||
SQLALCHEMY_TRACK_MODIFICATIONS=True | ||
UPLOAD_FOLDER="/tmp/copilot_uploads" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
DEBUG=False | ||
SECRET_KEY="not so secret" | ||
ENV=production | ||
SQLALCHEMY_DATABASE_URI="postgresql://postgres:root@localhost:5432/copilot" | ||
SQLALCHEMY_TRACK_MODIFICATIONS=False | ||
UPLOAD_FOLDER="/opt/socfortress/copilot/uploads" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.