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

Web foundation #27

Merged
merged 8 commits into from
Feb 6, 2024
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
17 changes: 17 additions & 0 deletions .cfignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
__pycache__/
.github/
.pytest_cache
control/
documentation/
node_modules/
storage/

.cfignore
.coverage
.coveragerc
.dockerignore
.env
.flake8
.gitignore
sample.env
start_local.sh
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[flake8]
max-line-length = 88
exclude = venv,.git,__pycache__,docs/source/conf.py,old,build,dist
exclude = venv,.git,__pycache__,docs/source/conf.py,old,build,dist,node_modules
ignore = F403, F401
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,7 @@ storage/
control/

# Zipped artifacts
*.zip
*.zip

# frontend dependencies
node_modules/
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,16 @@ cp sample.env .env

Update all settings defaulted to `<add_a_key_here>`.

Run the following command to build the app and start up its services:
Install frontend dependencies and run in development mode:

```bash
cd nad_ch/controllers/web
npm install
npm run dev
```

Return to the project's root directory and run the following command to build
the app and start up its services:

```bash
docker compose up --build
Expand Down
4 changes: 1 addition & 3 deletions nad_ch/application/use_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ def ingest_data_submission(
ctx.logger.error(f"Failed to process submission: {e}")


def list_data_submissions_by_provider(
ctx: ApplicationContext, provider_name: str
) -> List[DataSubmission]:
def list_data_submissions_by_provider(ctx: ApplicationContext, provider_name: str):
provider = ctx.providers.get_by_name(provider_name)
if not provider:
ctx.logger.error("Provider with that name does not exist")
Expand Down
11 changes: 0 additions & 11 deletions nad_ch/cli.py

This file was deleted.

Empty file.
18 changes: 18 additions & 0 deletions nad_ch/controllers/web/flask.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import os
from flask import Flask
from nad_ch.application.interfaces import ApplicationContext
from nad_ch.controllers.web.routes import home_bp


def create_flask_application(ctx: ApplicationContext):
template_folder = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "templates"
)

app = Flask(__name__, template_folder=template_folder, static_folder="dist")

app.extensions["ctx"] = ctx

app.register_blueprint(home_bp)

return app
Loading
Loading