Skip to content

A cross-platform Flutter app (iOS & Android) that allows users to register, log in, and manage blog posts through a secure REST API backend built with Spring Boot. Includes JWT authentication, form validation, and persistent login.

Notifications You must be signed in to change notification settings

shuvojoseph/BlogPostFlutter

Repository files navigation

📱 Flutter BlogPost App

A cross-platform blog management client built with Flutter, Provider (MVVM), Dio, and JSON serialization, designed for Android and iOS devices.

This app allows users to register, authenticate, view blog posts, and create/update/delete their own posts. It follows clean architectural patterns with proper state management and secure token storage.


🌟 About the Project

The Flutter BlogPost App is the Flutter version of our previously built React Native blog system. It is connected to a Spring Boot backend that provides authentication, authorization, blog CRUD operations, and ownership logic.

The goal of this project is to demonstrate:

  • A clean Flutter architecture (MVVM + Provider)
  • Real-world networking with Dio
  • Token handling with flutter_secure_storage
  • JSON model generation with json_serializable
  • Writing maintainable UI + Unit Tests

This is a perfect small-scale mobile app example for learning Flutter or showcasing production-quality structuring.


🚀 Features

🔐 Authentication

  • Register
  • Login
  • Server-issued access & refresh tokens
  • Tokens stored securely on the device
  • Auto login if token exists

📝 Blog Management

  • View all blogs
  • Create a blog post
  • Edit a blog post (only if owner/co-owner)
  • Delete a blog post
  • Automatic UI updates (Provider)

💾 Local Storage

  • Secure token storage using flutter_secure_storage

📡 Networking

  • Built with dio
  • Clean API Client layer
  • Repository pattern

🗄 Backend Details

The backend is a Spring Boot REST API, hosted on Render.

Render servers may sleep after ~45 minutes of inactivity.

To wake up the backend before using the app:

👉 Open this link in a browser:

https://blogpostspringboot.onrender.com/api/blogs

Once active, the Flutter app will work normally.


📸 Screenshots

🧭 Authentication Screens

iOS Android
iOS Login
Login Screen (iOS)
Android Login
Login Screen (Android)
iOS Register
Register Screen (iOS)
Android Register
Register Screen (Android)

🏠 Home & Dashboard

iOS Android
iOS Home
Home Screen (iOS)
Android Home
Home Screen (Android)

🏗 Tech Stack

Frontend (this app):

  • Flutter 3.x
  • Provider (MVVM State Management)
  • Dio (HTTP Networking)
  • Flutter Secure Storage
  • JSON Serializable + Build Runner

Backend:

  • Spring Boot REST API
  • JWT Authentication
  • Render Hosting

📦 Installation & Setup

1️⃣ Clone repository

git clone https://github.com/shuvojoseph/BlogPostFlutter.git
cd blog_post

2️⃣ Install dependencies

flutter pub get

3️⃣ Run on iOS Simulator

open -a Simulator
flutter run

4️⃣ Run on Android Emulator

flutter emulators --launch Pixel_9_Pro
flutter run

🧪 Unit Testing

Run all tests

flutter test

Run a single test file

flutter test test/viewmodels/auth_viewmodel_test.dart

Mockito setup

We use these command to generate mocked classes:

flutter pub run build_runner build

Mocks are located in:

/test/mocks/mock_classes.dart
/test/mocks/mock_classes.mocks.dart

📁 Project Structure

lib/
│
├── core/
│   ├── network/api_client.dart
│   ├── storage/secure_storage_service.dart
│   └── models/
│       ├── blog.dart
│       ├── blog.g.dart
│       ├── user.dart
│       └── user.g.dart   
│
├── data/
│   └── repositories/
│       ├── auth_repository.dart
│       └── blog_repository.dart
│
├── viewmodels/
│   ├── auth_viewmodel.dart
│   ├── dashboard_viewmodel.dart
│   └── blog_form_viewmodel.dart
│
├── ui/
│   └── views/
│       ├── login_view.dart
│       ├── register_view.dart
│       ├── dashboard_view.dart
│       └── blog_form_view.dart
│
└── main.dart

📄 License

This project is open-source under the MIT License.

About

A cross-platform Flutter app (iOS & Android) that allows users to register, log in, and manage blog posts through a secure REST API backend built with Spring Boot. Includes JWT authentication, form validation, and persistent login.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published