Flutter and Dart full stack template, Lovingly called FartStack
Go to file Use this template
2025-02-19 09:28:13 -07:00
.direnv/bin Initial commit, swift and stinky 2025-01-30 16:05:21 -07:00
backend WIP ws messages, TODO backend receiving frontend messages 2025-02-19 09:28:13 -07:00
frontend WIP ws messages, TODO backend receiving frontend messages 2025-02-19 09:28:13 -07:00
shared_models WIP ws messages, TODO backend receiving frontend messages 2025-02-19 09:28:13 -07:00
.gitignore Testing is complete!! And a nice build runner script to boot 2025-02-05 13:16:12 -07:00
.ignore Testing is complete!! And a nice build runner script to boot 2025-02-05 13:16:12 -07:00
flake.lock Initial commit, swift and stinky 2025-01-30 16:05:21 -07:00
flake.nix Edit fart message 2025-02-04 20:41:39 -07:00
LICENSE Initial commit 2025-01-30 14:49:07 -07:00
README.md Added better logging and websocket, more readme details 2025-02-05 22:41:08 -07:00

fartstack

Flutter and Dart full stack template, Lovingly called FartStack

Optimising for iteration speed, correctness, and deployability.

Because building a product is like a fart: You can't be sure its not crap until the follow-through.

HowTo

Dev is done all in dart, with the flutter framework as a frontend. The backend uses dart_frog, a dart backend framework with a focus on developer experience. This whole stack revolves around my Dart expertise, so its not about being blazingly fast, but the quickest stack I can build in with a statically-typed language.

Installing

If you have the nix package manager and direnv setup, its as easy as running direnv allow, bingo bango.

If not, well, you need to setup flutter, dart (should get installed with flutter), and dart_frog

Running

This codebase makes use of RPS, just to standardize calling various tools, like Make, but for dart.

  • Frontend is started with cd frontend and flutter run (not included in rps because there are lots of cli flags I change often with flutter run)
  • Backend is started with cd backend and rps dev or dart_frog dev
  • The build_runners (codegen) for each subproject can all be run cd backend and rps watch for development or rps build for a one off codegen
    • If you dont want to bother installing rps, you can run the script directly:
dart backend/scripts/run_build_runner.dart

And if you dont want to run all three watchers, you can just run an individual one with

dart run build_runner watch # or other args

Testing

Backend

End to end tests can be run with cd backend and rps e2e.

All end to end tests are located in the backend/test_e2e/tests folder. There is a helper script that compiles and launches the backend and runs some end to end tests through it.

Frontend

:|

Frontend ./frontend/

WIP

Backend ./backend/

Uses the great dart frog framework. Its an file-based framework, so to create a new route on /new_route/bingo, you would create a new file in routes/new_route/bingo.dart that contains a function

Response onRequest(RequestContext context) {
  return Response
}

Easy Peasy.

Go to the docks for more.

In the box, fartstack has authentication with JWT tokens setup