Skip to content

Commit 6d9c8b7

Browse files
authored
Merge pull request #23 from flutter-news-app-full-source-code/docs/fix
Docs/fix
2 parents a2c80d5 + bdb2e3c commit 6d9c8b7

File tree

6 files changed

+113
-91
lines changed

6 files changed

+113
-91
lines changed

README.md

Lines changed: 1 addition & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -9,66 +9,4 @@
99
<a href="https://github.com/flutter-news-app-full-source-code"><img src="https://img.shields.io/badge/MAIN_PROJECT-BROWSE-purple?style=for-the-badge" alt="Main Project: Browse"></a>
1010
</p>
1111

12-
This repository contains the source code for the official documentation website for the [**Flutter News App Full Source Code Toolkit**](https://github.com/flutter-news-app-full-source-code). Built with [Astro](https://astro.build/), this site provides comprehensive guides, tutorials, and API references to help developers understand, set up, customize, and deploy the entire toolkit. It serves as a central knowledge base, ensuring that all components—the Flutter mobile app, web dashboard, and Dart Frog backend API—are well-documented and easy to navigate.
13-
14-
## ⭐ Documentation Overview: Your Guide to the Toolkit
15-
16-
This documentation website offers a structured and detailed overview of the Flutter News App Full Source Code Toolkit.
17-
18-
<details>
19-
<summary><strong>📚 Content & Structure</strong></summary>
20-
21-
### 📖 Comprehensive Guides
22-
- **Getting Started:** Essential information for setting up your development environment, understanding the core philosophy, and architectural overview.
23-
- **Mobile Client:** Detailed guides for the Flutter mobile application, covering architecture, features, deployment (Android/iOS), and customization.
24-
- **Web Dashboard:** Comprehensive documentation for the Flutter web dashboard, including architecture, features, deployment, and management manuals.
25-
- **API Server:** In-depth information on the Dart Frog backend API, its architecture, features (authentication, data management, email service), deployment, and configuration.
26-
- **Customization:** Guides on branding, theming, and extending the toolkit to fit your specific needs.
27-
28-
### 🛠️ Technical Foundation
29-
- **Built with Astro:** The documentation site itself is powered by [Astro](https://astro.build/), a modern static site generator, ensuring fast performance and maintainability.
30-
- **Clear Navigation:** Organized into logical sections and pages for easy discovery of information.
31-
32-
> **💡 Your Advantage:** This documentation provides a clear, organized, and comprehensive resource for the Flutter News App Toolkit. It simplifies the learning curve, accelerates development by offering detailed setup and customization guides, and ensures you have all the information needed to successfully build and deploy your news application.
33-
34-
</details>
35-
36-
## 🚀 Getting Started: Running Locally
37-
38-
To preview changes or contribute to the documentation, you can run a local development server.
39-
40-
1. **Prerequisites:**
41-
* Ensure [Node.js](https://nodejs.org/) (LTS version) is installed on your system.
42-
43-
2. **Clone the repository:**
44-
```bash
45-
git clone https://github.com/flutter-news-app-full-source-code/docs.git
46-
cd docs
47-
```
48-
49-
3. **Install dependencies:**
50-
```bash
51-
npm install
52-
```
53-
54-
4. **Start the development server:**
55-
```bash
56-
npm run dev
57-
```
58-
The site will now be available at `http://localhost:4321`. It will automatically reload as you make changes to the content.
59-
60-
## 📝 License
61-
62-
This repository uses a dual-licensing model to provide clarity for different types of content.
63-
64-
#### Documentation Content
65-
66-
All prose, tutorials, and narrative content within this documentation are licensed under the **[Creative Commons Attribution 4.0 International License (CC BY 4.0)](./LICENSE)**. This allows our guides to be openly shared and improved by the community.
67-
68-
#### Code Snippets
69-
70-
All code examples and snippets embedded within the documentation are a separate matter. Unless otherwise specified, they are dedicated to the **[Public Domain via CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/)**.
71-
72-
This means you are free to copy, paste, modify, and use these illustrative snippets in your own applications without restriction.
73-
74-
This dual-licensing approach ensures our documentation is open and shareable, while protecting the commercial value of the underlying source code product, which is governed by our **[Lifetime Developer License](https://github.com/flutter-news-app-full-source-code/.github/blob/main/LIFETIME_DEVELOPER_LICENSE.md)**.
12+
This repository contains the source code for the official documentation website for the [**Flutter News App Full Source Code Toolkit**](https://github.com/flutter-news-app-full-source-code).

src/content/docs/api-server/local-setup.mdx

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@ This guide will walk you through setting up the API server in a local developmen
1818
dart pub global activate dart_frog_cli
1919
```
2020

21-
2. **Clone the Repository**
21+
2. **Download the Latest Release**
2222

23-
If you haven't already, clone the repository to your local machine.
23+
Download the source code of the latest release from the GitHub releases page for the API Server:
2424

25-
```bash
26-
git clone https://github.com/flutter-news-app-full-source-code/flutter-news-app-api-server-full-source-code.git
27-
cd flutter-news-app-api-server-full-source-code
28-
```
25+
- **API Server:** [https://github.com/flutter-news-app-full-source-code/flutter-news-app-api-server-full-source-code/releases/latest](https://github.com/flutter-news-app-full-source-code/flutter-news-app-api-server-full-source-code/releases/latest)
26+
27+
After downloading and extracting the archive, navigate into the project directory.
2928

3029
3. **Set Up Local Database**
3130

@@ -62,13 +61,4 @@ This guide will walk you through setting up the API server in a local developmen
6261
The API will now be running and available at `http://localhost:8080`.
6362
</Aside>
6463

65-
7. **Automatic Database Seeding**
66-
67-
On its first startup, the server automatically connects to your MongoDB database and seeds it with initial data (countries, topics, users, etc.). This process is idempotent, meaning you can safely restart the server multiple times without creating duplicate data.
68-
69-
<Aside type="tip">
70-
For more details on how this works, see the [Understand Database Seeding](/docs/api-server/architecture/data-seeding-and-fixtures) guide.
71-
</Aside>
72-
73-
7464
</Steps>
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
title: Connecting to a Local API from a Physical Device
3+
description: A guide to configuring the development environment to test the mobile app on a physical device with a local API server.
4+
---
5+
import { Steps, Aside } from '@astrojs/starlight/components';
6+
7+
This guide explains how to connect the mobile client running on a physical device to an API server running on your local machine.
8+
9+
### The `localhost` Challenge
10+
11+
When the API server runs locally, it is accessible at `http://localhost:8080` on your computer. However, a physical mobile device connected to the same network cannot access your computer using the `localhost` address, as `localhost` refers to the device itself.
12+
13+
To resolve this, your local API server must be made accessible over the network. A tunneling service like **ngrok** can accomplish this by creating a secure public URL that forwards traffic to your local server.
14+
15+
<Aside>
16+
The use of tunneling services is intended for development and testing purposes only and is not a substitute for a properly deployed production environment.
17+
</Aside>
18+
19+
### Configuration Steps
20+
21+
<Steps>
22+
1. **Start Your Local API Server**
23+
24+
Ensure your API server is running locally on the designated port.
25+
- See the [API Server Local Setup Guide](/docs/api-server/local-setup/) for instructions.
26+
27+
2. **Install and Run ngrok**
28+
29+
You will need to install `ngrok` and use it to expose your local server's port (e.g., `8080`). For detailed instructions on installation and usage, please refer to the official documentation.
30+
31+
- **Official Guide:** [ngrok Documentation](https://ngrok.com/docs)
32+
33+
Once installed, run the following command to expose your local server:
34+
```bash
35+
ngrok http 8080
36+
```
37+
ngrok will provide a public forwarding URL (e.g., `https://....ngrok-free.app`).
38+
39+
3. **Set the Development Environment**
40+
41+
- Open the file `lib/main.dart`.
42+
- Locate the `appEnvironment` constant.
43+
- Set its value to `AppEnvironment.development`.
44+
45+
```dart title="lib/main.dart"
46+
// Use `AppEnvironment.development` to connect to a live backend API.
47+
const appEnvironment = AppEnvironment.development;
48+
```
49+
50+
4. **Verify the API Base URL**
51+
52+
- Open the file `lib/app/config/app_config.dart`.
53+
- Ensure that the `baseUrl` for the `development` case points to the ngrok forwarding URL for your local API server.
54+
55+
56+
5. **Run the Application in Development Mode**
57+
58+
With the configuration updated, you can now run the application on your physical device in `development` mode, and it will successfully connect to your local API server.
59+
60+
</Steps>

src/content/docs/mobile-client/deployment.mdx

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ To ensure you have the most reliable and up-to-date instructions, this guide foc
1111
</Aside>
1212

1313
### Pre-Deployment Configuration
14-
1514
Before you can build the app for production, you must configure it to connect to your live API server.
1615

1716
<Steps>
@@ -31,6 +30,35 @@ Before you can build the app for production, you must configure it to connect to
3130
- Open the file `lib/app/config/app_config.dart`.
3231
- Ensure that the `baseUrl` for the `production` case points to the correct URL of your deployed [API Server](/docs/api-server/deployment/).
3332

33+
3. **Configure App Icons**
34+
35+
The project uses `flutter_launcher_icons` to generate app icons. You will need to update the configuration in `pubspec.yaml` to use your own icon assets.
36+
37+
- Open `pubspec.yaml`.
38+
- Locate the `flutter_launcher_icons` section.
39+
- Update the `image_path` to point to your desired icon image.
40+
- After updating, run the following command to generate the new icons:
41+
```bash
42+
flutter pub run flutter_launcher_icons:main
43+
```
44+
<Aside type="tip">
45+
For more details, refer to the [flutter_launcher_icons documentation](https://pub.dev/packages/flutter_launcher_icons).
46+
</Aside>
47+
48+
4. **Configure Native Splash Screen**
49+
50+
The project uses `flutter_native_splash` for native splash screens. You will need to update the configuration in `pubspec.yaml` to use your own splash screen assets and colors.
51+
52+
- Open `pubspec.yaml`.
53+
- Locate the `flutter_native_splash` section.
54+
- Update `color`, `color_dark`, `image`, and `image_dark` to match your branding.
55+
- After updating, run the following command to generate the new splash screens:
56+
```bash
57+
flutter pub run flutter_native_splash:create
58+
```
59+
<Aside type="tip">
60+
For more details, refer to the [flutter_native_splash documentation](https://pub.dev/packages/flutter_native_splash).
61+
</Aside>
3462
</Steps>
3563

3664
### Building and Releasing

src/content/docs/mobile-client/local-setup.mdx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ This guide will walk you through setting up and running the Flutter News App Mob
1313

1414
- **Flutter SDK:** Please follow the [Official Flutter Installation Guide](https://flutter.dev/docs/get-started/install) for your specific operating system.
1515

16-
2. **Clone the Repository**
16+
2. **Download the Latest Release**
1717

18-
Open your terminal and clone the mobile client repository:
18+
Download the source code of the latest release from the GitHub releases page for the Mobile Client:
1919

20-
```bash
21-
git clone https://github.com/flutter-news-app-full-source-code/flutter-news-app-mobile-client-full-source-code.git
22-
cd flutter-news-app-mobile-client-full-source-code
23-
```
20+
- **Mobile Client:** [https://github.com/flutter-news-app-full-source-code/flutter-news-app-mobile-client-full-source-code/releases/latest](https://github.com/flutter-news-app-full-source-code/flutter-news-app-mobile-client-full-source-code/releases/latest)
21+
22+
After downloading and extracting the archive, navigate into the project directory.
2423

2524
3. **Install Dependencies**
2625

@@ -52,6 +51,10 @@ This guide will walk you through setting up and running the Flutter News App Mob
5251
For the `development` environment, you must have the [API Server running locally](/docs/api-server/local-setup/) first.
5352
</Aside>
5453

54+
<Aside type="note">
55+
To connect to your local API server from a physical mobile device, additional configuration is required. Please see the [Connecting to a Local API from a Physical Device](/docs/development-environment-setup/) guide.
56+
</Aside>
57+
5558
5. **Run the Application**
5659

5760
Start the Flutter development server. Ensure you have a simulator/emulator running or a physical device connected.

src/content/docs/web-dashboard/local-setup.mdx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@ This guide will walk you through setting up and running the Flutter News App Web
1414

1515
- **Flutter SDK:** Please follow the [Official Flutter Installation Guide](https://flutter.dev/docs/get-started/install) for your specific operating system.
1616

17-
2. **Clone the Repository**
17+
2. **Download the Latest Release**
1818

19-
Open your terminal and clone the web dashboard repository:
19+
Download the source code of the latest release from the GitHub releases page for the Web Dashboard:
2020

21-
```bash
22-
git clone https://github.com/flutter-news-app-full-source-code/flutter-news-app-web-dashboard-full-source-code.git
23-
cd flutter-news-app-web-dashboard-full-source-code
24-
```
21+
- **Web Dashboard:** [https://github.com/flutter-news-app-full-source-code/flutter-news-app-web-dashboard-full-source-code/releases/latest](https://github.com/flutter-news-app-full-source-code/flutter-news-app-web-dashboard-full-source-code/releases/latest)
22+
23+
After downloading and extracting the archive, navigate into the project directory.
2524

2625
3. **Install Dependencies**
2726

@@ -53,6 +52,10 @@ This guide will walk you through setting up and running the Flutter News App Web
5352
For the `development` environment, you must have the [API Server running locally](/docs/api-server/local-setup/) first.
5453
</Aside>
5554

55+
<Aside type="note">
56+
To connect to your local API server from a physical mobile device, additional configuration is required. Please see the [Connecting to a Local API from a Physical Device](/docs/development-environment-setup/) guide.
57+
</Aside>
58+
5659
5. **Run the Development Server**
5760

5861
Start the Flutter development server, targeting the Chrome browser:

0 commit comments

Comments
 (0)