A cross-platform mobile application for timber service SMEs, built with Flutter and Supabase.
- Authentication: Secure login and registration with Supabase Auth
- Dashboard: Net profit, revenue, expenses, and cost distribution (donut chart)
- Ledger: Transaction list with search, grouped by date
- Add Transaction: Income/expense form with timber-specific categories
- Revenue Insights: Trend chart and forecasting (seasonal regression, random forest, SARIMA-class models via optional API)
- Financial Reports: Monthly/quarterly PDF generation and sharing
- Settings: Profile and logout
- Flutter SDK (^3.11.1)
- Supabase project
- (Optional) Python 3.10+ for forecasting API
cd logbook
flutter pub getThe app is pre-configured with a Supabase project. To use your own:
- Create a project at supabase.com
- Copy
.env.exampleto.envand add your Supabase URL and anon key - Run migrations: Supabase Dashboard → SQL Editor → run all files in
supabase/migrations/ - (Optional) Seed data: run
supabase/seed.sqlin the SQL Editor. This inserts sample transactions for the first user. Sign up in the app first if you want demo data.
Forgot password (OTP): The app uses an 8-digit OTP instead of a reset link. In Supabase Dashboard → Authentication → Email Templates, edit the Reset password template to use {{ .Token }} instead of the confirmation URL, e.g.:
<h2>Reset your password</h2>
<p>Enter this code in the app: {{ .Token }}</p>flutter runcd forecasting_api
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
uvicorn main:app --reload --host 0.0.0.0 --port 8000Add to .env (see .env.example):
- iOS simulator, macOS, web:
FORECAST_API_URL=http://127.0.0.1:8000 - Android emulator (host machine):
FORECAST_API_URL=http://10.0.2.2:8000
The Insights screen sends your full monthly income history (with yyyy-MM labels) to POST /forecast. The Python service fits naive, seasonal naive, linear regression (trend + 12‑month season), random forest, and SARIMAX (orders depend on history length), picks the best on a small hold-out window when there is enough data, and returns MAE / RMSE / MAPE for the chosen method vs baselines in the JSON (shown in the chart info sheet when present). If FORECAST_API_URL is unset or the API is unreachable, only recorded income is shown.
Using --host 0.0.0.0 lets physical devices on the same LAN reach the API if you set FORECAST_API_URL to your machine’s LAN IP.
lib/
├── main.dart
├── app/ # bootstrap, root widget, auth gate, main shell, providers
├── core/ # app config, theme, Supabase init, networking, utils
│ ├── config/
│ ├── network/
│ ├── supabase/
│ ├── theme/
│ └── utils/
├── features/
│ ├── auth/ # application + presentation (login, register, password)
│ ├── categories/ # category repository
│ ├── dashboard/
│ ├── insights/ # forecast client + insights UI
│ ├── organization/ # organization repository
│ ├── reports/ # report service + PDF UI
│ ├── settings/
│ └── transactions/ # repository, offline queue, ledger + add transaction screens
└── shared/ # reusable UI + widgets
├── ui/
└── widgets/
- Frontend: Flutter, Provider, fl_chart, google_fonts
- Backend: Supabase (PostgreSQL, Auth)
- Reports: pdf, printing, share_plus
- Forecasting: Python FastAPI, pandas, scikit-learn, statsmodels (optional)