An open API service indexing awesome lists of open source software.

https://github.com/teaguestockwell/levels-v2-flutter

Second iteration of aircraft cargo loading and weight and balance app
https://github.com/teaguestockwell/levels-v2-flutter

dart docker flutter

Last synced: about 2 months ago
JSON representation

Second iteration of aircraft cargo loading and weight and balance app

Awesome Lists containing this project

README

        

[![MIT License][license-shield]][license-url]
[![LinkedIn][linkedin-shield]][linkedin-url]

[license-shield]: https://img.shields.io/github/license/teaguestockwell/levels-v2-flutter.svg
[license-url]: https://github.com/teaguestockwell/levels-v2-flutter/blob/master/licence
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?logo=linkedin&colorB=555
[linkedin-url]: https://www.linkedin.com/in/teague-stockwell/





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](https://github.com/teaguestockwell/levels-v1-android) Native Android
2. [Five Level](https://github.com/teaguestockwell/levels-v2-flutter) Flutter
3. Levels - [UI Repo](https://github.com/teaguestockwell/levels-v3-react) and [API Repo](https://github.com/teaguestockwell/levels-v2v3-express) React

Five Level, this iteration is depreciated and has been replaced by Levels. Five Level is deployed [here](http://fivelevel.web.app/) to use a serverless document DB (Firebase Firestore), but the master branch may also be ran as a container using [this API](https://github.com/teaguestockwell/levels-v2v3-express)
## 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](https://www.google.com/search?q=google+unit+conversion) 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
- [Flutter](https://github.com/flutter/flutter)
## API Built With
- [*Postgres](https://github.com/postgres/postgres)
- [*Express](https://expressjs.com/)
- [*Prisma](https://www.prisma.io/)
- [*TypeScript](https://www.typescriptlang.org/)
- [*Firebase Firestore](https://firebase.google.com/docs/firestore/)

# Getting Started
## Prerequisites

1. [NodeJS](https://nodejs.org/en/download/)
2. [Docker](https://www.docker.com/get-started)
3. [Git](https://git-scm.com/downloads)
4. [VS Code Remote Containers Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
5. Clone the [UI](https://github.com/teaguestockwell/levels-v2-flutter) and [API](https://github.com/teaguestockwell/levels-v2v3-express) 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
```sh
docker-compose -f e2e-compose-os.yml -p fl-e2e-os build --no-cache --parallel
```
3. Compose the services
```sh
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
```

3. Open container:8080 locally when the port is mapped to localhost.

### UI Testing
4. In the root of the repo, and inside the dev container, run the following command to start the UI tests
```sh
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](https://www.npmjs.com/package/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
```sh
npm run docker:test
```

# Roadmap
This service has been depreciated and will be replaced by the [Levels UI](https://github.com/teaguestockwell/levels-v3-react) written in React.

Report a [bug](https://forms.gle/Bbqvubn6gwC6fRnc8)

# License
Distributed under the MIT License. See `licence` for more information.
# Contact
Teague Stockwell - [LinkedIn](https://www.linkedin.com/in/teague-stockwell)
# Acknowledgements
- [Brandon Swenson](https://github.com/bmswens) for helping containerize with hardened images