Skip to content

aau-giraf/foodplanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GIRAF Foodplanner

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.

Features

  • 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.

Technologies Used

  • Frontend: Flutter
  • Backend: ASP.NET
  • Database: PostgreSQL
  • Image Database: Minio
  • Build Tools: Xcode (for iOS development)

Project Structure

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

Getting Started

Prerequisites

Ensure you have the following installed:

Setting Up the Backend

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.

Setup the project

  1. Clone the repository:
git clone https://github.com/aau-giraf/foodplanner.git
  1. Navigate to the project directory:
cd foodplanner/foodplanner
  1. Install dependencies
dart pub get
  1. Generate API endpoints (This step requires a locally running foodplanner-api to serve the OpenAPI spec)
dart run build_runner build --delete-conflicting-outputs

Running the App for the First Time

  1. Connect your iOS device, start an iOS simulator, or run it in Chrome.
  2. Configure the API base URL in the lib/services/api_service.dart file to point to your running backend.
  3. Configure the image API hardcoded URL in the lib/components/image.dart file to point to your Minio instance (as described in foodplanner-api).
  4. Run the app using Flutter:
flutter run

To run the app in Chrome

flutter run -d chrome --web-port=8081

Troubleshooting

  • 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.

Running tests

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

Contributing

Contributions are welcome! Follow these steps:

  1. Make sure you are on staging and it is up to date.
git switch staging
git pull
  1. Create a branch for your feature or bugfix:
git switch -c feat/group-name/feature-name
git switch -c bugfix/group-name/bug-name
  1. Commit your changes:
git commit
# Write commit message in opened editor, save and exit editor
  1. Push local branch to remote:
git push origin feature-name
  1. Open a pull request to the staging branch, test it, and then create a new pull request for main.

About

The frontend repository for the food planner app build in Flutter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 33