Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
1ed7eea
lint multiline script
JozefTkocz Jul 18, 2024
d9e8a05
revert
JozefTkocz Jul 18, 2024
1d68ce5
should fail type check
JozefTkocz Jul 18, 2024
20b1179
forgot to add files
JozefTkocz Jul 18, 2024
277c97a
run tests, fail type check
JozefTkocz Jul 18, 2024
ff313f3
pass type check fail test
JozefTkocz Jul 18, 2024
56261cd
fix yaml typo
JozefTkocz Jul 18, 2024
f0bef0b
force run
JozefTkocz Jul 18, 2024
69f9848
clean ecr resources with lifecycle rule
JozefTkocz Jul 20, 2024
baa3767
verify dynamodb connection
JozefTkocz Jul 20, 2024
04a4d85
why mypy not find stubs?
JozefTkocz Jul 20, 2024
97de3d9
mypy goes in lambdas folder
JozefTkocz Jul 20, 2024
f6f260d
mypy in each lambda individually
JozefTkocz Jul 30, 2024
119ed46
add terraform files
JozefTkocz Jul 30, 2024
c16595f
run pipeline again
JozefTkocz Jul 30, 2024
b7cddae
cd then mypy
JozefTkocz Jul 30, 2024
ea21838
add mypy as dev dependency
JozefTkocz Jul 30, 2024
1c54ed7
check and test in matrix
JozefTkocz Jul 30, 2024
4457b1a
fix path
JozefTkocz Jul 30, 2024
a15cc58
cd into folder
JozefTkocz Jul 30, 2024
8479898
forgot checkout
JozefTkocz Jul 30, 2024
fade2f7
fix backend api
JozefTkocz Jul 30, 2024
08756dc
fix dummy lambda
JozefTkocz Jul 30, 2024
9b996b9
confirm test fails pipeline
JozefTkocz Jul 30, 2024
0c680a1
install poetry
JozefTkocz Jul 30, 2024
9a65521
add powertools tracing
JozefTkocz Aug 1, 2024
fc4ee2f
use correct cmd arg
JozefTkocz Aug 2, 2024
334598b
use correct table name
JozefTkocz Aug 2, 2024
d45f19a
simplify backend monorepo structure
JozefTkocz Sep 24, 2024
ef06f39
simplify backend monorepo structure
JozefTkocz Sep 24, 2024
5e0e04d
try to programatically create a subscription
JozefTkocz Sep 25, 2024
819c137
include settings file
JozefTkocz Sep 25, 2024
6364c16
update sns permissions
JozefTkocz Sep 25, 2024
fbdc718
try git diff trigger
JozefTkocz Sep 27, 2024
2229fb7
iac for a static website
JozefTkocz Sep 27, 2024
f4839e0
add files
JozefTkocz Sep 27, 2024
02c9a18
attempt CI deployment for frontend
JozefTkocz Sep 27, 2024
ed463bc
add frontent ci workflow file
JozefTkocz Sep 27, 2024
6d269b6
set working directory for frontend
JozefTkocz Sep 27, 2024
cfe55d3
fix cli command
JozefTkocz Sep 27, 2024
3986c7c
linting and autoformatting
JozefTkocz Sep 28, 2024
bba1272
lint staged
JozefTkocz Sep 28, 2024
04a9540
lint staged
JozefTkocz Sep 28, 2024
9824f69
fix package json
JozefTkocz Sep 28, 2024
a472505
check pre commit hook
JozefTkocz Sep 28, 2024
9a6260c
check agian
JozefTkocz Sep 28, 2024
68b18c3
add package json to root
JozefTkocz Sep 28, 2024
68acc06
lint staged to root
JozefTkocz Sep 28, 2024
4188d97
delete files
JozefTkocz Sep 28, 2024
f8016f1
test
JozefTkocz Sep 28, 2024
a97dfb4
lint in precommit
JozefTkocz Sep 28, 2024
8494832
fix precommit
JozefTkocz Sep 28, 2024
87ffe56
fix lint command in ci
JozefTkocz Sep 28, 2024
5d545ee
start adding auth
JozefTkocz Oct 11, 2024
ac2e1a6
add files
JozefTkocz Oct 11, 2024
26a7c09
fix import
JozefTkocz Oct 11, 2024
9de0224
lint
JozefTkocz Oct 11, 2024
5786911
add cors
JozefTkocz Oct 11, 2024
22e0038
fix frontend build
JozefTkocz Oct 11, 2024
96793eb
see if that works
JozefTkocz Oct 11, 2024
d959da0
enable validation
JozefTkocz Oct 11, 2024
b4b0328
primary key is user id
JozefTkocz Oct 11, 2024
791fadd
try create new user
JozefTkocz Oct 11, 2024
c431993
fix import
JozefTkocz Oct 11, 2024
34dbdad
add type to key dynamodb
JozefTkocz Oct 11, 2024
3d56432
fix thing
JozefTkocz Oct 11, 2024
95a422f
item not always present
JozefTkocz Oct 11, 2024
e360db5
try to register new user
JozefTkocz Oct 12, 2024
7812a8c
check subscription
JozefTkocz Oct 12, 2024
4522302
more auth
JozefTkocz Oct 12, 2024
d6bcf46
put not update
JozefTkocz Oct 12, 2024
f6c6f6b
actually send emails
JozefTkocz Oct 12, 2024
ee4db15
add logger
JozefTkocz Oct 12, 2024
80f09e1
correct data type
JozefTkocz Oct 12, 2024
beb63c6
add new file
JozefTkocz Oct 12, 2024
730ff5a
try fix table item update
JozefTkocz Oct 12, 2024
ec19436
lint
JozefTkocz Oct 12, 2024
48d2811
debug
JozefTkocz Oct 12, 2024
f4d846d
lint
JozefTkocz Oct 12, 2024
2322684
try fix get item
JozefTkocz Oct 12, 2024
3f72b34
fix otp expiry logic error
JozefTkocz Oct 12, 2024
4473c4b
invalidate the otp
JozefTkocz Oct 12, 2024
7c363c2
add todo
JozefTkocz Oct 12, 2024
bc8b6dc
specify concrete type
JozefTkocz Oct 12, 2024
2cd58a4
another logic error
JozefTkocz Oct 12, 2024
98713bb
log api call response
JozefTkocz Oct 13, 2024
aad544a
add untracked files
JozefTkocz Oct 13, 2024
74fe4c4
try write to s3
JozefTkocz Oct 14, 2024
96076b3
encode file object
JozefTkocz Oct 14, 2024
ba2f7db
use correct bucket name
JozefTkocz Oct 14, 2024
165b236
attempt to store login in token
JozefTkocz Oct 20, 2024
40e5e07
rename file
JozefTkocz Oct 20, 2024
341eb78
rename file
JozefTkocz Oct 20, 2024
b290aef
encode string before write
JozefTkocz Oct 20, 2024
4f96427
use correct s3 bucket name
JozefTkocz Oct 20, 2024
95cb0ec
does this fix cookies?
JozefTkocz Oct 20, 2024
7201e42
set CORS
JozefTkocz Oct 20, 2024
5c19b38
dont use cookies
JozefTkocz Oct 20, 2024
bb8fd2e
incorrect cors
JozefTkocz Oct 20, 2024
208af5f
undo cors changes
JozefTkocz Oct 20, 2024
8ed3622
why not working?
JozefTkocz Oct 20, 2024
b961c2d
remove frontend api url
JozefTkocz Oct 20, 2024
fd84368
response validation error
JozefTkocz Oct 20, 2024
4c3feed
error handling
JozefTkocz Oct 30, 2024
241573b
update readme
JozefTkocz Oct 30, 2024
49054f8
pass lint step
JozefTkocz Oct 30, 2024
4ab2297
add type hints for requests library
JozefTkocz Oct 30, 2024
3bdcec0
fix type check
JozefTkocz Oct 30, 2024
ba841e4
remove dummy lambda
JozefTkocz Nov 22, 2024
e8c2eb8
merge
JozefTkocz Nov 22, 2024
7bb2e4e
fix config
JozefTkocz Nov 22, 2024
f379660
handle incorrect login attempts
JozefTkocz Nov 22, 2024
559cddf
attempt to check login
JozefTkocz Nov 22, 2024
d711168
linting
JozefTkocz Nov 22, 2024
9da7f27
allow auth header
JozefTkocz Nov 22, 2024
865df40
check login
JozefTkocz Nov 22, 2024
b64c856
handle in middleware
JozefTkocz Nov 22, 2024
7f4f935
fix typecheck
JozefTkocz Nov 22, 2024
31b2a38
make a module
JozefTkocz Nov 22, 2024
11a5c83
fix circular imports@
JozefTkocz Nov 22, 2024
4ddb603
fix imports
JozefTkocz Nov 22, 2024
2ce7e27
fix arg handling
JozefTkocz Nov 22, 2024
1534246
try again
JozefTkocz Nov 22, 2024
9a4a5be
log middleware
JozefTkocz Nov 22, 2024
07a80b3
using router
JozefTkocz Nov 22, 2024
c516406
add args in
JozefTkocz Nov 22, 2024
44ae24f
use context
JozefTkocz Nov 22, 2024
8601bc6
properly build model from dict
JozefTkocz Nov 22, 2024
080cfb7
actually check for token validity
JozefTkocz Nov 23, 2024
b11b59c
also check expiry
JozefTkocz Nov 23, 2024
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
89 changes: 34 additions & 55 deletions .github/workflows/build_backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,96 +10,79 @@ on:
- .github/**
jobs:
Lint:
runs-on:
ubuntu-latest
runs-on: ubuntu-latest
defaults:
# todo: DRY this to work with multiple lambdas
run:
working-directory: ./lambdas/backend_api
steps:
-
name: checkout
uses: actions/checkout@v4
-
name: Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.10'
-
name: Install Poetry
uses: snok/install-poetry@v1
-
name: install dependencies
run: poetry install --no-interaction
-
name: Python lint
run: poetry run ruff check
-
name: Python format check
run : poetry run ruff format
- name: checkout
uses: actions/checkout@v4
- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Poetry
uses: snok/install-poetry@v1
- name: install dependencies
run: poetry install --no-interaction
- name: Python lint
run: poetry run ruff check
- name: Python format check
run: poetry run ruff format

Test:
needs: Lint
strategy:
matrix:
lambda_name: ["backend_api", "dummy_lambda"]
lambda_name: ["backend_api"]
runs-on: ubuntu-latest
defaults:
run:
working-directory: lambdas/${{matrix.lambda_name}}
steps:
-
name: checkout
- name: checkout
uses: actions/checkout@v4
-
name: Set up Python
- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.10'
-
name: Install Poetry
python-version: "3.10"
- name: Install Poetry
uses: snok/install-poetry@v1
-
name: install dependencies
- name: install dependencies
run: poetry install --no-interaction
-
name: Type Check
- name: Type Check
run: poetry run mypy .
-
name: Unit Test
- name: Unit Test
run: poetry run pytest .

DeployStaging:
needs:
- Test
strategy:
matrix:
lambda_name: ["backend_api", "dummy_lambda"]
lambda_name: ["backend_api"]
runs-on: ubuntu-latest
steps:
-
name: checkout
- name: checkout
uses: actions/checkout@v4
-
name: Configure AWS Credentials
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{vars.AWS_REGION}}
aws-access-key-id: ${{secrets.AWS_ACCESS_KEY_ID}}
aws-secret-access-key: ${{secrets.AWS_SECRET_ACCESS_KEY}}
-
name: Build and push Docker image
- name: Build and push Docker image
run: |
make build_and_push_docker_image \
region=${{vars.AWS_REGION}} \
account_id=${{secrets.ACCOUNT_ID}} \
prefix=${{env.APP_NAME}}-staging- \
lambda_name=${{matrix.lambda_name}} \
build_no=${{github.run_id}}
-
name: Update Lambda function
- name: Update Lambda function
run: |
make update_lambda_with_latest_image \
prefix=${{env.APP_NAME}}-staging- \
Expand All @@ -115,30 +98,26 @@ jobs:
- DeployStaging
strategy:
matrix:
lambda_name: ["backend_api", "dummy_lambda"]
lambda_name: ["backend_api"]
runs-on: ubuntu-latest
steps:
-
name: checkout
- name: checkout
uses: actions/checkout@v4
-
name: Configure AWS Credentials
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{vars.AWS_REGION}}
aws-access-key-id: ${{secrets.AWS_ACCESS_KEY_ID}}
aws-secret-access-key: ${{secrets.AWS_SECRET_ACCESS_KEY}}
-
name: Build and push Docker image
- name: Build and push Docker image
run: |
make build_and_push_docker_image \
region=${{vars.AWS_REGION}} \
account_id=${{secrets.ACCOUNT_ID}} \
prefix=${{env.APP_NAME}}-production- \
lambda_name=${{matrix.lambda_name}} \
build_no=${{github.run_id}}
-
name: Update Lambda function
- name: Update Lambda function
run: |
make update_lambda_with_latest_image \
prefix=${{env.APP_NAME}}-production- \
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ initialise_all_ecrs:

outputs_to_env:
cd $(TERRAFORM_DIR) && \
terraform output >> ../lambdas/resources.env && \
terraform output >> ../frontend/.env
terraform output > ../lambdas/backend_api/resources.env && \
terraform output > ../frontend/.env

# =============================================================================
# Docker
Expand Down
8 changes: 7 additions & 1 deletion frontend/.env
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
BACKEND_API_URL = 'http://redacted.website'
backend_api_ecr_url = "979058445641.dkr.ecr.us-west-2.amazonaws.com/tumpr-staging-backend_api"
BACKEND_API_URL = "https://3eo5qtv2dln5khtesgthtmntiy0asccs.lambda-url.us-west-2.on.aws/"
frontend_ui_url = "string"
object_lock_table = "string"
object_storage_s3 = "string"
user_notifications_sns_arn = "arn:aws:sns:us-west-2:979058445641:user-notifications-topic"
users_table = "string"
Loading