GIRAF Foodplanner is a Flutter-based application designed to streamline meal planning. The app integrates a Flutter frontend with an ASP.NET backend connected to a PostgreSQL database. This project is part of the GIRAF ecosystem and is optimized for iOS devices.
- User Roles: Customizable roles like teacher or parent for tailored experiences.
- Meal Planning: Create, edit, and manage daily meal plans.
- Responsive Design: Optimized for iOS devices, particularly iPhones.
- Backend Integration: Powered by an ASP.NET backend connected to a PostgreSQL database.
- Frontend: Flutter
- Backend: ASP.NET
- Database: PostgreSQL
- Image Database: Minio
- Build Tools: Xcode (for iOS development)
lib/
├── api/ # Auto generated Endpoints
├── auth/ # Authentication components
├── components/ # Reusable UI components
├── config/ # Default design variables including colors and Text formats.
├── models/ # Data models and domain entities
├── pages/ # Application screens (pages)
├── routes/ # Route handling by GoRouter
└── services/ # API and database interaction
Ensure you have the following installed:
- Flutter SDK
- Xcode (for iOS development)
- ASP.NET Core SDK
- PostgreSQL
To generate API endpoints, the backend needs to have been started, to provide the OpenAPI spec. Follow the setup information in the ASP.NET backend repository: foodplanner-api.
- Clone the repository:
git clone https://github.com/aau-giraf/foodplanner.git- Navigate to the project directory:
cd foodplanner/foodplanner- Install dependencies
dart pub get- Generate API endpoints (This step requires a locally running foodplanner-api to serve the OpenAPI spec)
dart run build_runner build --delete-conflicting-outputs- Connect your iOS device, start an iOS simulator, or run it in Chrome.
- Configure the API base URL in the
lib/services/api_service.dartfile to point to your running backend. - Configure the image API hardcoded URL in the
lib/components/image.dartfile to point to your Minio instance (as described in foodplanner-api). - Run the app using Flutter:
flutter runTo run the app in Chrome
flutter run -d chrome --web-port=8081- Missing Dependencies: Ensure you’ve run
flutter pub get. - Backend Not Connecting: Verify the API URL and ensure the backend service is running.
- iOS Build Issues: Open the project in Xcode and ensure signing and team credentials are correctly configured.
Tests are found under the test folder. You can run them in vscode by right clicking a folder with tests in it and clicking 'Run Tests' in vscode. Or use your terminal.
To run all tests, run this command
flutter test test
To run page_tests
flutter test test/page_tests
To run service_tests run
flutter test test/service_tests
Contributions are welcome! Follow these steps:
- Make sure you are on
stagingand it is up to date.
git switch staging
git pull- Create a branch for your feature or bugfix:
git switch -c feat/group-name/feature-name
git switch -c bugfix/group-name/bug-name- Commit your changes:
git commit
# Write commit message in opened editor, save and exit editor- Push local branch to remote:
git push origin feature-name- Open a pull request to the staging branch, test it, and then create a new pull request for main.