Skip to content

riyad-from-space/Connect

Repository files navigation

Connect

A social networking app built with Flutter featuring blogs, real-time chat, AI-powered features, and personalized feeds.

Architecture

The project follows Clean Architecture with a feature-first folder structure:

lib/
├── main.dart
├── app/
│   ├── router/         # Route definitions (onGenerateRoute)
│   ├── shared/         # Shared widgets (buttons, text fields, headers)
│   └── theme/          # App theme, ThemeProvider
├── core/
│   ├── constants/      # Colors, static values
│   ├── enums/          # Auth status, app enums
│   ├── error/          # Failure classes, Either typedefs
│   ├── storages/       # SharedPreferences service
│   └── extensions/     # BuildContext extensions
└── features/
    ├── auth/
    │   ├── domain/     # UserEntity, AuthRepository (abstract), UseCases
    │   ├── data/       # UserModel (Freezed), Firebase datasource, repo impl
    │   └── presentation/ # Riverpod providers, screens, widgets
    ├── onboarding/
    │   ├── domain/     # OnboardingPageEntity, repository interface
    │   ├── data/       # Firebase datasource, repo implementation
    │   └── presentation/ # Providers, intro screen, topic selection
    ├── splash/
    │   └── presentation/ # Video splash screen
    ├── blogs/          # Blog CRUD, AI summarization, TTS
    ├── chat/           # Real-time messaging
    ├── home/           # Feed with category filtering
    ├── settings/       # Theme toggle, privacy, help
    ├── user/           # User model, auth repository, follow system
    └── user_profile/   # Profile view with posts and followers

Feature Layer Pattern

Each feature follows this structure:

Layer Purpose
domain/entities/ Freezed immutable classes
domain/repositories/ Abstract interfaces
domain/usecases/ Single-action classes
data/models/ Freezed + JsonSerializable
data/datasources/ Firebase / API implementations
data/repositories/ Implements domain interface
presentation/providers/ Riverpod StateNotifier + Freezed state
presentation/screens/ Full-page widgets
presentation/views/ Composed UI with provider listeners
presentation/widgets/ Small reusable components

Tech Stack

State Management

  • flutter_riverpod - Reactive state management with providers

Code Generation

  • freezed + freezed_annotation - Immutable classes, sealed unions, copyWith
  • json_serializable + json_annotation - JSON codegen for models
  • build_runner - Code generation runner

Backend

  • firebase_core - Firebase initialization
  • firebase_auth - Email/password authentication with email verification
  • cloud_firestore - NoSQL database for users, blogs, chats
  • firebase_messaging - Push notifications
  • flutter_local_notifications - Local notification display

Error Handling

  • dartz - Either<Failure, Success> for type-safe error handling

Storage

  • shared_preferences - Local settings (theme, onboarding status)
  • flutter_secure_storage - Secure token storage

UI

  • google_fonts - Poppins typography
  • introduction_screen - Onboarding carousel
  • pin_code_fields - OTP input
  • video_player - Splash screen video
  • fluttertoast - Toast notifications

Utilities

  • http - HTTP client for AI API calls
  • uuid - Unique ID generation
  • intl - Date/time formatting
  • flutter_tts - Text-to-speech for blog AI features

App Flow

Splash Screen
    ├── First launch → Introduction Screen → Signup Type
    ├── Logged in → Home Screen
    └── Not logged in → Signup Type Screen

Auth Flow
    ├── Sign Up → Email Verification → Topic Selection → Home
    ├── Log In → Home
    └── Forgot Password → Reset Email → Login

Main App
    ├── Home (feed with categories)
    ├── Create/Edit Blog Posts
    ├── AI Features (summarize, text-to-speech)
    ├── Chat (real-time messaging)
    ├── User Profiles (follow, view posts)
    └── Settings (theme, privacy, logout)

Getting Started

# Install dependencies
flutter pub get

# Generate Freezed/JSON files
dart run build_runner build --delete-conflicting-outputs

# Run the app
flutter run

Firebase Setup

The app requires a Firebase project with:

  • Authentication (Email/Password)
  • Cloud Firestore
  • Cloud Messaging

Configure your google-services.json (Android) and GoogleService-Info.plist (iOS) in the respective platform directories.

Firestore Collections

Collection Purpose
users User profiles, selected topics, FCM tokens
blogs Blog posts with metadata
comments Post comments
reactions Like tracking
chats Conversation threads
messages Chat messages
categories Available post categories

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors