Skip to content

Added Docs to README #25

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

Merged
merged 3 commits into from
Mar 11, 2023
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
45 changes: 44 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,47 @@ Front-end for the Devcade website that allows members to view the game catalog a

`cd src`

`flask run`
`flask run`

# Project Structure
This project follows a standard template for a Flask project. Below is the basic file structure of the project, with every file described other than those in the `static/` folder (for brevity).

```
devcade-website
| src/
| | static/ // Static content (images, css, js)
| | templates/ // Header and content templates
| | | header.html // Includes game block macro and header block macro
| | | game.html // Game focus page
| | | catalog.html // Game catalog page
| | | credits.html // Game credits page (using game blocks)
| | | error.html // Error page
| | | home.html // Main page, includes project details
| | | upload.html // Game upload page, including instructions
| | | profile.html // User profile -- not implemented
| app.py // Main file
| auth.py // Helper functions for handling CSH auth
| config.py // Environment variable getters
| init.py // Initialization for flask project
| models.py // User model
| envs.py // Environment variable setters (Follows template described in Local Development section)
```

# Local Development
If you would like to run this project using your local machine, first create a `envs.py` file with the following structure:

```
import os

os.environ['SERVER_NAME'] = ''
os.environ['PREFERRED_URL_SCHEME'] = ''
os.environ["OIDC_CLIENT_SECRET"] = ""
os.environ["DEVCADE_DB_PORT"] = ""
os.environ["DEVCADE_DB_NAME"] = ""
os.environ["DEVCADE_DB_USER"] = ""
os.environ["DEVCADE_DB_PASS"] = ""
os.environ["DEVCADE_DB_URI"] = ""
os.environ["DEVCADE_API_URI"] = ""
```

Note that this is just a template for the `envs.py` file. You will need to get these secrets from an RTP or Devcade developer.
4 changes: 3 additions & 1 deletion src/templates/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ <h3>{{ game.author }}</h3>
</div>
</a>
{% endif %}
{% endmacro %} {% block header %}
{% endmacro %}

{% block header %}
<!DOCTYPE html>
<html lang="en">
<head>
Expand Down