julienlebren/Boobook
Your library management assistant at school!
gehe zu github herunterladenBoobook
This open-source project shows how to build a Flutter app with:
- [x] Firebase Authentication to handle user authentication
- [x] Firebase Firestore for a reactive database
- [x] Riverpod to handle state management
- [x] RevenueCat to configure in-app subscription easily
- [x] ISBNdb to fetch the books from their ISBN code
A lot of other topics are also covered by this project:
- [x] Learn the repository pattern architecture
- [x] Simple routing with homemade router (Navigator 1.0)
- [x] Use the dedicated OS components (CupertinoScaffold on iOS vs Scaffold on Android, for example)
- [x] Handle localization thanks to flutter_localizations and Riverpod
- [x] Reuse components through all your apps made with Flutter
App Overview
Boobook is a simple book library manager designed for teachers, to manage book loans to pupils.
The application is composed by five primary screens: Loans, Books, Scan, Pupils, and Settings.
On the first launch, the app asks the user to sign-in. This step can be skiped by selecting “Continue without account”, which leads to the creation of an anonymous user on Firebase.
The Loans page displays the books which are currently loaned, with the remaining time before the expected return of the book. This time is displayed in green if it’s far away, in orange for the last days, and in red if the date has been exceeded. Tap on a loan opens some options that allow you to end up the loan, or to extend it if needed.
Open the Books page to see the list of your books. A colored dot indicates whether the book is available or not. Tap on a book to edit its name or its cover picture.
In the Pupils page, you can see the list of your pupils, with the number of current loans. You can print all the membership cards at once by tapping on the top-right button. Tap on a pupil to edit his name or his card picture, or also to print his member card.
Use the Scan page to open your device camera and be able to scan a book. If the book is not yet in your book list, you will be offered to add it, and if it’s already added, you will be offered to scan a pupil card or pick a pupil in your list, to create a new loan.
Finally, the Settings page allows you to setup some features: the max number of simultaneous loans, the default duration for a loan, the title on the membership cards. Some appearance settings are also available, such as the default language displayed and the theming of the app (light or dark).
Features
- Register all your books, by adding them manually or by scanning their barcode
- Create all your pupils, which will generate for you member cards that you can print out to give to your pupils
- Scan a book and a membership card to generate a loan in a few seconds!
- Online data persistence with Firestore
App Structure
The project folders are structured like this:
/controllers
/models
/l10n
/presentation
/common_widgets
/routes
/theme
/views
/home
/codes
/loans
/pupils
/scan
/settings
/subscription
/sign_in
/splash
/repositories
lib
folder only contains main.dart which contains the main Widget to make the app launchable, and common_providers.dart which includes some providers reused all accross the code.
Then inside lib
you will find:
controllers
which contains our “freezed” state filesmodels
which contains all the models (generated with Freezed)l10n
with contains the arb files for localizationpresentation
with all the ui stuff (subfolders detailed below)repositories
which contains the repositories used to access the database
presentation
presentation
is divided in subfolders:
common_widgets
with all the widgets which are used more than onceroutes
which contains the app routertheme
which contains the layout stuffviews
which contains the pages.
views
views
is also divided in subfolders:
home
which contains the content of the app once the user is logged insign_in
which contains the sign in pagesplash
which contains the splash page, ie the first view loaded when the app starts
home
home
is generally divided with subfolders for each part of the app, usually once per tab when using a TabScaffold.
Missing files in the repository
Some files are voluntary missing in the repository, for security reasons:
android/app/google-services.json
which is the file to make Firebase work on Android devicesios/Runner/GoogleService-Info.plist
which is the file to make Firebase work on iOS devicesios/Runner/Info.plist
which I decided to hide because it clearly displays the Facebook app secret for Facebook Loginlib/config.dart
which is detailed below
config.dart
The app requires this dart file to work:
final isbnApiKey = "your_isbndb_api_key";
const purchasesApiKey = 'your_revenuecat_api_key';
const entitlementId = 'your_purchase_entitlement';
const privacyPolicyURL = "https://boobook.app/privacy";
const termsURL = "https://www.apple.com/legal/internet-services/itunes/dev/stdeula/";
class FirestorePath {
static String pupils = "pupils";
static String books = "books";
static String loans = "loans";
static String users = "users";
}
class StoragePath {
static String users = "users";
static String pupils = "pupils";
static String books = "books";
}
Something important about the way the source code is built
This source code refers to a lot of personal Flutter packages hosted on my GitHub repository.
These packages have been created for my personal Flutter projects because I reuse a lot of code accross all my Flutter projects to avoid too much copy and paste across all my projects.
If you want to understand all the source code of Boobook, you will need to have a look to each package the code refers to:
- [x] avatar generates a profile picture with a photo or a fallback with initials
- [x] extensions brings some extensions on common classes that I use a lot in all my apps
- [x] firestore_service is a class that helps to handle data from Firestore
- [x] firebase_storage_service is a class that helps to upload or download files from Firebase Storage
- [x] layout_builder brings all the layout stuff I use in my apps with ready-to-use cross-platform widgets
- [x] photo_upload is a ready-to-use widget+controller to upload pictures using
firebase_storage_service
- [x] sign_in is a ready-to-use widget+controller to handle authentication with Firebase Auth
- [x] purchases bring some help to handle in-app purchases using RevenueCat]
These packages are hosted on my GitHub repository and not as official packages on pub.dev because they are built only to fit my personal needs and I regulary make important breaking changes.
Future Roadmap
- [ ] Generate and print custom barcodes in order to handle magazines inside the app (magazines do not have ISBN like books so they cannot be handled by scanning the barcode like a book)
- [ ] Change the way to display account details in the Settings tab
- [ ] Better display of the subscription, with maybe some alert when the free quota is about to be reached
- [ ] Avoid to scope localizationProvider
![](/images/banner-woo.jpg)
herausragende projekte, die mit julienlebren/Boobook zusammenhängen, empfohlener download
AppFlowy
47859
AppFlowy is an open-source alternative to Notion. You are in charge of your data and customizations. Built with Flutter and Rust.
localsend
33797
An open-source cross-platform alternative to AirDrop
spotube
23772
🎧 Open source Spotify client that doesn't require Premium nor uses Electron! Available for both desktop & mobile!
revanced-manager
15035
💊 Application to use ReVanced on Android
gsy_github_app_flutter
14559
Flutter 超完整的开源项目,功能丰富,适合学习和日常使用。GSYGithubApp系列的优势:我们目前已经拥有Flutter、Weex、ReactNative、kotlin 四个版本。 功能齐全,项目框架内技术涉及面广,完成度高,持续维护,配套文章,适合全面学习,对比参考。跨平台的开源Github客户端App,更好的体验,更丰富的功能,旨在更好的日常管理和维护个人Github,提供更好更方便的驾车体验Σ( ̄。 ̄ノ)ノ。同款Weex版本 : https://github.com/CarGuo/GSYGithubAppWeex 、同款React Native版本 : https://github.com/CarGuo/GSYGithubApp 、原生 kotlin 版本 https://github.com/CarGuo/GSYGithubAppKotlin
dio
12249
A powerful HTTP client for Dart and Flutter, which supports global settings, Interceptors, FormData, aborting and canceling a request, files uploading and downloading, requests timeout, custom adapters, etc.
gopeed
11832
A modern download manager that supports all platforms. Built with Golang and Flutter.
bloc
11441
A predictable state management library that helps implement the BLoC design pattern
getx
9899
Open screens/snackbars/dialogs/bottomSheets without context, manage states and inject dependencies easily with Get.
flame
8846
A Flutter based game engine.
flutter_deer
7595
🦌 Flutter 练习项目(包括集成测试、可访问性测试)。内含完整UI设计图,更贴近真实项目的练习。Flutter practice project (including integration testing and accessibility testing). Contains complete UI design drawings for a more realistic practice project.
fish-redux
7343
An assembled flutter application framework.
hiddify-next
7232
Multi-platform auto-proxy client, supporting Sing-box, X-ray, TUIC, Hysteria, Reality, Trojan, SSH etc. It’s an open-source, secure and ad-free.
ente
6686
Fully open source, End to End Encrypted alternative to Google Photos and Apple Photos
fl_chart
6451
FL Chart is a highly customizable Flutter chart library that supports Line Chart, Bar Chart, Pie Chart, Scatter Chart, and Radar Chart.
pixez-flutter
6360
一个支持免代理直连及查看动图的第三方Pixiv flutter客户端
Flutter-Responsive-Admin-Panel-or-Dashboard
6355
Responsive Admin Panel or Dashboard using Flutter
aidea
6021
AIdea 是一款支持 GPT 以及国产大语言模型通义千问、文心一言等,支持 Stable Diffusion 文生图、图生图、 SDXL1.0、超分辨率、图片上色的全能型 APP。
riverpod
5828
A reactive caching and data-binding framework. Riverpod makes working with asynchronous code a breeze.
pikapika
5463
美观易用且无广告的漫画和游戏客户端,同时支持MacOS,Windows,Android,iOS。