This is a monolithic repository structured as follows:
- app/: Contains all Flutter-related files for the frontend.
- src/: Contains all API-related files for the backend.
I decided to reimplement the MCDU for the A320 as my papl idea. As the project is large at best, my initial submission focuses on the ATSU and building up a scalable frontend and backend.
MCDU - Multipurpose Control and Display Unit. It is the primary interface for the pilots to interact with the FMGC and ATSU of the A320 FMGC - Flight Management and Guidance Computer ATSU - Air Traffic Services Unit ACARS - Aircraft Communications Addressing and Reporting System CPDLC - Controller-Pilot Data Link Communications PDC - Pre-Departure Clearance DDU - Datalkink Display Unit
The frontend is primarily built for iOS and Android but can also run on macOS (via iPhone mirroring or emulators), Windows, and Linux (via Android emulators). While the web version should work, it hasn't been thoroughly tested.
- Ensure you have Flutter installed. Follow the official Flutter installation guide for setup instructions.
- Ensure you have docker installed. Follow the official Docker installation guide for setup instructions.
- Navigate to the
/appdirectory. - Run the following command:
flutter run
Note
- By default, the app connects to https://api.sambot.dev as its backend.
- To use a local backend, edit the
apiUrlvariable inlib/globals.dart
-
Ensure Docker is installed on your system.
-
Place the following files just outside the workspace folder:
papl.env: Use.env.exampleas a template.db_password.txt: Contains the MySQL database password in plaintext.~/caddy_config/Caddyfile: UseCaddyfile.exampleas a template, ONLY if you're using Caddy as a reverse proxy. Some key things to note:- Replace
example.comwith your domain name. - Replace
CLOUDFLARE_APIwith your Cloudflare API key. - Oh yeah, this only works if you're using Cloudflare as your DNS provider. If you're not, you'll have to change the DNS provider in the Caddyfile.
- Replace
-
Run the following command from the root directory:
docker compose up
Docker will automatically pull necessary images and build the containers.
- Use
dbas the database URL in your connection string. For example:mysql+pymysql://username:password@db/databaseName
If you encounter issues accessing the MySQL database:
-
Enter the MySQL container:
docker exec -it papl-cw-db-1 mysql -u root -pUse the randomly generated root password found in the logs.
-
Update the password for the user account:
ALTER USER '<Username>' IDENTIFIED BY '<NewPassword>';
-
Exit the container and restart Docker Compose:
docker compose up
The backend will run on 127.0.0.1. To use this with the frontend, ensure the Flutter app is configured to connect to 127.0.0.1 instead of https://api.sambot.dev.
- Ensure MySQL is running with a valid user account and password.
- Navigate to the
/srcdirectory. - Run the backend server using:
uvicorn app:app
- Ensure you have a
.envfile with the correct database connection string, for example:mysql+pymysql://username:password@db/databaseName