Set default portal port to 8081, fix Dart build issue in cart screen, and update setup documentation. Co-Authored-By: Oz <oz-agent@warp.dev>
2.3 KiB
2.3 KiB
Flutter E-Commerce Portal (Dockerized)
A self-contained Flutter web e-commerce portal served through Docker + Nginx.
Features
- Flutter web e-commerce layout:
- Product grid (home)
- Product detail page
- Cart page
- Checkout skeleton page
- User profile page
- Authentication via Firebase Authentication:
- Email + password
- Google login
- GitHub login
- Dockerized build and runtime (no host Flutter SDK required)
Prerequisites
- Ubuntu with:
- Docker Engine
- Docker Compose plugin (
docker compose)
Project Structure
lib/screens/UI pages and auth flowlib/widgets/reusable UI widgetslib/models/domain modelslib/services/auth, config, catalog, and cart logicassets/config/runtime Firebase config templatesDockerfilemulti-stage Flutter web build + Nginx runtimedocker-compose.ymlapp service orchestrationinstall_portal.shone-command install/rununinstall_portal.shcleanup script
Configure Authentication Providers
- Create a Firebase project.
- In Firebase Console > Authentication > Sign-in method, enable:
- Email/Password
- GitHub
- In Firebase Console > Project settings > General, copy web app config values.
- Create local env file:
cp .env.example .env - Edit
.envand set:FIREBASE_API_KEYFIREBASE_AUTH_DOMAINFIREBASE_PROJECT_IDFIREBASE_STORAGE_BUCKETFIREBASE_MESSAGING_SENDER_IDFIREBASE_APP_IDFIREBASE_MEASUREMENT_ID(optional)
- For GitHub provider in Firebase, configure GitHub OAuth app callback URL exactly as Firebase instructs.
Install and Run
chmod +x install_portal.sh uninstall_portal.sh
./install_portal.sh
The portal will be available at:
http://localhost:8081(default)- or
http://localhost:<PORTAL_PORT>if you changedPORTAL_PORTin.env
Uninstall / Cleanup
Interactive cleanup:
./uninstall_portal.sh
Non-interactive cleanup:
./uninstall_portal.sh --force
This removes containers, local images, networks, and volumes created by this portal's Compose project.
Notes on Secrets
- Keep secrets and keys in
.envonly; do not hard-code in Dart files. .envis consumed by Docker Compose and injected into the runtime config file inside the container.- For production, use a proper secret manager or CI/CD secret injection.