Skip to content

Local Setup

This guide will walk you through setting up and running the Flutter News App Web Dashboard on your local machine.

  1. Prerequisites

    Before you begin, you must have the Flutter SDK installed on your system. To ensure you are using the most up-to-date and accurate installation instructions, we recommend following the official guide directly from the Flutter team.

  2. Download the Latest Release

    Download the source code of the latest release from the GitHub releases page for the Web Dashboard:

    After downloading and extracting the archive, navigate into the project directory.

  3. Install Dependencies

    Fetch all the required Dart and Flutter packages for the project:

    Terminal window
    flutter pub get
  4. Configure the Environment

    The web dashboard uses compile-time variables to configure its environment. This allows you to easily switch between mock data, a local API, or a live production API without changing the code.

    You can specify the environment by passing a --dart-define flag to the flutter run command.

    • Demo (Default): Runs the dashboard with in-memory mock data. No backend API is required, making it perfect for focusing on UI changes and component testing.
      Terminal window
      flutter run -d chrome
    • Development: Connects the dashboard to a locally running instance of the API server.
      Terminal window
      flutter run -d chrome --dart-define=APP_ENVIRONMENT=development
    • Production: Connects the dashboard to your live, deployed backend API. You must also provide the base URL for your API.
      Terminal window
      flutter run -d chrome --dart-define=APP_ENVIRONMENT=production --dart-define=BASE_URL=https://your.api.com
  5. Run the Development Server

    Start the application using one of the commands from the previous step, targeting the Chrome browser.

    For example, to run in demo mode:

    Terminal window
    flutter run -d chrome

    The web dashboard will now be running and accessible in your Chrome browser. The <Aside> about connecting from a physical device has been removed as it is not relevant for a web-only dashboard.