(I know, I forgot a 'n' in the project's name.)
A fullstack Dart & Flutter implementation of this challenge.
- Frontend, backend and CLI are all Dart-based.
- Frontend is only tested on the Web target. But it would potentialy work on other native plateforms (maybe some config is needed).
- Melos is used to handle mono-repo architecture.
You should first setup your project. Once it is done, you won' t have to do it again.
- Install Flutter. It will install both Flutter and Dart commands (used later).
- Optional, but useful: Check your Flutter installation with
flutter doctor. Don't worry with Android and XCode warnings. - Clone this repository.
- In your terminal, move inside the project with
cd milenium-challenge - Install Melos with
dart pub global activate melos - Bootstrap project with
melos bs
It should have installed the CLI and built the frontend application.
- If not done yet, move to the root of the project.
- Start server and serve frontend
melos run serve - Once server started, open http://localhost:8080/index.html in your browser (may take a few seconds to load on first launch).
- Run the
give-me-the-odds <millennium-falcon-path> <empire-path>orgive-me-the-odds <millennium-falcon-path> <empire-path> <universe-db-path>. It can run from everywhere, as long as your JSON and DB paths are right. - If you are in the root project folder, you can just run
give-me-the-odds examples/example1/millennium-falcon.json examples/example1/empire.json examples/example1/universe.db
- If not done yet, move to the root of the project.
- Just run
melos run testand watch the result.
- If not done yet, move to the root of the project.
- Run
melos clean
It will clean the project and uninstall the give-me-the-odds command.
There are still some obvious improvements:
- Localisation (L10n)
- Better error handling
- More tests
- Redirecting http://localhost:8080/ to http://localhost:8080/index.html
- Ability to serve Frontend and API from an other port
- Adding documentation to CLI from a
--helpflag - Use of a package like
riverpodfor the frontend application to manage state and dependencies injection. - Multi-platform builds
But some basics are available:
- Tests on base functionalities
- Code documentation
- Project handling and scripting with Melos
- Mono-repo project with packages to manage dependencies