Compare commits

...

73 Commits

Author SHA1 Message Date
baedfc1675 Merge pull request 'adding infisical action to workflows' (#145) from 141-update-workflows-with-infisical into main
All checks were successful
Main / changes (push) Successful in 19s
Main / build-and-test (push) Has been skipped
Main / deploy (push) Has been skipped
Reviewed-on: #145
2026-07-13 12:10:51 -04:00
4eccf8e83c Merge branch 'main' into 141-update-workflows-with-infisical
All checks were successful
Pull Request / changes (pull_request) Successful in 15s
Pull Request / build-and-test (pull_request) Has been skipped
Pull Request / terraform-plan (pull_request) Has been skipped
2026-07-13 12:09:40 -04:00
a4778d29be adding infisical action to workflows
All checks were successful
Pull Request / changes (pull_request) Successful in 22s
Pull Request / build-and-test (pull_request) Has been skipped
Pull Request / terraform-plan (pull_request) Has been skipped
2026-07-13 11:09:06 -05:00
5c04870d37 Merge pull request '141-update-workflows-with-infisical' (#144) from 141-update-workflows-with-infisical into main
All checks were successful
Main / changes (push) Successful in 23s
Main / build-and-test (push) Has been skipped
Main / deploy (push) Successful in 2m38s
Reviewed-on: #144
2026-07-13 12:01:20 -04:00
c81b514ae8 Merge branch 'main' into 141-update-workflows-with-infisical
All checks were successful
Pull Request / changes (pull_request) Successful in 14s
Pull Request / build-and-test (pull_request) Has been skipped
2026-07-13 11:58:17 -04:00
5a07318527 adding infisical action to workflows
All checks were successful
Pull Request / changes (pull_request) Successful in 23s
Pull Request / build-and-test (pull_request) Has been skipped
2026-07-13 10:57:19 -05:00
99e5d162ef adding infisical action to workflows 2026-07-13 10:56:52 -05:00
755c429d04 Merge pull request 'adding infisical action to workflows' (#143) from 141-update-workflows-with-infisical into main
Some checks failed
Main / changes (push) Successful in 18s
Main / build-and-test (push) Has been skipped
Main / deploy (push) Failing after 7s
Reviewed-on: #143
2026-07-13 11:50:29 -04:00
6ea7326a57 adding infisical action to workflows
All checks were successful
Pull Request / changes (pull_request) Successful in 22s
Pull Request / build-and-test (pull_request) Has been skipped
2026-07-13 10:48:28 -05:00
e3f385d0a4 Merge pull request 'adding infisical action to workflows' (#142) from 141-update-workflows-with-infisical into main
Some checks failed
Main / changes (push) Successful in 24s
Main / build-and-test (push) Failing after 21s
Main / deploy (push) Failing after 7s
Reviewed-on: #142
2026-07-13 11:42:21 -04:00
f33a9982cc adding infisical action to workflows
All checks were successful
Pull Request / changes (pull_request) Successful in 18s
Pull Request / build-and-test (pull_request) Successful in 1m50s
2026-07-13 10:33:45 -05:00
100fd78551 adding infisical action to workflows
Some checks failed
Pull Request / changes (pull_request) Successful in 23s
Pull Request / build-and-test (pull_request) Failing after 20s
2026-07-13 09:31:14 -05:00
a87d35a5e4 adding infisical action to workflows
All checks were successful
Pull Request / changes (pull_request) Successful in 23s
Pull Request / build-and-test (pull_request) Successful in 1m49s
2026-07-13 09:25:17 -05:00
0c4fe29553 adding infisical action to workflows
Some checks failed
Pull Request / changes (pull_request) Successful in 17s
Pull Request / build-and-test (pull_request) Failing after 19s
2026-07-13 09:20:14 -05:00
03c4dacd99 adding infisical action to workflows
Some checks failed
Pull Request / changes (pull_request) Successful in 23s
Pull Request / build-and-test (pull_request) Failing after 20s
2026-07-13 09:15:51 -05:00
1ed1a6c48a adding infisical action to workflows
Some checks failed
Pull Request / changes (pull_request) Successful in 19s
Pull Request / build-and-test (pull_request) Failing after 16s
2026-07-13 08:51:16 -05:00
4c77ebc1d6 adding infisical action to workflows
Some checks failed
Pull Request / changes (pull_request) Successful in 23s
Pull Request / build-and-test (pull_request) Failing after 3s
2026-07-13 08:49:43 -05:00
650ea704aa adding infisical action to workflows
Some checks failed
Pull Request / changes (pull_request) Successful in 1m6s
Pull Request / build-and-test (pull_request) Failing after 2m51s
2026-07-13 08:43:03 -05:00
d51e95f59e adding infisical action to workflows
Some checks failed
Pull Request / changes (pull_request) Successful in 57s
Pull Request / build-and-test (pull_request) Failing after 4m0s
2026-07-13 08:04:16 -05:00
0806e114e1 fixing build and test workflow
All checks were successful
Main / changes (push) Successful in 18s
Main / build-and-test (push) Successful in 5m48s
Main / deploy (push) Successful in 2m28s
Tag / build (push) Successful in 5m51s
Tag / deploy (push) Successful in 2m27s
2026-05-31 06:21:20 -05:00
fc716c664b fixing build and test workflow
All checks were successful
Main / changes (push) Successful in 22s
Main / build-and-test (push) Successful in 5m46s
Main / deploy (push) Successful in 2m34s
2026-05-31 06:09:58 -05:00
5a1e24a1ce updating version to 2.1.5
All checks were successful
Main / changes (push) Successful in 26s
Main / build-and-test (push) Successful in 5m58s
Main / deploy (push) Successful in 2m33s
2026-05-31 05:51:16 -05:00
b93327f840 updating log interceptor for read role
All checks were successful
Main / changes (push) Successful in 18s
Main / build-and-test (push) Successful in 5m49s
Main / deploy (push) Successful in 2m27s
2026-05-21 08:10:48 -05:00
bbcf6cb3de updating log interceptor for read role
Some checks failed
Main / changes (push) Successful in 24s
Main / build-and-test (push) Successful in 5m49s
Main / deploy (push) Failing after 2m24s
2026-05-21 07:44:36 -05:00
344d4f5625 updating log interceptor for read role
Some checks failed
Main / changes (push) Successful in 23s
Main / build-and-test (push) Successful in 5m51s
Main / deploy (push) Failing after 21s
2026-05-21 07:35:42 -05:00
22fbf7615b updating log interceptor for read role
Some checks failed
Main / changes (push) Successful in 18s
Main / build (push) Failing after 32s
Main / deploy (push) Has been skipped
2026-05-21 07:30:57 -05:00
5a84c221d6 updating log interceptor for read role
Some checks failed
Main / changes (push) Successful in 22s
Main / build (push) Successful in 6m15s
Main / deploy (push) Failing after 18s
2026-05-20 22:12:51 -05:00
13f1e86e72 Merge pull request '133-read-role-returns-500-from-api' (#135) from 133-read-role-returns-500-from-api into main
All checks were successful
Main / changes (push) Successful in 23s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
Reviewed-on: #135
2026-05-20 23:10:54 -04:00
25f935171e updating log interceptor for read role
All checks were successful
Pull Request / changes (pull_request) Successful in 23s
Pull Request / build-and-test (pull_request) Successful in 1m48s
2026-05-20 22:07:33 -05:00
92fec88ad1 updating log interceptor for read role (#134)
Some checks failed
Main / changes (push) Successful in 25s
Main / build (push) Successful in 7m32s
Main / deploy (push) Failing after 48s
Reviewed-on: #134
Co-authored-by: noahspannbauer <noahspannbauer@icloud.com>
Co-committed-by: noahspannbauer <noahspannbauer@icloud.com>
2026-05-20 22:37:05 -04:00
833b1b107c updating log interceptor for read role
All checks were successful
Pull Request / changes (pull_request) Successful in 23s
Pull Request / build-and-test (pull_request) Successful in 4m15s
2026-05-20 21:31:16 -05:00
674ae1cf3c updating log interceptor for read role
All checks were successful
Pull Request / changes (pull_request) Successful in 25s
Pull Request / build (pull_request) Has been skipped
2026-05-20 21:27:06 -05:00
f0b61703b7 renaming .github to .gitea
All checks were successful
Main / changes (push) Successful in 26s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-19 12:41:38 -05:00
c152f06b63 renaming .github to .gitea
All checks were successful
Main / changes (push) Successful in 59s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-19 12:39:48 -05:00
3c9d26e085 renaming .github to .gitea
All checks were successful
Main / changes (push) Successful in 11s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-19 12:20:37 -05:00
12b4f1a65b renaming .github to .gitea
Some checks failed
Main / changes (push) Failing after 7s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-19 08:19:28 -05:00
ae03c0200c renaming .github to .gitea
Some checks failed
Main / changes (push) Failing after 7s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-19 08:16:08 -05:00
b9668a9d48 renaming .github to .gitea
Some checks failed
Main / changes (push) Failing after 7s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-19 08:12:07 -05:00
19041e3967 renaming .github to .gitea
Some checks failed
Main / changes (push) Failing after 1m41s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-19 08:08:55 -05:00
5729c72fe1 renaming .github to .gitea
All checks were successful
Main / changes (push) Successful in 7s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-19 08:07:15 -05:00
8760998c78 renaming .github to .gitea
Some checks failed
Main / changes (push) Failing after 7s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-19 08:05:59 -05:00
61f8dc0e1e renaming .github to .gitea
Some checks failed
Main / changes (push) Failing after 7s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-19 08:04:05 -05:00
cc7b694fd5 renaming .github to .gitea
Some checks failed
Main / changes (push) Failing after 7s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-19 08:02:14 -05:00
9553c2ec34 renaming .github to .gitea
Some checks failed
Main / changes (push) Failing after 7s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-19 07:59:57 -05:00
0a8c461e3d renaming .github to .gitea
Some checks failed
Main / changes (push) Failing after 7s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-19 07:54:43 -05:00
931d56e753 renaming .github to .gitea
Some checks failed
Main / changes (push) Failing after 7s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-19 07:50:58 -05:00
7ebf78f348 renaming .github to .gitea
Some checks failed
Main / changes (push) Failing after 58s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-19 07:41:50 -05:00
95e2d59abc renaming .github to .gitea
All checks were successful
Main / changes (push) Successful in 3s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-19 07:40:54 -05:00
945081dd7c renaming .github to .gitea
Some checks failed
Main / changes (push) Failing after 8s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-19 07:39:04 -05:00
7213dcf9e1 renaming .github to .gitea
Some checks failed
Main / changes (push) Failing after 21s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-19 07:38:04 -05:00
a13ffeaebd renaming .github to .gitea
Some checks failed
Main / changes (push) Failing after 22s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-19 07:34:15 -05:00
620b258e94 renaming .github to .gitea
Some checks failed
Main / changes (push) Failing after 21s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-19 07:22:46 -05:00
cc21a43825 renaming .github to .gitea
Some checks failed
Main / changes (push) Failing after 26s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-19 07:18:07 -05:00
112b56080c renaming .github to .gitea
Some checks failed
Main / changes (push) Failing after 1m12s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-19 07:14:06 -05:00
92f97a93bf renaming .github to .gitea
Some checks failed
Main / changes (push) Failing after 9s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-19 07:12:40 -05:00
4f6e9a072c renaming .github to .gitea
Some checks failed
Main / changes (push) Failing after 1m49s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-18 20:34:54 -05:00
0c8e4b9fba renaming .github to .gitea
Some checks failed
Main / changes (push) Failing after 58s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-18 20:21:39 -05:00
63d2765d19 renaming .github to .gitea
Some checks failed
Main / changes (push) Failing after 4m59s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-18 20:12:52 -05:00
da76000b8d renaming .github to .gitea
Some checks failed
Main / changes (push) Failing after 1m47s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-18 19:56:36 -05:00
b789e1264a renaming .github to .gitea
Some checks failed
Main / changes (push) Failing after 0s
Main / build (push) Has been skipped
Main / deploy (push) Has been skipped
2026-05-18 19:42:09 -05:00
9cc86fe79f renaming .github to .gitea 2026-05-18 19:22:36 -05:00
ee0e10072c updating version number 2026-04-26 17:19:20 -05:00
899f92f342 126 all logs shown when unauthenticated (#131)
* fixing all logs showing when user is unauthenticated

* updating api log interceptor

* updating api log interceptor

* updating api log interceptor

* logbook page unauthenticated alert
2026-04-26 17:08:34 -05:00
5c4245179f 126 all logs shown when unauthenticated (#130)
* fixing all logs showing when user is unauthenticated

* updating api log interceptor

* updating api log interceptor

* updating api log interceptor
2026-04-18 11:37:23 -07:00
a7a9f01fd9 126 all logs shown when unauthenticated (#129)
* fixing all logs showing when user is unauthenticated

* updating api log interceptor

* updating api log interceptor
2026-04-18 11:09:50 -07:00
a367b517db updating api log interceptor (#128)
* fixing all logs showing when user is unauthenticated

* updating api log interceptor
2026-04-16 06:31:28 -07:00
fd514e4c8b fixing all logs showing when user is unauthenticated (#127) 2026-04-07 20:44:21 -05:00
d8513e6dd0 fixing logbook skip take order by (#125) 2026-03-23 20:19:58 -05:00
5de5a165da 122 fix flights skip take and order by (#123)
* fixing flights skip take order by

* fixing flights skip take order by

* fixing flights skip take order by
2026-03-22 10:19:06 -05:00
26c46fe6e8 updating verison number to 2.1.0 2026-03-22 09:44:06 -05:00
04e5e3e16b 119 fix pilot page responsiveness (#121)
* fixing pilot page responsiveness

* fixing pilot page responsiveness
2026-03-22 09:27:15 -05:00
0305b424eb fixing pilot page responsiveness (#120) 2026-03-22 09:14:24 -05:00
8652544471 115 add load more button to logbook mobile view (#118)
* fixing logbook page responsiveness

* fixing logbook page responsiveness

* fixing logbook page responsiveness

* fixing logbook page responsiveness
2026-03-21 20:57:22 -05:00
24 changed files with 308 additions and 126 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -15,12 +15,22 @@ jobs:
environment: ${{ inputs.environment_name }} environment: ${{ inputs.environment_name }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
with: with:
sparse-checkout: | sparse-checkout: |
api api
client client
- name: Get Secrets from Infisical
uses: Infisical/secrets-action@v1.0.16
with:
domain: ${{ secrets.INFISICAL_DOMAIN }}
client-id: ${{ secrets.INFISICAL_CLIENT_ID }}
client-secret: ${{ secrets.INFISICAL_CLIENT_SECRET }}
project-slug: ${{ secrets.INFISICAL_PROJECT_SLUG }}
env-slug: ${{ inputs.environment_name }}
secret-path: /flying
- name: Install Nest CLI - name: Install Nest CLI
run: | run: |
npm install -g @nestjs/cli npm install -g @nestjs/cli
@@ -28,7 +38,7 @@ jobs:
- name: 'Setup Node' - name: 'Setup Node'
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: ${{ vars.NODE_VERSION }} node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies - name: Install dependencies
run: | run: |
@@ -44,21 +54,20 @@ jobs:
- name: Build Client - name: Build Client
env: env:
VITE_API_URL: ${{ vars.VITE_API_URL }} VITE_API_URL: ${{ env.VITE_API_URL }}
VITE_BASE_URL: ${{ vars.VITE_BASE_URL }} VITE_BASE_URL: ${{ env.VITE_BASE_URL }}
VITE_CLIENT_ID: ${{ vars.VITE_CLIENT_ID }} VITE_CLIENT_ID: ${{ env.VITE_CLIENT_ID }}
VITE_ISSUER_URI: ${{ vars.VITE_ISSUER_URI }} VITE_ISSUER_URI: ${{ env.VITE_ISSUER_URI }}
VITE_TENANT_ID: ${{ vars.VITE_TENANT_ID }} VITE_TENANT_ID: ${{ env.VITE_TENANT_ID }}
run: | run: |
printenv
npm run build -w client npm run build -w client
- name: Log into Docker Hub - name: Log into Docker Hub
if: ${{ github.event_name != 'pull_request' }} if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
username: ${{ vars.DOCKERHUB_USERNAME }} username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ env.DOCKERHUB_TOKEN }}
- name: Setup Docker Buildx - name: Setup Docker Buildx
if: ${{ github.event_name != 'pull_request' }} if: ${{ github.event_name != 'pull_request' }}

View File

@@ -7,6 +7,9 @@ on:
client: client:
value: ${{ jobs.changes.outputs.client }} value: ${{ jobs.changes.outputs.client }}
permissions:
contents: read
jobs: jobs:
changes: changes:
name: filter name: filter
@@ -15,7 +18,13 @@ jobs:
api: ${{ steps.filter.outputs.api }} api: ${{ steps.filter.outputs.api }}
client: ${{ steps.filter.outputs.client }} client: ${{ steps.filter.outputs.client }}
steps: steps:
- uses: actions/checkout@v3 - name: 'Setup Node'
uses: actions/setup-node@v6
with:
node-version: '22.x'
- name: Checkout
uses: actions/checkout@v4
- uses: dorny/paths-filter@v3 - uses: dorny/paths-filter@v3
id: filter id: filter
@@ -25,3 +34,5 @@ jobs:
- 'api/**' - 'api/**'
client: client:
- 'client/**' - 'client/**'
infrastructure:
- 'infrastructure/**'

View File

@@ -0,0 +1,44 @@
name: Deploy
on:
workflow_call:
inputs:
app_name:
required: true
type: string
environment_name:
required: true
type: string
version_number:
required: true
type: string
permissions:
id-token: write
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
environment: ${{ inputs.environment_name }}
steps:
- name: Get Secrets from Infisical
uses: Infisical/secrets-action@v1.0.16
with:
domain: ${{ secrets.INFISICAL_DOMAIN }}
client-id: ${{ secrets.INFISICAL_CLIENT_ID }}
client-secret: ${{ secrets.INFISICAL_CLIENT_SECRET }}
project-slug: ${{ secrets.INFISICAL_PROJECT_SLUG }}
env-slug: ${{ inputs.environment_name }}
secret-path: /flying
- name: Install Azure CLI
run: |
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
- name: Log in to Azure
run: |
az login --service-principal --username ${{ env.AZURE_CLIENT_ID }} --password ${{ env.AZURE_CLIENT_SECRET }} --tenant ${{ env.AZURE_TENANT_ID }}
- name: Update Container App
run: |
az containerapp update --name ${{ inputs.app_name }}-${{ inputs.environment_name }} --container-name ${{ inputs.app_name }} --resource-group ${{ env.RESOURCE_GROUP }} --image docker.io/noahspan/${{ inputs.app_name }}:${{ inputs.version_number }}

View File

@@ -6,14 +6,14 @@ on:
jobs: jobs:
changes: changes:
uses: ./.github/workflows/changes.yaml uses: ./.gitea/workflows/changes.yaml
build: build-and-test:
if: ${{ needs.changes.outputs.api == 'true' || needs.changes.outputs.client == 'true' }} if: ${{ needs.changes.outputs.api == 'true' || needs.changes.outputs.client == 'true' }}
name: build name: build-and-test
needs: needs:
- changes - changes
uses: ./.github/workflows/build_and_test.yaml uses: ./.gitea/workflows/build_and_test.yaml
with: with:
environment_name: test environment_name: test
version_number: ${{ github.run_id }} version_number: ${{ github.run_id }}
@@ -23,8 +23,8 @@ jobs:
name: deploy name: deploy
needs: needs:
- changes - changes
- build - build-and-test
uses: ./.github/workflows/deploy.yaml uses: ./.gitea/workflows/deploy.yaml
with: with:
app_name: flying app_name: flying
environment_name: test environment_name: test

View File

@@ -0,0 +1,29 @@
name: Pull Request
on:
pull_request:
jobs:
changes:
uses: ./.gitea/workflows/changes.yaml
build:
if: ${{ needs.changes.outputs.api == 'true' || needs.changes.outputs.client == 'true'}}
name: build-and-test
needs:
- changes
uses: ./.gitea/workflows/build_and_test.yaml
with:
environment_name: test
version_number: ${{ github.run_id }}
secrets: inherit
terraform:
if: ${{ needs.changes.outputs.infrastructure == 'true' }}
name: terraform-plan
needs:
- changes
uses: ./.gitea/workflows/infrastructure.yaml
with:
environment_name: test
secrets: inherit

View File

@@ -5,9 +5,9 @@ on:
- '**' - '**'
jobs: jobs:
build: build-and-test:
name: build name: build-and-test
uses: ./.github/workflows/build_and_test.yaml uses: ./.gitea/workflows/build_and_test.yaml
with: with:
environment_name: prod environment_name: prod
version_number: ${{ github.ref_name }} version_number: ${{ github.ref_name }}
@@ -16,8 +16,8 @@ jobs:
deploy: deploy:
name: deploy name: deploy
needs: needs:
- build - build-and-test
uses: ./.github/workflows/deploy.yaml uses: ./.gitea/workflows/deploy.yaml
with: with:
app_name: flying app_name: flying
environment_name: prod environment_name: prod

View File

@@ -0,0 +1,45 @@
name: 'Terraform'
on:
workflow_dispatch:
inputs:
environment_name:
type: string
jobs:
terraform:
runs-on: ubuntu-latest
environment:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: |
infrastructure
- name: Get Secrets from Infisical
uses: Infisical/secrets-action@v1.0.16
with:
domain: ${{ secrets.INFISICAL_DOMAIN }}
client-id: ${{ secrets.INFISICAL_CLIENT_ID }}
client-secret: ${{ secrets.INFISICAL_CLIENT_SECRET }}
project-slug: ${{ secrets.INFISICAL_PROJECT_SLUG }}
env-slug: ${{ inputs.environment_name }}
secret-path: /flying/terraform
- name: Setup Terraform
uses: hashicorp/setup-terraform@v4
- name: Terraform init
run: |
terraform -chdir=./infrastructure init -input=false
- name: Terraform plan
if: ${{ github.event_name == 'pull_request' }}
run: |
terraform -chdir=./infrastructure plan -no-color -input=false
- name: Terraform apply
if: ${{ github.event_name != 'pull_request' }}
run: |
terraform -chdir=./infrastructure apply -no-color -input=false

View File

@@ -1,35 +0,0 @@
name: Deploy
on:
workflow_call:
inputs:
app_name:
required: true
type: string
environment_name:
required: true
type: string
version_number:
required: true
type: string
permissions:
id-token: write
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
environment: ${{ inputs.environment_name }}
steps:
- name: Log in to Azure
uses: azure/login@v2
with:
client-id: ${{ vars.AZURE_CLIENT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
tenant-id: ${{ vars.AZURE_TENANT_ID }}
- name: Azure CLI script
uses: azure/cli@v2
with:
azcliversion: latest
inlineScript: |
az containerapp update --name ${{ inputs.app_name }}-${{ inputs.environment_name }} --container-name ${{ inputs.app_name }} --resource-group noahspan --image docker.io/noahspan/${{ inputs.app_name }}:${{ inputs.version_number }}

View File

@@ -1,19 +0,0 @@
name: Pull Request
on:
pull_request:
jobs:
changes:
uses: ./.github/workflows/changes.yaml
build:
if: ${{ needs.changes.outputs.app == 'true' || needs.changes.outputs.client == 'true'}}
name: build
needs:
- changes
uses: ./.github/workflows/build_and_test.yaml
with:
environment_name: pull_request
version_number: ${{ github.run_id }}
secrets: inherit

View File

@@ -1,3 +1,23 @@
# Flying (React and NestJS) # Flying
A pilot logbook app A web app for tracking pilot flight hours and sharing flight tracks.
## Built With
## Getting Started
### Prerequisites
### Installation
## Usage
## Roadmap
- [ ] Expense tracking for plane rental, instructor fees, and fuel rates
- [ ] Export logbook to CSV
- [ ]
## License
## Contact

View File

@@ -1,3 +1,4 @@
# Flying API # Flying API
An API for the Flying app. An API for the Flying app.
...

View File

@@ -1,6 +1,6 @@
{ {
"name": "api", "name": "api",
"version": "2.0.2", "version": "2.1.5",
"description": "", "description": "",
"author": "", "author": "",
"private": true, "private": true,

View File

@@ -40,7 +40,7 @@ export class LogInterceptor implements NestInterceptor {
if (jwtPayload[rolesKeyName].includes('Flying.Read')) { if (jwtPayload[rolesKeyName].includes('Flying.Read')) {
if (data.entities) { if (data.entities) {
const logs = data.entities.map((entity) => limitData(data.entities)); const logs = data.entities.map((entity) => limitData(entity));
return { return {
entities: logs, entities: logs,
@@ -62,8 +62,8 @@ export class LogInterceptor implements NestInterceptor {
const logs = publicData.slice(0, 5) const logs = publicData.slice(0, 5)
return { return {
entities: publicData, entities: logs,
total: data.total, total: logs.length,
hasNextPage: false hasNextPage: false
}; };
} else { } else {
@@ -71,7 +71,6 @@ export class LogInterceptor implements NestInterceptor {
return publicData return publicData
} }
} }
}) })
); );

View File

@@ -19,6 +19,8 @@ describe('LogService', () => {
createQueryBuilder: jest.fn().mockReturnThis(), createQueryBuilder: jest.fn().mockReturnThis(),
innerJoinAndSelect: jest.fn().mockReturnThis(), innerJoinAndSelect: jest.fn().mockReturnThis(),
orderBy: jest.fn().mockReturnThis(), orderBy: jest.fn().mockReturnThis(),
skip: jest.fn().mockReturnThis(),
take: jest.fn().mockReturnThis(),
getManyAndCount: jest.fn() getManyAndCount: jest.fn()
} }
@@ -232,14 +234,14 @@ describe('LogService', () => {
const count = 1 const count = 1
const morePages = false const morePages = false
jest.spyOn(mockLogRepository, 'findAndCount').mockReturnValue([logs, count, morePages]); jest.spyOn(mockQueryBuilder, 'getManyAndCount').mockReturnValue([logs, count, morePages]);
const {entities, total, hasNextPage} = await service.findLogsWithCount(); const {entities, total, hasNextPage} = await service.findLogsWithCount();
expect(entities).toEqual(logs); expect(entities).toEqual(logs);
expect(count).toEqual(total); expect(count).toEqual(total);
expect(hasNextPage).toEqual(morePages); expect(hasNextPage).toEqual(morePages);
expect(mockLogRepository.findAndCount).toHaveBeenCalled(); expect(mockQueryBuilder.getManyAndCount).toHaveBeenCalled();
}) })
it('findLogsWithTracks => should find log entries with tracks', async () => { it('findLogsWithTracks => should find log entries with tracks', async () => {
@@ -292,7 +294,7 @@ describe('LogService', () => {
expect(entities).toEqual(logs); expect(entities).toEqual(logs);
expect(count).toEqual(total); expect(count).toEqual(total);
expect(hasNextPage).toEqual(morePages); expect(hasNextPage).toEqual(morePages);
expect(mockLogRepository.findAndCount).toHaveBeenCalled(); expect(mockQueryBuilder.getManyAndCount).toHaveBeenCalled();
}) })
it('update => should update a log entry', async () => { it('update => should update a log entry', async () => {

View File

@@ -25,11 +25,22 @@ export class LogService {
} }
async findLogsWithCount(skip?: number, take?: number): Promise<Logs> { async findLogsWithCount(skip?: number, take?: number): Promise<Logs> {
const [entities, total] = await this.logRepository.findAndCount({ // const [entities, total] = await this.logRepository.findAndCount({
take, // take,
skip, // skip,
relations: ['pilot', 'tracks'] // order: {
}) // date: 'DESC'
// },
// relations: ['pilot', 'tracks']
// })
const [entities, total] = await this.logRepository
.createQueryBuilder('logs')
.innerJoinAndSelect('logs.pilot', 'pilot')
.orderBy('logs.date', 'DESC')
.skip(skip)
.take(take)
.getManyAndCount()
return { return {
entities, entities,
@@ -43,7 +54,9 @@ export class LogService {
.createQueryBuilder('logs') .createQueryBuilder('logs')
.innerJoinAndSelect('logs.tracks', 'track') .innerJoinAndSelect('logs.tracks', 'track')
.innerJoinAndSelect('logs.pilot', 'pilot') .innerJoinAndSelect('logs.pilot', 'pilot')
.orderBy('date') .orderBy('logs.date', 'DESC')
.skip(skip)
.take(take)
.getManyAndCount(); .getManyAndCount();
return { return {

View File

@@ -0,0 +1 @@
...

View File

@@ -1,7 +1,7 @@
{ {
"name": "client", "name": "client",
"private": true, "private": true,
"version": "2.0.2", "version": "2.1.5",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

View File

@@ -380,13 +380,13 @@ const Logbook: React.FC<unknown> = () => {
setPageIndex setPageIndex
} = table; } = table;
const getLogbookEntries = async (pageIndex?: number, pageSize?: number) => { const getLogbookEntries = async (pageIndex: number, pageSize: number) => {
try { try {
dispatch({ type: 'SET_IS_LOADING', payload: true }); dispatch({ type: 'SET_IS_LOADING', payload: true });
const response: AxiosResponse = await httpClient.get(`api/logs`, { const response: AxiosResponse = await httpClient.get(`api/logs`, {
params: { params: {
skip: pageIndex, skip: pageIndex * pageSize,
take: pageSize take: pageSize
} }
}); });
@@ -413,7 +413,7 @@ const Logbook: React.FC<unknown> = () => {
setColumnVisibility(columnVisibility) setColumnVisibility(columnVisibility)
dispatch({ type: 'SET_ENTRIES', payload: { entries: entries, totalEntries: response.data.total }}); dispatch({ type: 'SET_ENTRIES', payload: { entries: entries, totalEntries: response.data.total }});
if (!isUserLoggedIn && response.data.length >= 5) { if (!isUserLoggedIn && response.data.entities.length >= 5) {
dispatch({ type: 'SET_ALERT', payload: { severity: 'info', message: 'A limited number of log entries displayed. Sign in to view all log entries.'}}) dispatch({ type: 'SET_ALERT', payload: { severity: 'info', message: 'A limited number of log entries displayed. Sign in to view all log entries.'}})
} else { } else {
dispatch({ type: 'SET_ALERT', payload: undefined}) dispatch({ type: 'SET_ALERT', payload: undefined})
@@ -527,13 +527,17 @@ const Logbook: React.FC<unknown> = () => {
dispatch({ type: 'SET_PAGES', payload: pages }) dispatch({ type: 'SET_PAGES', payload: pages })
}, [state.totalEntries, state.pagination?.pageSize]) }, [state.totalEntries, state.pagination?.pageSize])
useEffect(() => {
console.log(state.alert)
}, [state.alert])
return ( return (
<> <>
<div className={`${screenSize === ScreenSize.SM ? 'mr-4 ml-4' : 'mr-10 ml-10'} grid grid-cols-12`}> <div className={`${screenSize === ScreenSize.SM ? 'mr-4 ml-4' : 'mr-10 ml-10'} grid grid-cols-12`}>
<div className='prose max-w-none col-span-10 mt-5 mb-5'> <div className='prose max-w-none col-span-6 mt-5 mb-5'>
<h1>Logbook</h1> <h1>Logbook</h1>
</div> </div>
<div className='col-span-2 justify-self-end self-center'> <div className='col-span-6 justify-self-end self-center'>
{userRole === UserRole.WRITE && {userRole === UserRole.WRITE &&
<button className='btn btn-primary' <button className='btn btn-primary'
onClick={() => onOpenCloseDrawer(FormMode.ADD)} onClick={() => onOpenCloseDrawer(FormMode.ADD)}
@@ -550,7 +554,7 @@ const Logbook: React.FC<unknown> = () => {
onClose={() => onClose={() =>
dispatch({ type: 'SET_ALERT', payload: undefined }) dispatch({ type: 'SET_ALERT', payload: undefined })
} }
severity={'info'} severity={state.alert.severity}
> >
{state.alert.message} {state.alert.message}
</Alert> </Alert>
@@ -569,7 +573,7 @@ const Logbook: React.FC<unknown> = () => {
> >
<option value={10}>10</option> <option value={10}>10</option>
<option value={25}>25</option> <option value={25}>25</option>
<option value={3}>50</option> <option value={50}>50</option>
<option value={state.totalEntries}>All</option> <option value={state.totalEntries}>All</option>
</select> </select>
</label> </label>

View File

@@ -17,11 +17,31 @@ import { Pilot } from './Pilot.interface';
import Alert from '../alert/Alert'; import Alert from '../alert/Alert';
import { useOidc } from '../../auth/oidcConfig'; import { useOidc } from '../../auth/oidcConfig';
interface ActionsProps {
id: string;
}
const Pilots: React.FC<unknown> = () => { const Pilots: React.FC<unknown> = () => {
const [state, dispatch] = useReducer(reducer, initialState); const [state, dispatch] = useReducer(reducer, initialState);
const { userRole } = useUserRole(); const { userRole } = useUserRole();
const { screenSize } = useBreakpoints(); const { screenSize } = useBreakpoints();
const { isUserLoggedIn } = useOidc(); const { isUserLoggedIn } = useOidc();
const Actions = ({ id }: ActionsProps) => {
return (
<div className='dropdown dropdown-end'>
<div tabIndex={0} role='button' className='btn btn-ghost'><FontAwesomeIcon icon={faEllipsisVertical} /></div>
<ul tabIndex={-1} className="dropdown-content menu bg-base-100 rounded-box z-1 w-52 p-2 shadow-sm border border-base-300">
{isUserLoggedIn && userRole === UserRole.WRITE &&
<li><a onClick={() => onOpenClosePilotForm(FormMode.EDIT, id)}><FontAwesomeIcon icon={faPen} />Edit</a></li>
}
<li><a onClick={() => onOpenClosePilotForm(FormMode.VIEW, id)}><FontAwesomeIcon icon={faEye} />View</a></li>
{isUserLoggedIn && userRole === UserRole.WRITE &&
<li><a onClick={() => onDeletePilot(id)}><FontAwesomeIcon icon={faTrash} />Delete</a></li>
}
</ul>
</div>
)
}
const getPilots = async () => { const getPilots = async () => {
try { try {
@@ -134,18 +154,7 @@ const Pilots: React.FC<unknown> = () => {
}, },
cell: (info: CellContext<Pilot, unknown>) => { cell: (info: CellContext<Pilot, unknown>) => {
return ( return (
<div className='dropdown dropdown-end'> <Actions id={info.row.original.id} />
<div tabIndex={0} role='button' className='btn btn-ghost'><FontAwesomeIcon icon={faEllipsisVertical} /></div>
<ul tabIndex={-1} className="dropdown-content menu bg-base-100 rounded-box z-1 w-52 p-2 shadow-sm border border-base-300">
{isUserLoggedIn && userRole === UserRole.WRITE &&
<li><a onClick={() => onOpenClosePilotForm(FormMode.EDIT, info.row.original.id)}><FontAwesomeIcon icon={faPen} />Edit</a></li>
}
<li><a onClick={() => onOpenClosePilotForm(FormMode.VIEW, info.row.original.id)}><FontAwesomeIcon icon={faEye} />View</a></li>
{isUserLoggedIn && userRole === UserRole.WRITE &&
<li><a onClick={() => onDeletePilot(info.row.original.id)}><FontAwesomeIcon icon={faTrash} />Delete</a></li>
}
</ul>
</div>
) )
} }
} }
@@ -172,11 +181,11 @@ const Pilots: React.FC<unknown> = () => {
return ( return (
<> <>
<div className='mr-10 ml-10 grid grid-cols-12'> <div className={`${screenSize === ScreenSize.SM ? 'mr-4 ml-4' : 'mr-10 ml-10'} grid grid-cols-12`}>
<div className='prose max-w-none col-span-10 mt-5 mb-5' > <div className='prose max-w-none col-span-6 mt-5 mb-5' >
<h1>Pilots</h1> <h1>Pilots</h1>
</div> </div>
<div className='col-span-2 justify-self-end self-center'> <div className='col-span-6 justify-self-end self-center'>
{!state.isLoading && userRole === UserRole.WRITE && {!state.isLoading && userRole === UserRole.WRITE &&
<button <button
className='btn btn-primary' className='btn btn-primary'
@@ -259,9 +268,40 @@ const Pilots: React.FC<unknown> = () => {
</table> </table>
</div> </div>
} }
{/* {state.pilots.length > 0 && screenSize === ScreenSize.SM && {state.pilots.length > 0 && screenSize === ScreenSize.SM &&
<PilotCard pilots={state.pilots} onDelete={onDeletePilot} onOpenCloseForm={onOpenClosePilotForm} /> <div className='col-span-12'>
} */} <>
{table.getRowModel().rows.map((row) => {
return (
<div className='card bg-base-100 border border-base-300 mb-5'>
<div className={`card-body ${screenSize === ScreenSize.SM || screenSize === ScreenSize.MD ? 'p-4' : ''}`} key={row.id}>
<div className={`grid grid-cols-12 gap-3`}>
<>
{row.getVisibleCells().map((cell) => {
return (
<>
{cell.column.columnDef.header !== 'Actions' &&
<>
<div className='col-span-10 self-center'>
<span>{flexRender(cell.column.columnDef.cell, cell.getContext())}</span>
</div>
<div className='col-span-2'>
<Actions id={row.original.id} />
</div>
</>
}
</>
)
})}
</>
</div>
</div>
</div>
)
})}
</>
</div>
}
</div> </div>
{state.isFormOpen && ( {state.isFormOpen && (
<PilotForm <PilotForm

View File

@@ -13,6 +13,7 @@ export default defineConfig({
strictPort: true strictPort: true
}, },
server: { server: {
host: true,
port: 8080, port: 8080,
proxy: { proxy: {
'/api': { '/api': {

View File

@@ -9,9 +9,24 @@ services:
- '10001:10001' - '10001:10001'
- '10002:10002' - '10002:10002'
command: 'azurite --blobHost 0.0.0.0 --queueHost 0.0.0.0 --tableHost 0.0.0.0 --loose --skipApiVersionCheck' command: 'azurite --blobHost 0.0.0.0 --queueHost 0.0.0.0 --tableHost 0.0.0.0 --loose --skipApiVersionCheck'
healthcheck:
test: ["CMD", "nc", "-z", "127.0.0.1", "10000"]
volumes: volumes:
- ./azurite-data:/data - ./azurite-data:/data
seed:
image: mcr.microsoft.com/azure-cli
depends_on:
azurite:
condition: service_healthy
volumes:
- ./seed-data:/data
entrypoint: >
sh -c "
az storage container create --name mycontainer --connection-string 'DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;' &&
az storage blob upload-batch --destination mycontainer --source /data --connection-string 'DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;'
"
restore: restore:
container_name: restore container_name: restore
image: litestream/litestream:0.3.13 image: litestream/litestream:0.3.13
@@ -51,6 +66,7 @@ services:
condition: service_started condition: service_started
volumes: volumes:
# azurite-data: azurite-data:
backup: backup:
data: data:
seed-data:

View File

@@ -2,3 +2,4 @@
.terraform/* .terraform/*
*.tfstate *.tfstate
*.tfstate.* *.tfstate.*
.DS_Store

View File

@@ -1,6 +1,6 @@
{ {
"name": "@noahspan/flying", "name": "@noahspan/flying",
"version": "2.0.2", "version": "2.1.5",
"scripts": { "scripts": {
"start": "node api/dist/main", "start": "node api/dist/main",
"format": "prettier --write \"**/src/**/*.ts\" \"**/test/**/*.ts\"", "format": "prettier --write \"**/src/**/*.ts\" \"**/test/**/*.ts\"",