Skip to content

πŸš€ Getting Started

This guide will help you set up and run the Flutter Clean Starter project on your local machine. The starter is modular, cleanly structured, and supports both web and mobile platforms. You can use:

  • πŸ”§ A built-in mock API (Dart)
  • 🧩 Optional Go or Node.js APIs (linked below)

βœ… Prerequisites

Before getting started, make sure you have the following installed:

  • Flutter SDK (Install Flutter)
  • Dart SDK (comes with Flutter)
  • A device/emulator or Chrome browser for web
  • Git (for cloning the repo)
  • (Optional) Go and/or Node.js for backend APIs

πŸ“¦ Installation

  1. Clone the repository:

    git clone https://github.com/your-username/flutter_clean_starter.git
    
    cd flutter_clean_starter
    

  2. Install Flutter dependencies:

    flutter pub get
    


πŸ–₯️ Running the App

flutter run -d chrome

Flutter Mobile

Ensure a device/emulator is running, then:

flutter run

πŸ§ͺ Option 1: Use the Built-in Mock API (Dart)

This project includes a lightweight mock API to simulate backend behavior for local development.

  1. Navigate to the mock API directory:

    cd mock
    

  2. Install Dart dependencies:

    dart pub get
    

  3. Run the mock server:

    dart server/main.dart
    

The server will start on: http://localhost:8080

The Flutter app will automatically use this mock API when no real API is configured.


πŸ” Option 2: Use Go or Node.js APIs (Optional)

Instead of the mock server, you can run real API servers:

Each backend is structured to match the same API contract used in the Flutter app.


🌱 Optional Feature Branch: Post Module

The branch clean-start-with-post-module includes a full working example of a posts module (UI, domain, data, routes).

To use it:

git checkout clean-start-with-post-module
flutter pub get
Run the mock API:
dart mock/server/main.dart
Then launch the app:
flutter run -d chrome


πŸ› οΈ What’s Next?

  • Explore modules in /modules/auth and /modules/posts (in branch)
  • Read the Architecture documentation
  • Replace the mock API with your Go/Node backend
  • Contribute or extend with your own feature module!