Android

Smart TMS – Android App Documentation

App v1.0.0 · needs website v1.7+

Overview

Smart TMS is the customer app for the Smart TMS – Tailor Management System website. A tailoring shop's customers follow their orders, bills, quotations and visits on their phone. Shop owners and staff keep using the website. The app talks only to your website, so all data stays on your server.

One app for every shopYou publish the app once. Each shop is found by its company code or QR code, so a single store listing serves every shop on your website.
Shop brandingEach owner sets the app title, colour, logo and welcome text from Mobile App in the web app. Customers see the shop's branding before they sign in.
Same rules as the websiteOrders, bills, taxes, payments and permissions come from the website's own code. Every request is limited to the signed-in customer's own shop and own data.
Push notificationsThrough Firebase: order moved on, order ready, new bill, payment received, quotation, visit reminders and messages from the shop. Inbox with unread badge.
SecureToken kept in the phone's secure storage (90 days); HTTPS only in release builds; optional fingerprint / face / PIN lock.
Control from the super adminStore links, minimum app version, maintenance notice and an on / off switch for every shop.

What is in the package

Folder / fileWhat it is
android_app/customer_app/The Flutter project of the Android app (package id com.smarttms.tms_customer), with its own android/ folder, lib/ (code), test/ (77 automatic tests), docs/openapi.yaml (API contract) and assets/ (icon).
android_app/README.mdShort setup, build, push and publishing guide.

The website itself (Smart TMS SaaS, version 1.7 or newer) is sold separately and must run on an HTTPS domain. The app is an add-on.

Features

  1. Find the shop by typing its company code, scanning its QR code or opening an invite link
  2. Sign in with email and password, two-factor code, optional fingerprint / face / PIN lock
  3. Home: orders in progress and ready, amount to pay, overdue and quotation alerts, the next visit, quick actions
  4. Orders with filters and a production thread timeline (cutting, stitching, finishing, trial, ready), photos, link to the bill, public tracking link
  5. Billing: bills, payments so far, pay online; quotations you can accept or decline
  6. Visits: book a measurement, fitting, pickup or chat in half-hour slots; move or cancel
  7. Shop: garments and starting prices with photos; ask for a quotation
  8. Measurements on file, a how-to-measure guide, and your own measurements from home that the shop checks and keeps
  9. Reviews: rate a finished order; the shop can show kind words on its website
  10. Chat with the shop and an inbox with push notifications
  11. Profile: name, phone, photo, language, shop contact buttons, password, app lock, delete account
  12. Last pages kept for offline viewing

Not included

Requirements

Your computer (to build the app)

Phones that can run the app

Accounts

Website

Install Flutter & Android Studio

  1. Install the Flutter SDK (3.27 or newer) from docs.flutter.dev and add flutter/bin to your PATH.
  2. Install Android Studio and, in SDK Manager, the latest Android SDK, Command-line Tools and Platform-Tools.
  3. Run flutter doctor --android-licenses and accept everything.
  4. Run flutter doctor. Fix every line that is not a green tick for Android.

Prepare the website

  1. Log in as the super admin and open Mobile App in the menu. Paste the store links (later), set the minimum app version (leave empty for none), a default colour and a welcome text.
  2. Log in as a shop owner and open Mobile App. You see the company code, the QR code and the invite link. Fill in the app title, colour, logo and which parts customers can see. Use New code if a code ever leaks.
  3. On the owner's Website, the Get our app block shows the QR code and the store buttons (it is on the home page of new websites; add it to older pages from Edit pages). It is also at /site/<shop>/app.
  4. Open https://your-website.com/api/v1/company/<code> in a browser. You should see the shop's JSON branding. If you do, the app will work.

