diff --git a/README.md b/README.md index 8e86a48..41d32f0 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,157 @@ # Kent Logistics Flutter App -A Flutter mobile application for Kent Logistics. +A production-ready Flutter mobile application for Kent Logistics. +This app communicates with a Laravel backend API for authentication, customer onboarding, and logistics operations. -## Setup +--- -1. Install Flutter SDK -2. Run `flutter pub get` -3. Run `flutter run` +# πŸ“Œ 1. Requirements (Install Before Running Project) -## Backend API -This project connects to a Laravel API running locally or on server. + To run or develop this project, the following tools must be installed: -Base URL: -`http://10.0.2.2:8000/api` (Android emulator) + ### βœ… Flutter SDK (Latest Stable) + Download from: + https://flutter.dev/docs/get-started/install -## Project Structure -- lib/config/ -- lib/services/ -- lib/providers/ -- lib/screens/ -- lib/widgets/ + ### βœ… Android Studio + Required components: + - Android SDK + - Android SDK Platform Tools + - Android Build Tools + - **Android NDK version 27.0.12077973** (required for Flutter plugins) + - Android Emulator (Pixel recommended) -## Development -Push changes to main or dev branch as per team workflow. + Install NDK via: + Android Studio β†’ SDK Manager β†’ SDK Tools β†’ NDK (Side by side) + + + ### βœ… JDK 17+ + Required for Android Gradle compatibility. + + ### βœ… Git + Required for version control, cloning, branching, and pushing code. + + --- + +# πŸ“Œ 2. Clone & Run the Project + + You **do NOT need to create a new Flutter project manually.** + Just clone and run: + + ```sh + git clone http://103.248.30.24:3000/kent-logistics/kent_logistics_app.git + cd kent_logistics_app + flutter pub get + flutter run + + +# πŸ“Œ 3. Backend API Details + + # βœ” Android Emulator Base URL: + http://10.0.2.2:8000/api + + # βœ” Physical Android / iPhone Device: + + # Use your computer’s local IP: + + http://192.168.x.x:8000/api + + # βœ” iOS Simulator: + http://localhost:8000/api + + + # Make sure your Laravel backend is running: + + php artisan serve + + +# πŸ“Œ 4. Project Structure (Explained) + + The project follows a clean, scalable architecture: + + lib/ + β”œβ”€β”€ config/ + β”‚ └── api_config.dart # API base URLs, global constants + β”‚ + β”œβ”€β”€ services/ + β”‚ β”œβ”€β”€ auth_service.dart # Login/logout API calls + β”‚ β”œβ”€β”€ request_service.dart # Signup request + OTP flow + β”‚ └── shipment_service.dart # (future) shipment APIs + β”‚ + β”œβ”€β”€ providers/ + β”‚ β”œβ”€β”€ auth_provider.dart # Authentication state, token, user session + β”‚ └── app_provider.dart # (future) global app state + β”‚ + β”œβ”€β”€ models/ + β”‚ β”œβ”€β”€ user_model.dart # User model for parsed API responses + β”‚ └── shipment_model.dart # (future) shipment model + β”‚ + β”œβ”€β”€ screens/ + β”‚ β”œβ”€β”€ auth/ + β”‚ β”‚ β”œβ”€β”€ login_screen.dart + β”‚ β”‚ β”œβ”€β”€ signup_screen.dart + β”‚ β”‚ β”œβ”€β”€ otp_screen.dart + β”‚ β”‚ └── waiting_screen.dart + β”‚ β”‚ + β”‚ β”œβ”€β”€ dashboard/ + β”‚ β”‚ └── dashboard_screen.dart + β”‚ β”‚ + β”‚ β”œβ”€β”€ shipments/ + β”‚ β”‚ β”œβ”€β”€ shipment_list_screen.dart + β”‚ β”‚ └── shipment_details_screen.dart + β”‚ β”‚ + β”‚ └── splash_screen.dart # App startup logic (check user session) + β”‚ + β”œβ”€β”€ widgets/ + β”‚ β”œβ”€β”€ primary_button.dart # Reusable styled button + β”‚ β”œβ”€β”€ rounded_input.dart # Input field widget + β”‚ └── custom_card.dart # (future) UI card component + β”‚ + └── main.dart # App entry point, Provider setup, Theme + + +# πŸ“Œ 5. Folder Purpose Summary + + # πŸ“ config/ + Stores global settings: + API base URL + Theme configs + App constants + + # πŸ“ services/ + All API calls using Dio: + Authentication (login/logout) + Signup request + OTP verification + + # πŸ“ providers/ + State management using Provider: + User authentication session + Save/retrieve JWT token + Notify UI of state changes + + # πŸ“ models/ + Data structure classes: + UserModel + ShipmentModel (future) + + # πŸ“ screens/ + UI pages: + Login, Signup, OTP + Dashboard + Shipments (list, details) + + # πŸ“ widgets/ + Reusable UI components: + Buttons + Text fields + Cards + +# πŸ“Œ 6. Notes for Developers + Always run flutter pub get after pulling new changes + Use NDK version 27.0.12077973 + If using physical device β†’ use local IP instead of 10.0.2.2 + Splash screen checks stored JWT token β†’ auto-login if session exists + +# πŸ“Œ 7. Support + For project setup or issues, contact the project admin or team lead. \ No newline at end of file