This project demonstrates building a secure mobile application with Spring Boot, utilizing JSON Web Tokens (JWT) for authentication. It showcases Spring Boot's streamlined approach to integrating security, data persistence, app services, and validation.
This project demonstrates how to build a secure mobile application with Spring Boot using JSON Web Tokens (JWT) for authentication. It showcases the integration of security, data persistence (JPA), validation, and app services in a Spring Boot application, focusing on securing RESTful APIs with JWT.
This project demonstrates cross-platform mobile application development with Flutter to create Android and iOS applications using shared code in the Dart language. It showcases dynamic UI creation using Flutter widgets and seamless API integration for a Spring Boot backend.
Ensure you have the following installed on your system before proceeding:
- Java JDK 17: Necessary for compiling and running the Java application.
- Maven: For project building and dependency management.
- MySQL: As the relational database management system for the project.
- Install Flutter SDK: Go through Flutter Dev for more detailed information on installation and environment setup.
- Setup Intellij Or Android Studio Follow installation guidelines for Intellij Setup
- Android Emulator Install the Android SDK component and create Virtual device to verify the application.
Verify your Java and Maven installations by running java -version
and mvn -version
in your terminal and run flutter doctor
to verify flutter installation.
- Install MySQL and create a new database named
soulfulplates
:
CREATE DATABASE soulfulplates;
Here's a detailed look at the project's dependencies, including their purpose and links to their Maven Central Repository pages.
Starters are a set of convenient dependency descriptors that you can include in your application.
-
Spring Boot Starter Data JPA
- Purpose: Simplifies data persistence with JPA.
- Maven Central
- Spring Data JPA Reference
-
Spring Boot Starter Security
- Purpose: Adds authentication and authorization capabilities.
- Maven Central
- Spring Security Reference
-
Spring Boot Starter Validation
- Purpose: Supports method validation with Hibernate Validator.
- Maven Central
- Spring Validation Reference
-
Spring Boot Starter Web
- Purpose: Facilitates building web and RESTful applications.
- Maven Central
- Spring Web Reference
- MySQL Connector/J
- Purpose: Connects your application to MySQL databases.
- Maven Central
- MySQL Connector/J Documentation
- JJWT (Java JWT)
- Purpose: A Java library for creating and parsing JSON Web Tokens.
- Maven Central for jjwt-api
- Maven Central for jjwt-impl
- Maven Central for jjwt-jackson
- JJWT GitHub Repository
-
Spring Boot Starter Test
- Purpose: Facilitates testing of Spring Boot applications.
- Maven Central
-
Spring Security Test
- Purpose: Provides support for testing Spring Security.
- Maven Central
-
JUnit
- Purpose: A framework for writing and running tests in Java.
- Maven Central
- JUnit 5 User Guide
- Project Lombok
- Purpose: Simplifies Java code and reduces boilerplate.
- Maven Central
- Project Lombok
To run the project on your local machine, follow these steps:
-
Clone the Repository
First, clone the project repository to your local machine using the following command in your terminal:
git clone <repository-url>
Make sure to replace `<repository-url>` with the actual URL of the project's repository.
Eg: https://git.cs.dal.ca/courses/2024-winter/csci5308/Group11.git
- Navigate to the Project Directory
Change into the project directory by running:
cd Spring Boot Backend
`Spring Boot Backend` is the name of the backend in the cloned repository. Adjust the command according to the actual directory name if it's changed.
- Build the Project
Build the project and run the tests by executing the following Maven command:
mvn clean install
This command compiles the project and runs any configured tests. It's important to ensure that the build and tests pass before trying to run the application.
- Run the Application
Finally, start the Spring Boot application with:
mvn spring-boot:run
This command starts the application on your local machine. By default, the application will be accessible at `http://localhost:8080`.
You can now interact with the application through your web browser or API testing tools like Postman.
-
Install Flutter: If you haven't already, follow the official Flutter installation instructions for your operating system.
-
Clone the Repositories:
- Buyer Application: Navigate to
Flutter Code/soulful_plates
and clone the repository. - Seller Application: Navigate to
Flutter Code/soulful_plates_client
and clone the repository.
- Buyer Application: Navigate to
-
Install Dependencies:
- For Buyer Application: Run
flutter pub get
in thesoulful_plates
directory. - For Seller Application: Run
flutter pub get
in thesoulful_plates_client
directory and inside thesoulful_plates
directory.
- For Buyer Application: Run
-
IOS Setup (Optional for Android):
- For Buyer Application: Navigate to
soulful_plates/ios
and runpod install
. - For Seller Application: Navigate to
soulful_plates_client/ios
and runpod install
.
- For Buyer Application: Navigate to
Here's a detailed look of Flutter application's dependencies, including their purpose and links to their packages page.
Below are the dependencies used in the Flutter project:
- cupertino_icons: ^1.0.2
- Flutter's default icon package to widgets.
- get: 4.6.5
- State management library used for maintaining different state of the application.
- intl: 0.18.1
- Localization library for converting the time and date in flutter application.
- package_info_plus: ^4.2.0
- Package info library provided information regarding the run time environment type such as Android or IOS.
- connectivity_plus: ^5.0.2
- This plugin give's status updates about the internet and wifi status at run time.
- cached_network_image: ^3.3.1
- For loading the images via URLs into the application.
- flutter_svg: ^2.0.9
- Plugin which can helps in showing the SVG image in the android and ios devices.
- fluttertoast: ^8.2.4
- Shows the toast messages for information and success messages.
- jwt_decode: ^0.3.1
- It will decodes the Java Web Token and will give information regarding the expiry time and all.
- shared_preferences: ^2.2.2 - To save and retrieve the basic details to the local cache in android/ios devices.
- internet_connection_checker: ^1.0.0+1 - It will ping to the server and returns if network connection is available or no.
- dio: - API calling library used in android to make Rest API calls.
- shimmer: - For animation and loaders using the shimmer library.
- flutter_inappwebview: ^5.8.0 - To show case the about and information pages used webview library.
- url_launcher: ^6.1.14 - It helps to open the native device components such as the calls, maps and etc.
- carousel_slider: ^4.0.0 - It gives the sliding window in the application to show case the popular images and content in slider.
- dropdown_search: ^5.0.6 - Helps in searching in the long dropdown data.
- geolocator: ^10.1.0 - Will convert the selected google map location to the address.
- cart_stepper: ^4.3.0 - Helps to increase and decrease numbers of count of item stepper.
- map_location_picker: ^1.2.8+3 - It will choose the user's location from map and returns the value of latitude and longitude.
After completing the setup steps, you can run each application separately:
-
Run on Emulator/Simulator: Execute
flutter run
in thesoulful_plates
directory to run the buyer application on an emulator/simulator. -
Run on Physical Device: Connect your device via wireless debugging or usb cable to the system and execute
flutter run
in thesoulful_plates
directory to run the buyer application on your device.
-
Run on Emulator/Simulator: Execute
flutter run
in thesoulful_plates_client
directory to run the seller application on an emulator/simulator. -
Run on Physical Device: Connect your device via wireless debugging or usb cable to the system and execute
flutter run
in thesoulful_plates_client
directory to run the seller application on your device.
To deploy each application for production, follow these steps:
- Build APK/IPA: Run
flutter build apk --release
in the respective application directory (soulful_plates
orsoulful_plates_client
) to generate the APK/IPA file.
Complete Application work flow as per the stories and implementation0.
Both user and seller application contains the Registration and authentication flow. As we have two separate application for the Buyer and Seller we have two work flows During and After the Login.
-
Seller:
- Seller will see the Login screen as a starting point of the application and from where He/She can register or login to the application.
- Once the Login process is completed We will verify if Seller is the new user or existing one if seller is new user we will ask for store details.
- Once we have store details we will ask for the store address and after successfully creation of seller account and store. Seller will be redirected to the Dashboard screen.
-
Buyer
- Buyer will see the Login Screen as a starting point of the application and from where He/She can register or login to the application.
- If Buyer is new to the application we will ask for location for which He/She wanted to create account.
Seller will ask for insert the store details and the address details of the store and able to update it later form the store details screen.
- Seller:
- Seller will able to create the store.
- Add the store address and able to edit the store details.
User and Seller is able to update the notification preferences form the Settings screen where he can also able to use other feature of application.
Seller is able to create the Menu and able to edit menu whenever needed such as enable or disable the items in stock and so on.
- We have Category and then Subcategories and then Menu items inside sub category for more user friendly menu.
Buyer is able to see the Near by Restaurants based on his/her location. Nearby restaurants are visible on the Home screen of the Buyer application.
Buyer is able to include the items He/She likes into the wishlist and able to edit the wishlist when needed.
Buyer is able to include multiple address in the application so He/She can able to switch the delivery location. Buyer is able to edit the user profile later on.
Buyer is able to rate the order after the order completion. Seller is able to see the order feedback and the rating in the order details screen.
Buyer is able to see the Live orders in the menu and also able to see the near by restaurant.
Buyer is able to add items from restaurant details screen to the cart and in the view cart screen buyer is able to edit items if needed and will be able to create the order.
Buyer is able to see the all previous order which are completed and also able to filter them. Buyer also able to see the transactions made from the application.
Seller is able to see the Live orders on the Home screen and able to switch the order status whenever needed apart from this seller is also able to call the user if needed.
Seller is able to see all the previous orders, payments made by buyers and the transaction history in the history screen.
Seller will able to see the Live order in the application and able to track the status whenever needed.
This project is licensed under the MIT License.