Social network for food lovers.
Food Square was developed as an open source application as a part of bachelor thesis titled Design and implementation of an open source web application about cooking by David Poslušný at Faculty of Informatics and Statistics of Prague University of Economics and Business.
ℹ️ This bachelor thesis was defended on 31.1.2023 with the grade of 1. Link to the paper can be found here. ℹ️
This repository contains source code of the server side of the application.
The other repository that contains the client side of the application can be found here.
- Account
- create account in the application
- sign in from multiple devices
- edit your account information
- upload a profile picture
- follow other users
- Recipes
- create your own recipes
- add ingredients
- choose different categories
- display details about recipe
- meal type
- preparation/cooking time
- instructions
- categories
- ingredients and their nutritional values
- share your recipe between other users
- add recipes to your favorites
- filter between recipes based on desired criteria
- create your own recipes
- Reviews
- review other user's recipes
- display all existing reviews
- sort between best/worst rated recipes
- show reviews for a specific recipe
- Comments
- add multiple comments to recipes
- Ingredients
- display all available ingredients
- look up specific ingredients
- Liking
- like a comment or a review
- Meal planning
- get a generated meal plan based on:
- categories
- amount of meals
- desired calories
- save your meal plan
- get a generated meal plan based on:
- Theming
- switch between light and dark mode
- Spring Data JPA - for building JPA based repositories
- Spring Web - for setting up http client and other web oriented features
- PostgreSQL JDBC Driver - for connecting to PostgreSQL database
- Lombok - for automated class building and removing boilerplate code
- Spring Boot Starter Test - for testing and debugging
- Spring Security - for securing various points of the application
- JSON Web Token - for JWT support for JVM
- Spring Boot Configuration Processor - for building configuration classes
- Spring Boot Starter Validation - for class and API input validation
- Spring Batch - for reading and processing external files
- springdoc - for automatic generation of API documentation
- Maven
- IDE (e.g. IntelliJ IDEA) or terminal
Clone the project
git clone https://github.com/itsDaiton/food-square-api.git
Open the project
cd food-square-api
Configure required variables located in src/main/resources/application.properties
spring.datasource.url=''
spring.datasource.username=''
spring.datasource.password=''
app.jwt.secret-key=''
app.jwt.expiration-time=''
app.jwt.cookie-name=''
app.jwt.secure=''
app.jwt.sameSite=''
- URL to your database, which the application is going to connect to
- your username in the database
- your password to the database
- secret used to sign JWT tokens
- expiration time on JWT token in milliseconds
- it is recommended to choose at least 1 day (86400000)
- name of the cookie used for user authentication
- example: 'examplecookiename'
- defines whether cookies will have secure attribute or not
- choose 'false' for local development
- must be set to 'true' in production!
- defines whether cookies will have samesite attribute or not
- choose 'lax' for local development
- must be set to 'none' in production!
Run the application in terminal
mvnw spring-boot:run
Run the service with curl (in a separate terminal window)
curl localhost:8080
If you wish, you can create a executable JAR file
mvnw clean install
- Create a feature branch for your changes
- Deploy your code
- After your development is done, create a pull request
Contributions, issues, and feature requests are welcome. If you would like to contribute to this project, please see CONTRIBUTING
.
Project is distributed under the MIT License. See LICENSE
for more information.
Application testing was carried out using the Postman software. Collection of all tests can be found under this directory
docs/tests
Documentation describing all end-points of the API can be found under this URL
'baseURL'/api/v1/docs/swagger-ui/index.html
You can contact the author of the project under this e-mail.
- Ing. Vojtěch Růžička