Dart Frog is an excellent tool for building a backend with Dart. I’ve already covered the basics in this article, so if you want to follow along, I recommend you read this one first.
What is Melos? It is a CLI tool to support management of Dart projects with multiple packages (also called monorepo).
Splitting a large project into version-controlled packages is very effective for code sharing.
It provides a simple and efficient way to manage multiple packages and libraries in a single code base. Melos is designed to help manage these challenges by providing a streamlined workflow for building, testing, and managing dependencies across all projects in a mono repository.
Melos also provides a plugin system (for Intellij and VS Code )
☑️ Consistent development environment
☑️ Linking and installation of local packages
☑️ Simultaneous command execution on multiple packages
☑️ Multiple developers can work on the same code base at the same time
☑️ Flexibility Limitations
☑️ Increased complexity
All package dependencies are installed (internally pub get is used) All packages are linked locally.
$ melos bootstrap
# or
$ melos bs
Clean up temporary project files. Can be run before bootstrap, for example, to start completely fresh.
$ melos clean
ex) Chrome. You can build android ios emulater!
Use the Dart backend too!
macOS Home Brew
root
├── app
│ ├── TaskApp
│
├── backend
│ ├── dartfrog(server)
│
├── packages
│ ├── core
│ │ ├── analytics
│ │ └── data
│ │ └── database
│ │ └── domain
│ │ └── model
│ │
│ └── feature
│ └── auth
│
├── infrastructure
│
├── mason
│
├── Dockerfile
├── dockercompose.yaml
├── meson.yaml
├── melos.yaml
├── pubspec.yaml
└── README.md
set up project server
$ make bs
....
Running "flutter pub get" in workspace packages...
✓ model
└> packages/core/model
✓ repository
└> packages/core/repository
✓ backend
└> backend
✓ app
└> app
> SUCCESS
Generating IntelliJ IDE files...
> SUCCESS
....
Starting Dart Frog server on Docker
[+] Building 376.0s (18/18) FINISHED docker:desktop-linux
....
✓ Running on http://:::8080
set up project frontend
$ make app-start-chrome
...
A Dart VM Service on Chrome is available at: http://127.0.0.1:53308/vuiIiX9KTZs=
You can get backend info
http://localhost:8080/tasks
$ dart create -t package FOLDERNAME