Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend documentation and workspace disclaimers #20

Merged
merged 4 commits into from
Aug 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Procfile

This file was deleted.

3 changes: 2 additions & 1 deletion backend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
__pycache__
__pycache__
node_modules/
34 changes: 32 additions & 2 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

The restful API is deployed at [cheathub-backend.herokuapp.com/](https://cheathub-backend.herokuapp.com/)

> *Note:* Open API spec is forthcoming. Please see `database/models.py` to preview the snippet, collection and user document models.

## Heroku Deployment
```bash
#create new git repository and add everything
Expand Down Expand Up @@ -47,9 +49,9 @@ In this half of the monorepo, you can run:

Serves the Databse backend.\
Runs the backend app in the development mode.\
Open [http://localhost:5000/admin](http://localhost:5000/admin) to view the admin panel in the browser.
Open [http://localhost:5000/admin](http://localhost:5000/admin) to view the admin panel in the browser (ensure `BASIC_AUTH` variables are set).

Open [http://localhost:5000/api/snippets](http://localhost:5000/api/snippets) to view the JSON response format of all public snippets.
Open [http://localhost:5000/api/snippets](http://localhost:5000/api/snippets) to view the JSON response format of all public snippets -- assuming `snippet` objects have been created. Otherwise, use Postman to create documents locally (API spec is forthcoming!).

The page will reload if you make edits.\
You will also see any errors in the console.
Expand Down Expand Up @@ -103,6 +105,33 @@ Set the variable to this key:
# env.py
os.environ.setdefault("JWT_SECRET_KEY", "<your JWT secret key>")
```
### `BASIC_AUTH_USERNAME`

Superuser username to access admin panel at `/admin`

Set the variable to this key:
```python
# env.py
os.environ.setdefault("BASIC_AUTH_USERNAME", "<your superuser username>")
```

### `BASIC_AUTH_PASSWORD`

Superuser password to access admin panel at `/admin`

Set the variable to this key:
```python
# env.py
os.environ.setdefault("BASIC_AUTH_USERNAME", "<your superuser password>")
```
### Flask Mail Option
> See [Flask Mail](https://pythonhosted.org/Flask-Mail/)
Similarly, apply the same logic to:
- `MAIL_SERVER`
- `MAIL_PORT`
- `MAIL_USERNAME`
- `MAIL_PASSWORD`
- `MAIL_DEFAULT_SENDER`

## Database Server

Expand Down Expand Up @@ -139,6 +168,7 @@ You can add documents via Postman or Mongo Compass.
- [Flask Admin](https://flask-admin.readthedocs.io/en/latest/)
- [Flask Session](https://flask-session.readthedocs.io/en/latest/)
- [Flask Restful](https://flask-restful.readthedocs.io/en/latest/)
- [Flask Mail](https://pythonhosted.org/Flask-Mail/)

## Resources
- [Heroku Deployment](https://stackoverflow.com/questions/7539382/how-can-i-deploy-push-only-a-subdirectory-of-my-git-repo-to-heroku)
Expand Down
50 changes: 0 additions & 50 deletions requirements.txt

This file was deleted.