118 lines
3.3 KiB
Markdown
118 lines
3.3 KiB
Markdown
# Bharat ERP — AMS Phase 1
|
|
|
|
Production-ready **Asset Management System** for Web, Android, and iOS — the foundation for Bharat ERP.
|
|
|
|
## Phase 1 Modules
|
|
|
|
- **Authentication** — Login, logout, OTP, JWT sessions
|
|
- **Company Management** — Multi-company support
|
|
- **Branch Management** — Branch hierarchy per company
|
|
- **User Management** — Employee accounts and roles
|
|
- **Role & Permissions** — RBAC with dynamic menu
|
|
- **Dashboard** — KPIs and charts
|
|
- **Assets** — Categories, master, allocation, maintenance, disposal, QR
|
|
- **Reports** — Asset register, allocation, maintenance, warranty, disposal
|
|
- **Settings** — Theme, branding, preferences
|
|
|
|
## Tech Stack
|
|
|
|
Flutter · Riverpod · GoRouter · Dio · Freezed · Material 3 · Responsive Framework
|
|
|
|
## Getting Started
|
|
|
|
### Prerequisites
|
|
|
|
- Flutter SDK 3.9+
|
|
- Dart 3.9+
|
|
|
|
### Setup
|
|
|
|
```bash
|
|
# Clone and enter project
|
|
cd Bharat_ERP
|
|
|
|
# Environment files are already included:
|
|
# .env.development / .env.uat / .env.production
|
|
|
|
# Install dependencies
|
|
flutter pub get
|
|
|
|
# Generate Freezed/JSON models
|
|
dart run build_runner build --delete-conflicting-outputs
|
|
```
|
|
|
|
### Environment config
|
|
|
|
Each environment has its own entry point in `lib/config/` that sets `Environment.flavor`.
|
|
API URL and `.env` file are picked automatically (see `lib/core/config/environment.dart`).
|
|
|
|
| Flavor | Entry point | API URL (auto) | Web base-href |
|
|
|--------|-------------|----------------|---------------|
|
|
| **dev** | `lib/config/main_dev.dart` | `https://demo.venbait.in/api/v1` | `/` |
|
|
| **uat** | `lib/config/main_uat.dart` | `https://uat-api.bharaterp.com/api/v1` | `/` |
|
|
| **prod** | `lib/config/main_prod.dart` | `https://api.bharaterp.com/api/v1` | `/` |
|
|
|
|
Dev web uses **path URLs** (no `index.html#`). Build with `--base-href /` and deploy `web/.htaccess` for Apache/LiteSpeed SPA fallback.
|
|
|
|
### Web builds
|
|
|
|
```bash
|
|
# Dev
|
|
flutter build web -t lib/config/main_dev.dart --release --base-href /
|
|
|
|
# UAT
|
|
flutter build web -t lib/config/main_uat.dart --release --base-href /
|
|
|
|
# Prod
|
|
flutter build web -t lib/config/main_prod.dart --release --base-href /
|
|
```
|
|
|
|
### Android APK / AAB
|
|
|
|
```bash
|
|
flutter build apk --flavor dev -t lib/config/main_dev.dart --release
|
|
flutter build apk --flavor uat -t lib/config/main_uat.dart --release
|
|
flutter build apk --flavor prod -t lib/config/main_prod.dart --release
|
|
|
|
flutter build appbundle --flavor prod -t lib/config/main_prod.dart --release
|
|
```
|
|
|
|
### iOS
|
|
|
|
```bash
|
|
flutter build ios -t lib/config/main_prod.dart --release
|
|
```
|
|
|
|
### Local dev run
|
|
|
|
```bash
|
|
flutter run -d chrome -t lib/config/main_dev.dart --web-port=8080
|
|
flutter run --flavor dev -t lib/config/main_dev.dart
|
|
```
|
|
|
|
Output (web): `build/web/`
|
|
|
|
## Project Structure
|
|
|
|
See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for full architecture documentation.
|
|
|
|
```
|
|
lib/
|
|
├── core/ # Constants, network, theme, errors, utils
|
|
├── shared/ # Routes, widgets, global providers, shared models
|
|
└── modules/ # Feature modules (auth, company, assets, ...)
|
|
```
|
|
|
|
## Roles
|
|
|
|
| Role | Description |
|
|
|------|-------------|
|
|
| Super Admin | Full access across all companies |
|
|
| Company Admin | Full access within assigned company |
|
|
| Asset Manager | Asset operations within company |
|
|
| Employee | View assets and own allocations |
|
|
|
|
## License
|
|
|
|
Proprietary — Bharat ERP
|