Local Setup¶
The development environment consists of the Flutter mobile application and a local Cloudflare Worker backend.
Backend Infrastructure¶
The mobile application fetches data from a DevStack Worker backend. You must spin up a local instance of this worker.
Setup Worker¶
-
Clone the worker repository:
-
Seed the local database:
- Initial compilation may take a few minutes depending on your internet connection and Rust toolchain.
-
Launch the development server using
wrangler:
Your local backend is now running at http://localhost:8787.
Flutter Application¶
With the backend running, configure the mobile application.
Setup App¶
-
Clone the main repository:
-
Configure environment variables by creating
.envand.env_debugin the root folder:API_CHEATSHEET_BASE_URL=http://localhost:8787/api # (1)! API_CHEATSHEET_LIST_ENDPOINT=/cheatsheets API_CHEATSHEET_DETAIL_ENDPOINT=/cheatsheets/:id API_COUPON_BASE_URL=https://cdn.real.discount/api API_COUPON_LIST_ENDPOINT=/courses API_COUPON_ENDPOINT=/courses/slug/:slug- When testing on an Android Emulator, change this to your machine's local IP address (e.g.,
http://192.168.41.100:8787/api).
- When testing on an Android Emulator, change this to your machine's local IP address (e.g.,
-
Install dependencies and run code generation:
-
Launch the application: