Skip to content

Establish project foundation with clean architecture and core infrastructure#1

Merged
Muhammad-Bilal-03 merged 2 commits intomainfrom
copilot/setup-project-foundation
Feb 11, 2026
Merged

Establish project foundation with clean architecture and core infrastructure#1
Muhammad-Bilal-03 merged 2 commits intomainfrom
copilot/setup-project-foundation

Conversation

Copy link
Contributor

Copilot AI commented Feb 11, 2026

Sets up "Second Brain" Flutter app foundation: clean architecture structure, core dependencies, CI/CD, and base implementation. Enables immediate development on Phase 1 (Notes CRUD).

Architecture & Structure

  • Clean Architecture with feature-based modules (notes, chat, search, voice)
  • Three-layer separation per feature: data/, domain/, presentation/
  • Core infrastructure: constants/, errors/, theme/, utils/
  • .gitkeep files maintain empty directories in git (20 total)

Dependencies

State Management: Riverpod 2.6.1 with annotations and code generation
Database: Isar 4.0.0-dev.14 (local-first NoSQL with future pgvector sync)
UI: Material 3 theme, google_fonts, flutter_svg
Utils: uuid, intl, path_provider

Core Implementation

Theme: Material 3 with purple/indigo brain palette (#6B4EFF primary), light/dark modes

Error Handling: Base Failure class with ServerFailure, CacheFailure, GeneralFailure

Extensions:

'hello'.capitalize()           // "Hello"
DateTime.now().timeAgo         // "2 hours ago"
DateTime.now().formatted       // "Feb 11, 2026"

App Structure:

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(const ProviderScope(child: App()));
}

CI/CD

GitHub Actions workflow with Flutter 3.38.4 stable:

  • flutter pub getdart format --checkflutter analyzeflutter test
  • Triggers on push/PR to main

Documentation

  • README: 155 lines with architecture diagram, tech stack, 6-phase roadmap
  • ADR 001: Hybrid (local-first + cloud sync) architecture decision with rationale

App Constants

AppConstants.appName     // "Second Brain"
AppConstants.appVersion  // "0.1.0"
AppConstants.dbName      // "second_brain_db"

