Skip to content

Commit 2fcc08e

Browse files
authored
Chore/fresh start (#19)
* remove django implementation * cleanup unwanted packages; update poetry and npm * remove old scripts * changelog; readme; fix AWS service name; * sync versions to 0.2.0; configure setup.cfg; add import test; fix pyproject.toml;
1 parent 5ff7b6a commit 2fcc08e

File tree

61 files changed

+5257
-5910
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+5257
-5910
lines changed

.bumpversion.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.1.3
2+
current_version = 0.2.0
33
commit = True
44
tag = False
55

@@ -11,6 +11,6 @@ replace = version = "{new_version}"
1111
search = "version": "{current_version}",
1212
replace = "version": "{new_version}",
1313

14-
[bumpversion:file:nzshm_model_graphql_api/__init__.py]
14+
[bumpversion:file:nshm_model_graphql_api/__init__.py]
1515
search = __version__ = "{current_version}"
1616
replace = __version__ = "{new_version}"

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
4+
## [0.2.0] 2024-05-30
5+
- Complete reset, no more django
6+
- all previous code is mothballed
7+
38
## [0.1.3] - 2023-09-04
49
## Added
510
- new about and version resolvers

README.md

Lines changed: 11 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,27 @@
1-
ref: https://docs.graphene-python.org/projects/django/en/latest/tutorial-relay/
2-
1
31

4-
## the Sqlite3 on lambda issue
2+
# nshm-model-graphql-api
53

6-
This project is a good candidate for using a sqlite3 database, especially in the exploratory, POC stages.
4+
A GRAPHQL API for the nzshm-model libary .
75

8-
But we had to solve some compatablity issues to get this working on AWS lambda . [See this guide](./SQLITE_CUSTOM_LAMBDA_BUILD.md) for more info.
6+
Using Flask with Serverless framework to operate as a AWS Lambda API.
97

10-
## Some Useful commands
11-
12-
### build an ERM model
13-
requires graphviz libraries installed `sudo apt install graphviz`
14-
15-
```
16-
poetry run python manage.py graph_models -o nshm_model.png nshm pipeline
17-
```
18-
19-
### Load data using djanog-extension helpers
8+
The graphql API documentation is served by default from the service root.
209

21-
```
22-
# build the script
23-
poetry run python manage.py dumpscript nshm.OpenquakeHazardTask >scripts/nshm_openquake_hazard_task.py
24-
# edit then run script ...
25-
poetry run python manage.py runscript scripts.nshm_openquake_hazard_task
26-
```
2710

28-
### Dump/Load data to json
11+
## Getting started
2912

3013
```
31-
poetry run python manage.py dumpdata nshm.OpenquakeHazardTask -o pipeline/fixtures/oht.json --indent=2
32-
poetry run python manage.py loaddata pipeline/fixtures/oht.json
14+
poetry install
15+
npm install --save serverless
16+
npm install --save serverless-python-requirements
17+
npm install --save serverless-wsgi
18+
npm install --save serverless-plugin-warmup
3319
```
3420

35-
### update static files
36-
37-
These are just the static components for admin and graphiql
38-
39-
```
40-
poetry run python manage.py collectstatic -c
41-
```
42-
43-
### run server options
44-
45-
```
46-
poetry run python manage.py runserver
47-
poetry run python manage.py runserver_plus
48-
```
21+
## Some Useful commands
4922

5023
```
5124
poetry shell
5225
npx sls wsgi serve
5326
```
5427

55-
### AWS OpenSearch integration
56-
57-
Alert we use [email protected]:daily-science/django-elasticsearch-dsl.git fork for now. This should be PR'd onto the main project.
58-
59-
This project now has ES settings and uses the above to maintain indexes as the django SQL db is maintained.
60-
61-
You can also maintain the indexes via new manage.py commaneds e.g:
62-
63-
```
64-
DEBUG=1 poetry run python manage.py search_index --create
65-
DEBUG=1 poetry run python manage.py search_index --populate
66-
DEBUG=1 poetry run python manage.py search_index --rebuild
67-
DEBug=1 poetry run python manage.py search_index --help
68-
```

SQLITE_CUSTOM_LAMBDA_BUILD.md

Lines changed: 0 additions & 157 deletions
This file was deleted.
-8.05 MB
Binary file not shown.

db.sqlite3

-240 KB
Binary file not shown.

manage.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

nshm/__init__.py

Whitespace-only changes.

nshm/admin.py

Lines changed: 0 additions & 70 deletions
This file was deleted.

nshm/apps.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)