Set up the project

  1. Unzip smart-tms-android-v1.0.0.zip and open a terminal in android_app/customer_app.
  2. flutter pub get
  3. Optional but recommended, check everything works before touching anything:
    flutter analyze
    flutter test
  4. Choose your own application id instead of com.smarttms.tms_customer:
    android/app/build.gradle.kts   (namespace and applicationId)
    android/app/src/main/kotlin/...  (move MainActivity to the same package)
  5. Set the website address. Either pass it when you run / build (--dart-define=API_BASE_URL=https://your-website.com), or leave it out and the first screen asks for the address (handy for testing).

Run on a phone or emulator

Run flutter devices to see what is connected.

On a real phone

  1. Turn on Developer options and USB debugging (Settings → About phone → tap Build number seven times).
  2. Connect the phone by USB and accept the prompt. flutter devices must list it.
  3. flutter run --dart-define=API_BASE_URL=https://your-website.com

On the emulator

Create a device in Android Studio → Device Manager, start it and run the same command. The emulator reaches your computer's own website at http://10.0.2.2 instead of localhost:

flutter run --dart-define=API_BASE_URL=http://10.0.2.2/product/smart-tms/smart-tms-saas/main_file

Debug builds accept plain http:// for testing. Release builds need HTTPS.

A test APK to share

flutter build apk --release --dart-define=API_BASE_URL=https://your-website.com

The file is build/app/outputs/flutter-apk/app-release.apk. Send it to a tester and ask them to allow installs from this source.

Which account to sign in with

Use a customer account of a shop (a user of type customer), with that shop's company code. Owner and staff accounts are not accepted by the app. A wrong password and a wrong shop give the same message.

Branding & customisation

Changes that need no new build (from the website)

Changes in the code (then build again)

WhatWhere
App name in the codelib/config.dart (AppConfig(appName: 'Smart TMS'))
Launcher nameandroid/app/src/main/AndroidManifest.xml (android:label)
IconReplace assets/icon.png and assets/icon_foreground.png, then dart run flutter_launcher_icons
Look (colours, cards, fonts)lib/util/theme.dart (the "atelier" theme)
Screenslib/screens/

The app's own screens are in English. The shop's messages (order updates, server errors) follow the language each customer picks in their profile.

Push notifications (Firebase)

Optional. Without it everything works and the in-app inbox still fills up; only the phone pop-ups are missing.

  1. Create a project in the Firebase console and add an Android app with the package name com.smarttms.tms_customer.
  2. Download google-services.json and put it in android/app/. The build switches push on only when this file exists.
  3. Server: Project settings → Service accounts → Generate new private key. Save the JSON on the server (outside the web folder) and set in .env:
    FCM_CREDENTIALS=/full/path/to/service-account.json

When customers are notified

Customers who never installed the app get no inbox items.

Version numbers

Change the number in pubspec.yaml (version: 1.0.0+1): the part before + is the version people see, the number after is the build number that must grow with every upload.

The super admin can force an update from Mobile App → Minimum app version: older apps then show an "update required" screen.

Signing key (keystore)

Google Play needs every release signed with your own key. Create it once and keep a backup: if you lose it you cannot update the app.

keytool -genkey -v -keystore ~/tms-upload.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload

Tell the build where the key is

Create android/key.properties (it is git-ignored):

storeFile=/home/you/tms-upload.jks
storePassword=your-store-password
keyAlias=upload
keyPassword=your-key-password

Without this file, release builds are signed with the debug key. That works for your own testing but Google Play will refuse it.

Build the release

cd android_app/customer_app
flutter pub get
flutter build appbundle --release --dart-define=API_BASE_URL=https://your-website.com

The file to upload is build/app/outputs/bundle/release/app-release.aab.

Always pass your HTTPS address with --dart-define=API_BASE_URL=... for a release, or customers will be asked for the address.

Publish on Google Play

1. Developer account

Register at Google Play Console (one-time 25 USD fee).

2. Create the app

Create app → name Smart TMS (or your own name), language, App, Free.

3. Store listing

4. App content

5. Upload and release

Production → Create release → upload the .aab → add release notes → review → Start rollout. The first review can take a few days.

After it is live, copy the Play Store link into Super admin → Mobile App → Android store link. Every shop's website QR page then shows the button.

Privacy & data safety

The app sends data only to your website. It has no ads and no third-party analytics. Firebase is used only to deliver notifications.

DataWhyRequired
Name, email, phoneAccount and the shop's contact with the customerYes
Orders, bills, quotations, visits, measurementsThe app's purposeYes
Messages with the shopChatYes
Profile photoOptionalNo
Device tokenPush notificationsOptional

Customers can delete their account in the app (Profile → Delete account). Say this in the store forms.

Android permissions used

PermissionWhy
INTERNETTalk to your website.
CAMERAScan the shop's QR code, take a profile photo.
POST_NOTIFICATIONSPush notifications (Android 13+).
USE_BIOMETRICOptional fingerprint / face lock.

Code structure

lib/
  main.dart, config.dart, core.dart   start-up, app name, shared imports
  api/        API client, repository and models
  state/      sign-in, cache, connectivity, push, deep links
  util/       theme, formatting, app config
  screens/    home, orders, billing, visits, shop, measurements, chat ...
  widgets/    floating tab bar, stitched cards, garment drawings, thread timeline
test/         unit and screen tests (offline, fake server)
docs/         openapi.yaml (API contract)
assets/       app icon

API reference

The app uses /api/v1 on your website with Laravel Sanctum bearer tokens (ability customer, 90 days). The full contract is in docs/openapi.yaml.

CallPurpose
GET /api/v1/company/{code}Shop branding by company code (no sign-in)
POST /api/v1/auth/loginSign in with company code, email, password
GET /api/v1/customer/dashboardHome data
/api/v1/customer/orders, quotations, invoices, appointments, measurements, catalogue, messagesLists and actions (each can be hidden per shop)

Platform rules: 426 update_required below the minimum version (the app sends X-App-Version), 503 during maintenance, 403 app_disabled when the shop's app is off.

Updating to a new version

  1. Update the website first and run php artisan migrate.
  2. Copy your changes (see Branding) into the new project, or copy the new lib/ over yours.
  3. Raise the version in pubspec.yaml, run flutter pub get, flutter test and build again.

Troubleshooting

ProblemWhat to do
flutter doctor shows a red crossFix that line first; most problems come from missing Android licences or SDK tools.
"Company not found"Check the code on the owner's Mobile App page and that the shop's app is switched on by the super admin.
Cannot connect / handshake errorUse https:// with a valid certificate in release builds. For a local website use http://10.0.2.2/... in the emulator (debug only).
"Update required"The minimum version is higher than the app's. Lower it, or install the new build.
Wrong password messageThe email must belong to a customer of that shop. Another shop's account gives the same message.
No push notificationsCheck google-services.json, the server's FCM_CREDENTIALS path, and that the phone allowed notifications.
QR scan does nothingAllow the camera. Or type the company code.
Build fails: Gradle / SDKRun flutter clean, then flutter pub get; make sure Java 17 and the Android SDK are installed.

FAQ

Do I need a separate app for every shop?

No. One app serves all shops on your website; customers pick theirs with the code or QR.

Can I make an app only for one shop?

Yes: set your own name, icon and application id, build and publish it under your own account. The shop's branding still comes from the website.

Can staff or the owner use it?

No, it is a customer app. Staff use the website.

Do customers need to register?

The shop creates the customer account (Customers in the website). The customer signs in with that email and password.

Where do customers pay?

The app opens the shop's secure payment page already signed in. The payment methods are the ones the shop set up on the website.

Support & changelog

Support covers installation questions, bugs and help with the steps in this guide. Customisations (new features, design changes) are not included but can be ordered separately. Create a support ticket here.

Changelog

VersionDateChanges
1.0.0November 2026First release: company code / QR sign-in, shop branding, home, orders with thread timeline, bills and online payment, quotations, visits and booking, shop and quotation requests, measurements incl. your own from home, reviews, chat, notifications inbox and push, app lock, offline cache.