blackscythe123/flashbook
Flashbook transforma a experiência de leitura de livros em um feed vertical moderno e voltado para dispositivos móveis. Como o Instagram, mas para consumo de conhecimento.
- Stars
- 1
- Forks
- 1
- Último push (UTC)
- 20 de mai. de 2026
- Status do projeto
- Ativo
Tópicos técnicos
Dependências usadas
Lista de dependências 16 itens
- flutter
{"sdk":"flutter"} - cupertino_icons
^1.0.8 - provider
^6.1.2 - http
^1.2.2 - google_fonts
^6.2.1 - flutter_animate
^4.5.0 - file_picker
^8.1.6 - shared_preferences
^2.2.2 - uuid
4.5.2 - cached_network_image
3.3.1 - permission_handler
^11.3.1 - gal
^2.3.0 - universal_html
^2.3.0 - flutter_testDesenvolvimento
{"sdk":"flutter"} - flutter_lintsDesenvolvimento
^5.0.0 - flutter_launcher_iconsDesenvolvimento
^0.14.3
README original
Texto original em inglês. Visite o GitHub para a versão atual.
Expandir / recolher README
Flashbook
Flashbook is a Flutter-based learning app that converts books and PDFs into swipeable, AI-generated learning cards with progress sync, visual generation, and cloud-backed user state.
What Flashbook Does
- Upload a PDF (or choose a demo source).
- Extract and chunk text.
- Generate structured chapter cards using AI.
- Render an Instagram-style vertical feed for reading.
- Save progress and resume across sessions/devices.
Current Architecture (Implemented)
Production path:
Flutter app -> API Gateway -> Lambda handlers -> DynamoDB/S3/Cognito -> Gemini APIs
The repository also contains a local FastAPI backend for local/dev workflows.
Core Features
- AI chapter summarization into structured learning cards.
- Vertical reading feed with progressive loading.
- PDF upload via presigned S3 URL.
- Batch text extraction from S3-stored PDF pages.
- On-demand AI image generation for visual blocks.
- Reading progress sync and resume support.
- Cognito-based auth with token refresh.
- Library management (list, resume, delete books).
- Bookmarks and notes support (notes backend exists; current UI uses local note persistence).
Tech Stack
Frontend:
- Flutter
- Provider (state management)
- HTTP package
- SharedPreferences
Backend (AWS path):
- API Gateway (REST)
- AWS Lambda (Python)
- DynamoDB
- S3
- Cognito
- CloudWatch logs
AI:
- Google Gemini text model (summary generation)
- Google Gemini image model (image generation)
Local/dev backend:
- FastAPI + Uvicorn
- Pydantic
- pypdf
Repository Structure
flashbook/
├── lib/ # Flutter app
│ ├── screens/ # UI screens
│ ├── state/ # Providers
│ ├── services/ # API/auth/storage services
│ ├── models/ # Data models
│ └── widgets/ # Reusable UI widgets
├── backend/
│ ├── main.py # FastAPI entrypoint (local mode)
│ ├── src/ # FastAPI modules (api/core/services)
│ └── aws/
│ ├── template.yaml # SAM infrastructure
│ ├── handlers/ # Lambda handlers
│ └── events/ # Local SAM test events
├── assets/ # Static app assets
└── *.md # Design, analysis, architecture docs
API Surface (AWS)
Public endpoints:
GET /healthPOST /auth/signupPOST /auth/loginPOST /auth/verifyPOST /auth/refresh
Protected endpoints (Cognito authorizer by default):
POST /extractTextPOST /generateSummaryPOST /generateImageGET|POST|PUT|DELETE /notes/*POST|GET|PUT|DELETE /books/*
Data Model Overview
DynamoDB tables:
flashbook-slides
- PK:
book_id - SK:
chapter_hash - TTL:
expires_at - Purpose: summary response cache
flashbook-notes
- PK:
note_id - GSI:
book_id-index - Purpose: notes storage
flashbook-user-books
- PK:
user_id - SK:
book_id - Purpose: user library metadata, progress, extraction status, image URL map
S3 buckets:
flashbook-pdfs-<account>: uploaded source PDFsflashbook-images-<account>: generated images
Main User Flow
- App launches and checks API health.
- Auth session restore runs via refresh token.
- User uploads PDF.
- App requests upload URL (
/books/upload) and uploads to S3. - Backend confirms and counts pages (
/books/{id}/confirm). - App extracts first page batch (
/extractText). - App generates chapter cards (
/generateSummary) with cache support. - User reads in vertical feed; progress syncs (
/books/{id}/progress). - Visual cards trigger lazy image generation (
/generateImage).
Running the Flutter App
Prerequisites:
- Flutter SDK (stable)
- Android Studio/Xcode or connected device
Commands:
flutter pub get
flutter run
Backend URL config:
- Production URL is configured in
lib/services/api_config.dart.
Running Local FastAPI Backend (Optional)
Use this for local backend development/testing.
cd backend
python -m venv venv
# Windows
venv\Scripts\activate
pip install -r requirements.txt
python main.py
Open docs at:
http://localhost:8080/docs
Deploying AWS Backend (SAM)
Prerequisites:
- AWS CLI configured
- SAM CLI installed
cd backend/aws
sam build
sam deploy --guided
After deploy:
- Copy
ApiUrlfrom stack outputs. - Set/update
prodUrlinlib/services/api_config.dartif needed.
Important Implementation Notes
- Built vs documented target architecture
- Implemented backend uses Gemini APIs directly.
- Some docs mention Bedrock/CloudFront/Redis/X-Ray/analytics as future architecture targets.
- Dual backend code paths
- AWS Lambda path is the main production path.
- FastAPI path remains for local/dev and migration support.
- Notes behavior
- Backend notes APIs are implemented.
- Current app
NoteProviderstill stores notes locally in SharedPreferences.
Security Notes
- Cognito JWT auth protects most API routes.
- Public routes are mainly health/auth and CORS preflight handlers.
- Tokens are currently stored in SharedPreferences for prototype speed.
- For production hardening, migrate token storage to secure keystore/keychain.