Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 04be6ac

Browse files
authored
Merge pull request #28 from flutter-news-app-full-source-code/refactor-rename-the-package-and-the-private-deps
Refactor rename the package and the private deps
2 parents bbd9191 + af6c78b commit 04be6ac

37 files changed

+367
-381
lines changed

‎.env.example‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# REQUIRED: The full connection string for your MongoDB instance.
66
# The application cannot start without a database connection.
7-
# DATABASE_URL="mongodb://user:password@localhost:27017/ht_api_db"
7+
# DATABASE_URL="mongodb://user:password@localhost:27017/flutter_news_app_api_server_full_source_code_db"
88

99
# REQUIRED: A secure, randomly generated secret for signing JWTs.
1010
# The application cannot start without this.

‎.github/dependabot.yaml‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,11 @@ updates:
1010
schedule:
1111
interval: "daily"
1212
ignore:
13-
- dependency-name: 'ht_*'
13+
- dependency-name: 'core'
14+
- dependency-name: 'data_client'
15+
- dependency-name: 'data_mongodb'
16+
- dependency-name: 'data_repository'
17+
- dependency-name: 'email_client'
18+
- dependency-name: 'email_repository'
19+
- dependency-name: 'email_sendgrid'
20+
- dependency-name: 'http_client'

‎README.md‎

Lines changed: 64 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,126 +1,108 @@
1-
# ht_api
1+
<div align="center">
2+
<img src="https://avatars.githubusercontent.com/u/202675624?s=400&u=2daf23e8872a3b666bcd4f792a21fe2633097e79&v=4" alt="Flutter News App Toolkit Logo" width="220">
23