Placeholder home screen renders with brain icon and Material 3 theming. Tests updated for new structure.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • canonical-bos01.cdn.snapcraftcontent.com
    • Triggering command: /usr/lib/snapd/snapd /usr/lib/snapd/snapd --print-foreign-architectures (dns block)
  • google.com
    • Triggering command: /usr/bin/ping ping -c 1 google.com (dns block)
  • https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.24.0-stable.tar.xz
    • Triggering command: /usr/bin/wget wget -q REDACTED (http block)
    • Triggering command: /usr/bin/curl curl -L REDACTED -o flutter.tar.xz (http block)
  • https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.38.4-stable.tar.xz
    • Triggering command: /usr/bin/wget wget --quiet REDACTED -O flutter.tar.xz (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Overview

Set up the complete project foundation for "Second Brain" — a RAG-Powered Note Taking App built with Flutter. This PR should establish clean architecture, add core dependencies, set up CI/CD, and create a professional README.

Project Context

  • App: Second Brain — a local-first notes app where you can "chat" with your notes using AI
  • Tech Stack: Flutter, Riverpod, Isar DB, LangChain.dart, Google Gemini API, Supabase (pgvector)
  • Architecture: Clean Architecture + MVVM with feature-based folder structure
  • Project path: D:\second_brain
  • Flutter version: 3.38.4 (stable channel)
  • Dart version: 3.10.3

Tasks

1. 📁 Clean Architecture Folder Structure

Create the following folder structure with placeholder .gitkeep files so folders are tracked by Git:

lib/
├── app.dart                         # App widget with MaterialApp, theme, routing
├── main.dart                        # Entry point — initialize providers, run app (update existing)
├── core/
│   ├── constants/
│   │   └── app_constants.dart       # App-wide constants (app name, version, etc.)
│   ├── errors/
│   │   └── failures.dart            # Base Failure class for error handling
│   ├── theme/
│   │   └── app_theme.dart           # Light and dark theme definitions
│   └── utils/
│       └── extensions.dart          # Useful Dart extensions (String, DateTime, etc.)
├── features/
│   ├── notes/
│   │   ├── data/
│   │   │   ├── datasources/
│   │   │   │   └── .gitkeep
│   │   │   ├── models/
│   │   │   │   └── .gitkeep
│   │   │   └── repositories/
│   │   │       └── .gitkeep
│   │   ├── domain/
│   │   │   ├── entities/
│   │   │   │   └── .gitkeep
│   │   │   ├── repositories/
│   │   │   │   └── .gitkeep
│   │   │   └── usecases/
│   │   │       └── .gitkeep
│   │   └── presentation/
│   │       ├── providers/
│   │       │   └── .gitkeep
│   │       ├── screens/
│   │       │   └── .gitkeep
│   │       └── widgets/
│   │           └── .gitkeep
│   ├── chat/
│   │   ├── data/
│   │   │   └── .gitkeep
│   │   ├── domain/
│   │   │   └── .gitkeep
│   │   └── presentation/
│   │       └── .gitkeep
│   ├── search/
│   │   ├── data/
│   │   │   └── .gitkeep
│   │   ├── domain/
│   │   │   └── .gitkeep
│   │   └── presentation/
│   │       └── .gitkeep
│   └── voice/
│       ├── data/
│       │   └── .gitkeep
│       ├── domain/
│       │   └── .gitkeep
│       └── presentation/
│           └── .gitkeep
└── shared/
    ├── widgets/
    │   └── .gitkeep
    └── providers/
        └── .gitkeep

2. 📦 Core Dependencies in pubspec.yaml

Add these dependencies to the existing pubspec.yaml:

Dependencies:

dependencies:
  flutter:
    sdk: flutter
  # State Management
  flutter_riverpod: ^2.6.1
  riverpod_annotation: ^2.6.1
  
  # Local Database
  isar: ^4.0.0-dev.14
  isar_flutter_libs: ^4.0.0-dev.14
  
  # UI
  google_fonts: ^6.2.1
  flutter_svg: ^2.0.17
  
  # Utilities
  uuid: ^4.5.1
  intl: ^0.19.0
  path_provider: ^2.1.5
  
dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^5.0.0
  
  # Code Generation
  riverpod_generator: ^2.6.3
  build_runner: ^2.4.14
  isar_generator: ^4.0.0-dev.14

3. ⚙️ GitHub Actions CI/CD

Create .github/workflows/ci.yml:

  • Trigger on push and PR to main
  • Run flutter pub get
  • Run flutter analyze
  • Run flutter test
  • Use Flutter 3.38.4 stable

4. 📝 Professional README

Replace the existing README.md with a professional one that includes:

  • App name with emoji: 🧠 Second Brain
  • Short description: "RAG-Powered Note Taking App — Chat with your notes using AI"
  • Badges: Flutter, Dart, License MIT, CI status
  • Features section (planned): Notes CRUD, Semantic Search, RAG Chat, Voice-to-Note, Cloud Sync
  • Tech stack table: Flutter, Riverpod, Isar, LangChain.dart, Gemini API, Supabase
  • Architecture section: Clean Architecture + MVVM explanation with folder structure
  • Getting Started section: Prerequisites, Installation, Running
  • Roadmap section with phases:
    • Phase 1: Foundation (Notes CRUD) ⬅️ Current
    • Phase 2: Intelligence Layer (Embeddings + Vector Search)
    • Phase 3: RAG Chat (LangChain.dart + Gemini)
    • Phase 4: Cloud Sync (Supabase + pgvector)
    • Phase 5: Voice-to-Note
    • Phase 6: Polish & Ship
  • License: MIT
  • Author: Muhammad-Bilal-03

5. 📋 Architecture Decision Record

Create ADR/001-hybrid-architecture.md:

  • Title: Use Hybrid (Local-First + Cloud Sync) Architecture
  • Status: Accepted
  • Context: Why hybrid over pure local or pure cloud
  • Decision: Local-first with Isar DB + optional Supabase sync
  • Consequences: More complex but better UX, offline support, and skill demonstration

6. 🎨 App Theme & Base Structure

Create actual Dart files with real code:

lib/core/theme/app_theme.dart — Define light and dark themes using Material 3 with a custom color scheme (use a brain/purple theme — primary color around purple/indigo).

lib/core/constants/app_constants.dart — App name: "Second...

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: Muhammad-Bilal-03 <248140505+Muhammad-Bilal-03@users.noreply.github.com>
Copilot AI changed the title [WIP] Set up project foundation for Second Brain app Establish project foundation with clean architecture and core infrastructure Feb 11, 2026
@Muhammad-Bilal-03 Muhammad-Bilal-03 marked this pull request as ready for review February 11, 2026 14:21
@Muhammad-Bilal-03 Muhammad-Bilal-03 merged commit 01975a9 into main Feb 11, 2026
1 check failed
@Muhammad-Bilal-03 Muhammad-Bilal-03 deleted the copilot/setup-project-foundation branch February 11, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants