Second iteration of aircraft cargo loading and weight and balance
View live
·
Report Bug
Table of Contents
Five level is a the second iteration of an app that manages aircraft cargo loading and weight and balance for the US Air Force.
The first and second iterations were built with tech stacks that could not be accredited and deployed to the Air Force network:
- 5 Level Native Android
- Five Level Flutter
- Levels - UI Repo and API Repo React
Five Level, this iteration is depreciated and has been replaced by Levels. Five Level is deployed here to use a serverless document DB (Firebase Firestore), but the master branch may also be ran as a container using this API
The frontend service has four main components. The dashboard, admin portal, unit conversion, and the glossary.
The dashboard is used for configuring a cargo load to perform aircraft weight and balance.
The admin portal is used for performing CRUD operations on users, aircraft, configurations, and cargo. Below, the left side is Prisma Studio, and the right is the Flutter implementation of the admin portal.
The unit conversion tab has a custom flutter implementation of a unit conversion component inspired by Googe's web implementation here and utilitys to work with time and date that are common for aircraft mechanics when filling out forms.
- Offline persistance
- Lazy loading
- Unit conversion component
- Admin portal to update deeply nested user models
There are two APIs that can support this project. The first is a document DB (Firebase Firestore) and the second is a Node server in front of Postgresql.
The deployed version uses Firestore and it supports read only. The Node server supports CRUD operations on multiple aircraft and user roles using JWTs.
- JWT based user roles for each aircraft
- Local memory cache of common routes
- Logging
- NodeJS
- Docker
- Git
- VS Code Remote Containers Extension
- Clone the UI and API from GitHub into the same directory
To compose a production version locally, follow these steps.
- Open the frontend repo in VS Code
- Build the UI, API, DB, and Proxy images
docker-compose -f e2e-compose-os.yml -p fl-e2e-os build --no-cache --parallel
- Compose the services
docker-compose -f e2e-compose-os.yml -p fl-e2e-os up --force-recreate
For convenience the Flutter SDK and VS Code extensions that are needed to build the UI are included in a dev container. To use the dev container, follow these steps.
-
Reopen the frontend repo in a docker container: In the bottom left corner, click the green >< and select "Reopen in container"
-
Run dev server of Flutter inside the container
flutter run -d chrome --web-port 8080
- Open container:8080 locally when the port is mapped to localhost.
- In the root of the repo, and inside the dev container, run the following command to start the UI tests
test/cc_report.sh
Tests are run as integrations tests inside of a Postgresql service and a node service. Between each test the database may need to be reset and reseeded. See aircraft.test
for an example.
The test utils contains mocks of different user roles that can be passed to the auth header in Supertest.
Use :os at the end of these commands if you have not logged on to the hardened registry.
- Build the API and run a container with the test script against an instance of Postgresql
npm run docker:test
This service has been depreciated and will be replaced by the Levels UI written in React.
Report a bug
Distributed under the MIT License. See licence
for more information.
Teague Stockwell - LinkedIn
- Brandon Swenson for helping containerize with hardened images