Skip to content

goozdev/little-stories

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Little Stories

A Flutter app for creating and managing personal story collections with Firebase Firestore integration.

Features

  • 📝 Create, edit, and delete personal stories
  • 🌙 Light and dark theme support with system detection
  • 💾 Cloud storage with offline persistence using Firebase Firestore
  • 🎨 Material Design 3 with custom cream/beige color scheme
  • 📱 Responsive UI with loading states and error handling
  • 🔄 Pull-to-refresh functionality
  • ⚙️ Settings screen for theme customization

Architecture

  • State Management: Provider pattern for reactive UI updates
  • Database: Firebase Firestore with offline persistence
  • Theme: Custom Material Design 3 themes with SharedPreferences persistence
  • Navigation: Flutter's built-in navigation system
  • Data Models: Immutable Story model with serialization support

Project Structure

lib/
├── models/
│   └── story.dart              # Story data model
├── services/
│   └── firestore_service.dart  # Firebase integration
├── controllers/
│   ├── story_controller.dart   # Story state management
│   └── theme_controller.dart   # Theme state management
├── theme/
│   └── app_theme.dart          # Custom theme definitions
├── widgets/
│   ├── common_loading_state.dart
│   ├── common_empty_state.dart
│   └── story_card.dart         # Story list item widget
├── screens/
│   ├── story_list_screen.dart  # Main story list
│   ├── story_form_screen.dart  # Create/edit stories
│   ├── story_detail_screen.dart # Story viewer
│   └── settings_screen.dart    # App settings
└── main.dart                   # App entry point

Setup Instructions

Prerequisites

  • Flutter 3.32.8 or later
  • Dart SDK
  • Android Studio or VS Code with Flutter extensions
  • Firebase project with Firestore enabled

Installation

  1. Clone the repository

    git clone <your-repo-url>
    cd little-stories
  2. Install dependencies

    flutter pub get
  3. Firebase Setup

    • Create a new Firebase project at Firebase Console
    • Enable Firestore Database
    • Add an Android app to your Firebase project
    • Download the google-services.json file
    • Replace the placeholder file in android/app/google-services.json
  4. Update package name (optional)

    • If you want to change the package name from com.example.littlestories
    • Update android/app/build.gradle (applicationId)
    • Update android/app/src/main/AndroidManifest.xml
    • Update android/app/src/main/kotlin/ folder structure
    • Update Firebase project configuration
  5. Run the app

    flutter run

Firebase Configuration

The app uses Firebase Firestore for data persistence. The database structure is:

stories (collection)
├── {documentId}
    ├── title: string
    ├── content: string
    ├── createdAt: timestamp
    └── updatedAt: timestamp

Firestore Security Rules

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /stories/{document} {
      allow read, write: if true; // Update this for production
    }
  }
}

Note: Update security rules for production to include proper authentication.

Development

Git Commit Style

This project uses Conventional Commits:

  • feat: New features
  • fix: Bug fixes
  • docs: Documentation changes
  • style: Code style changes
  • refactor: Code refactoring
  • test: Adding tests
  • chore: Maintenance tasks

Running Tests

flutter test

Building for Release

flutter build apk --release

Troubleshooting

Common Issues

  1. Firebase connection issues

    • Verify google-services.json is properly configured
    • Check internet connectivity
    • Ensure Firestore is enabled in Firebase Console
  2. Build errors

    • Run flutter clean && flutter pub get
    • Check Flutter and Dart SDK versions
    • Verify Android SDK is properly installed
  3. Theme not persisting

    • Check SharedPreferences permissions
    • Verify theme controller initialization

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes using conventional commit style
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Flutter team for the excellent framework
  • Firebase for cloud services
  • Material Design team for design guidelines

About

A Flutter app for creating and managing personal story collections with Firebase Firestore integration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors