This repository contains the complete, production-ready source code for the backend API server that powers the entire Flutter News App ecosystem. Built with the high-performance Dart Frog framework, it gives you all the server-side features you need, right out of the box. It is the core component of the Flutter News App - Full Source Code Toolkit, serving the Flutter mobile app and the web-based content dashboard.
This API server comes packed with all the features you need to launch a professional, scalable news application.
- Provides secure, modern authentication flows, including passwordless email sign-in and anonymous guest accounts.
- Intelligently handles converting guest users to permanent accounts, preserving all their settings and saved content.
- Includes a separate, role-aware login flow for privileged dashboard users.
Your Advantage: You get a complete, secure authentication system without the complexity. All the user management logic is done for you. ✅
- Implement precise permissions with a dual-role system:
appRole
for mobile app features anddashboardRole
for admin functions. - Securely control access to API features and data management capabilities based on user roles.
Your Advantage: A powerful, built-in security model that protects your data and ensures users only access what they're supposed to. 🛡️
- Effortlessly sync user-specific settings like theme, language, and font styles across devices.
- Manage personalized content preferences, including saved headlines and followed topics/sources.
Your Advantage: Deliver a seamless, personalized experience that keeps users' settings in sync, boosting engagement and retention. ❤️
- Securely manage all your core news data, including headlines, topics, sources, and countries.
- The API supports flexible querying, filtering, and sorting, allowing your app to display dynamic content feeds.
Your Advantage: A powerful and secure data backend that's ready to scale with your content needs. 📈
- Centrally manage your app's behavior without shipping an update.
- Control ad frequency, feature flags, force-update prompts, and maintenance status directly from the server.
Your Advantage: Adapt your app on the fly, run experiments, and respond to issues instantly, giving you maximum operational control. 🕹️
- Access real-time, aggregated metrics on key data points like total headlines, topics, and sources.
- Provides an at-a-glance overview perfect for administrative dashboards.
Your Advantage: Instantly feed your content dashboard with the data it needs to provide valuable insights. 🎯
- Built with Dart and the high-performance Dart Frog framework.
- Features a clean, layered architecture with standardized API responses and built-in dependency injection.
Your Advantage: A solid, maintainable codebase that's easy to understand, extend, and build upon. 🔧
Get started for free and purchase when you're ready to launch!
- TRY IT: Download and explore the full source code under the PolyForm Free Trial license. Perfect for evaluation.
- BUY IT: One-time payment for a lifetime license to publish unlimited commercial apps.
- GET YOURS: Purchase via GitHub Sponsors.
Note
A single purchase provides a commercial license for every repository within the Flutter News App - Full Source Code Toolkit. No other purchases are needed..
-
Prerequisites:
- Dart SDK (
>=3.0.0
) - MongoDB (
>=5.0
recommended) - Dart Frog CLI (
dart pub global activate dart_frog_cli
)
- Dart SDK (
-
Clone the repository:
git clone https://github.com/flutter-news-app-full-source-code/flutter-news-app-api-server-full-source-code.git cd flutter-news-app-api-server-full-source-code
-
Configure your environment: Copy the
.env.example
file to a new file named.env
:cp .env.example .env
Then, open the new
.env
file and update the variables with your actual configuration values (e.g.,DATABASE_URL
). -
Get dependencies:
dart pub get
-
Run the development server:
dart_frog dev
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.
This project aims for high test coverage to ensure quality and reliability.
- Run tests with:
very_good test --min-coverage 90