teaguestockwell / levels-v2-flutter

Second iteration of aircraft cargo loading and weight and balance app

Home Page:https://fivelevel.web.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MIT License LinkedIn


Logo

Five Level

Second iteration of aircraft cargo loading and weight and balance
View live · Report Bug

Table of Contents
  1. About
  2. Built With
  3. Getting Started
  4. Roadmap
  5. License
  6. Contact
  7. Acknowledgements

About

Overview

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:

  1. 5 Level Native Android
  2. Five Level Flutter
  3. 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

About the UI

The frontend service has four main components. The dashboard, admin portal, unit conversion, and the glossary.

Dashboard

The dashboard is used for configuring a cargo load to perform aircraft weight and balance.

Admin Portal

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.

Unit Conversion

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.

Glossary

UI Features

  • Offline persistance
  • Lazy loading
  • Unit conversion component
  • Admin portal to update deeply nested user models

About the API

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.

API Features

  • JWT based user roles for each aircraft
  • Local memory cache of common routes
  • Logging

Built With

UI Built With

API Built With

Getting Started

Prerequisites

  1. NodeJS
  2. Docker
  3. Git
  4. VS Code Remote Containers Extension
  5. Clone the UI and API from GitHub into the same directory

Compose Prod

To compose a production version locally, follow these steps.

  1. Open the frontend repo in VS Code
  2. Build the UI, API, DB, and Proxy images
docker-compose -f e2e-compose-os.yml -p fl-e2e-os build --no-cache --parallel
  1. Compose the services
docker-compose -f e2e-compose-os.yml -p fl-e2e-os up --force-recreate

Developing Locally

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.

  1. Reopen the frontend repo in a docker container: In the bottom left corner, click the green >< and select "Reopen in container"

  2. Run dev server of Flutter inside the container

flutter run -d chrome --web-port 8080
  1. Open container:8080 locally when the port is mapped to localhost.

UI Testing

  1. In the root of the repo, and inside the dev container, run the following command to start the UI tests
test/cc_report.sh

API Testing

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.

  1. Build the API and run a container with the test script against an instance of Postgresql
npm run docker:test

Roadmap

This service has been depreciated and will be replaced by the Levels UI written in React.

Report a bug

License

Distributed under the MIT License. See licence for more information.

Contact

Teague Stockwell - LinkedIn

Acknowledgements

About

Second iteration of aircraft cargo loading and weight and balance app

https://fivelevel.web.app/

License:MIT License


Languages

Language:Dart 99.7%Language:Dockerfile 0.2%Language:HTML 0.1%Language:Shell 0.0%