3-
![coverage: percentage](https://img.shields.io/badge/coverage-xx-green)
4-
[![style: very good analysis](https://img.shields.io/badge/style-very_good_analysis-B22C89.svg)](https://pub.dev/packages/very_good_analysis)
5-
[![License: PolyForm Free Trial](https://img.shields.io/badge/License-PolyForm%20Free%20Trial-blue)](https://polyformproject.org/licenses/free-trial/1.0.0)
4+
# Flutter News App - API Server Full Source Code
65

7-
🚀 Accelerate the development of your news application backend with **ht_api**, the
8-
dedicated API service for the Headlines Toolkit. Built on the high-performance
9-
Dart Frog framework, `ht_api` provides the essential server-side infrastructure
10-
specifically designed to power robust and feature-rich news applications.
6+
<p>
7+
<img src="https://img.shields.io/badge/coverage-XX-green?style=for-the-badge" alt="coverage: percentage">
8+
<a href="https://github.com/sponsors/flutter-news-app-full-source-code"><img src="https://img.shields.io/badge/DOCS-READ-purple?style=for-the-badge" alt="DOCS READ"></a>
9+
<a href="https://github.com/sponsors/flutter-news-app-full-source-code"><img src="https://img.shields.io/badge/LICENSE-BUY-pink?style=for-the-badge" alt="License: Buy"></a>
10+
</p>
11+
</div>
1112

12-
`ht_api` is a core component of the **Headlines Toolkit**, a comprehensive,
13-
source-available ecosystem designed for building feature-rich news
14-
applications, which also includes a Flutter [mobile app](https://github.com/headlines-toolkit/ht-main) and a web-based [content
15-
management dashboard](https://github.com/headlines-toolkit/ht-dashboard).
13+
This is the complete and fully-functional backend API server for the Flutter News App Toolkit. Built with the high-performance Dart Frog framework, it gives you all the server-side features you need to power your news app, right out of the box. It is a key component of the [**Flutter News App Toolkit**](https://github.com/flutter-news-app-full-source-code), an ecosystem that also includes a flutter [mobile app](https://github.com/flutter-news-app-full-source-code/flutter-news-app-mobile-client-full-source-code) and a web-based [content dashboard](https://github.com/flutter-news-app-full-source-code/flutter-news-app-web-dashboard-full-source-code).
1614

17-
## ✨ Key Capabilities
15+
## ⭐ Everything You Get, Ready to Go
1816

19-
* 🔒 **Flexible & Secure Authentication:** Provide seamless user access with
20-
a unified system supporting passwordless email sign-in and anonymous guest
21-
accounts. The API intelligently handles the conversion from a guest to a
22-
permanent user, preserving all settings and preferences. It also includes
23-
a secure, role-aware login flow for privileged dashboard users.
17+
This API server comes packed with all the features you need to launch a professional, scalable news application.
2418

25-
* ⚡️ **Granular Role-Based Access Control (RBAC):** Implement precise
26-
permissions with a dual-role system (`appRole` for application features,
27-
`dashboardRole` for admin functions) to control access to API features
28-
and data management capabilities.
19+
#### 🔐 **Robust & Flexible Authentication**
20+
* Provides secure, modern authentication flows, including passwordless email sign-in and anonymous guest accounts.
21+
* Intelligently handles converting guest users to permanent accounts, preserving all their settings and saved content.
22+
* Includes a separate, role-aware login flow for privileged dashboard users.
23+
> **Your Advantage:** You get a complete, secure authentication system without the complexity. All the user management logic is done for you. ✅
2924
30-
* ⚙️ **Synchronized App Settings:** Ensure a consistent and personalized user
31-
experience across devices by effortlessly syncing application preferences
32-
like theme, language, font styles, and more.
25+
#### ⚡️ **Granular Role-Based Access Control (RBAC)**
26+
* Implement precise permissions with a dual-role system: `appRole` for mobile app features and `dashboardRole` for admin functions.
27+
* Securely control access to API features and data management capabilities based on user roles.
28+
> **Your Advantage:** A powerful, built-in security model that protects your data and ensures users only access what they're supposed to. 🛡️
3329
34-
* 👤 **Personalized User Preferences:** Enable richer user interactions by
35-
managing and syncing user-specific data such as saved headlines, followed
36-
sources, and followed topics tailored to individual users.
30+
#### ⚙️ **Centralized App & User Settings**
31+
* Effortlessly sync user-specific settings like theme, language, and font styles across devices.
32+
* Manage personalized content preferences, including saved headlines and followed topics/sources.
33+
> **Your Advantage:** Deliver a seamless, personalized experience that keeps users' settings in sync, boosting engagement and retention. ❤️
3734
38-
* 💾 **Robust Data Management:** Securely manage core news data (headlines,
39-
topics, sources) through a well-structured API that supports flexible
40-
querying and sorting for dynamic content presentation.
35+
#### 💾 **Robust Data Management API**
36+
* Securely manage all your core news data, including headlines, topics, sources, and countries.
37+
* The API supports flexible querying, filtering, and sorting, allowing your app to display dynamic content feeds.
38+
> **Your Advantage:** A powerful and secure data backend that's ready to scale with your content needs. 📈
4139
42-
* 🌐 **Dynamic Remote Configuration:** Centrally manage application
43-
behavior—including ad frequency, feature flags, and maintenance status—without
44-
requiring a client-side update.
40+
#### 🌐 **Dynamic Remote Configuration**
41+
* Centrally manage your app's behavior without shipping an update.
42+
* Control ad frequency, feature flags, force-update prompts, and maintenance status directly from the server.
43+
> **Your Advantage:** Adapt your app on the fly, run experiments, and respond to issues instantly, giving you maximum operational control. 🕹️
4544
46-
* 📊 **Dynamic Dashboard Summary:** Access real-time, aggregated metrics on
47-
key data points like total headlines, topics, and sources, providing
48-
an at-a-glance overview for administrative dashboards.
45+
#### 📊 **Real-Time Dashboard Analytics**
46+
* Access real-time, aggregated metrics on key data points like total headlines, topics, and sources.
47+
* Provides an at-a-glance overview perfect for administrative dashboards.
48+
> **Your Advantage:** Instantly feed your content dashboard with the data it needs to provide valuable insights. 🎯
4949
50-
* 🔧 **Solid Technical Foundation:** Built with Dart and the high-performance
51-
Dart Frog framework, offering a maintainable codebase, standardized API
52-
responses, and built-in access control for developers.
50+
#### 🏗️ **Clean & Modern Architecture**
51+
* Built with Dart and the high-performance Dart Frog framework.
52+
* Features a clean, layered architecture with standardized API responses and built-in dependency injection.
53+
> **Your Advantage:** A solid, maintainable codebase that's easy to understand, extend, and build upon. 🔧
5354
54-
## 🔌 API Endpoints
55+
---
5556

56-
`ht_api` provides a clear and organized API surface under the `/api/v1/` path.
57-
Key endpoint groups cover authentication, data access, and user settings.
57+
## 🔑 License: Source-Available with a Free Trial
5858

59-
For complete API specifications, detailed endpoint documentation,
60-
request/response schemas, and error codes, please refer to the dedicated
61-
documentation website [todo:Link to the docs website].
59+
Get started for free and purchase when you're ready to launch!
6260

63-
## 🔑 Access and Licensing
61+
* **TRY IT:** Download and explore the full source code under the PolyForm Free Trial [license](LICENSE). Perfect for evaluation.
62+
* **BUY IT:** Get an unlimited commercial lifetime license with a **one-time payment**. No subscriptions!
63+
* **GET YOURS:** [**Purchase via GitHub Sponsors**](https://github.com/sponsors/flutter-news-app-full-source-code).
6464

65-
`ht_api` is source-available as part of the Headlines Toolkit ecosystem.
65+
> *<pstyle="color:grey">Note: The single purchase provides a comprehensive commercial license covering every repository within the [Flutter News App Toolkit](https://github.com/flutter-news-app-full-source-code) organization. No separate purchases are needed for the mobile app or dashboard.</p>*
6666
67-
To acquire a commercial license for building unlimited news applications, please visit
68-
the [Headlines Toolkit GitHub organization page](https://github.com/headlines-toolkit)
69-
for more details.
67+
---
7068

71-
## 💻 Setup & Running
69+
## 🚀 Getting Started & Running Locally
7270

7371
1. **Prerequisites:**
7472
* Dart SDK (`>=3.0.0`)
7573
* MongoDB (`>=5.0` recommended)
7674
* Dart Frog CLI (`dart pub global activate dart_frog_cli`)
7775

78-
2. **Configuration:**
79-
Before running the server, you must configure the necessary environment
80-
variables.
76+
2. **Clone the repository:**
77+
```bash
78+
git clone https://github.com/flutter-news-app-full-source-code/flutter-news-app-api-server-full-source-code.git
79+
cd flutter-news-app-api-server-full-source-code
80+
```
8181

82+
3. **Configure your environment:**
8283
Copy the `.env.example` file to a new file named `.env`:
8384
```bash
8485
cp .env.example .env
8586
```
86-
Then, open the new `.env` file and update the variables with your actual
87-
configuration values, such as the `DATABASE_URL`.
87+
Then, open the new `.env` file and update the variables with your actual configuration values (e.g., `DATABASE_URL`).
8888

89-
3. **Clone the repository:**
90-
```bash
91-
git clone https://github.com/headlines-toolkit/ht-api.git
92-
cd ht-api
93-
```
9489
4. **Get dependencies:**
9590
```bash
9691
dart pub get
9792
```
93+
9894
5. **Run the development server:**
9995
```bash
10096
dart_frog dev
10197
```
102-
The API will typically be available at `http://localhost:8080`. On startup,
103-
the server will connect to your MongoDB database and seed it with initial
104-
fixture data. This seeding process is idempotent (using `upsert`
105-
operations), so it can be run multiple times without creating duplicates.
98+
The API will be available at `http://localhost:8080`. On startup, the server will connect to your MongoDB database and seed it with initial data. This process is idempotent, so it can be run multiple times without creating duplicates.
10699

107-
108-
**Note on Web Client Integration (CORS):** To allow web applications (like
109-
the HT Dashboard) to connect to this API in production, the
110-
`CORS_ALLOWED_ORIGIN` environment variable must be set to the specific
111-
origin of your web application (e.g., `https://your-dashboard.com`).
112-
113-
For local development, the API automatically allows any request
114-
originating from `localhost` on any port, so you do not need to set this
115-
variable.
100+
---
116101

117102
## ✅ Testing
118103

119-
Ensure the API is robust and meets quality standards by running the test suite:
104+
This project aims for high test coverage to ensure quality and reliability.
120105

121-
```bash
122-
# Ensure very_good_cli is activated: dart pub global activate very_good_cli
123-
very_good test --min-coverage 90
124-
```
125-
126-
Aim for a minimum of 90% line coverage.
106+
* Run tests with:
107+
```bash
108+
very_good test --min-coverage 90

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /