Skip to content

Repository for server side of bachelor project at Prague University of Economics and Business.

License

Notifications You must be signed in to change notification settings

itsDaiton/food-square-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Food Square

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.

⚠️Due to high hosting costs the application is not available online at the moment. To view the application, please clone this repository instead and run the application locally.⚠️

image

Features

  • 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
  • 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
  • Theming
    • switch between light and dark mode

Built With

Programming language

Framework

Dependency management

Additional dependencies

Get Started

Prerequisites

Installation

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=''

spring.datasource.url

  • URL to your database, which the application is going to connect to

spring.datasource.username

  • your username in the database

spring.datasource.password

  • your password to the database

app.jwt.secret-key

  • secret used to sign JWT tokens

app.jwt.expiration-time

  • expiration time on JWT token in milliseconds
  • it is recommended to choose at least 1 day (86400000)

app.jwt.cookie-name

  • name of the cookie used for user authentication
  • example: 'examplecookiename'

app.jwt.secure

  • defines whether cookies will have secure attribute or not
  • choose 'false' for local development
  • must be set to 'true' in production!

app.jwt.sameSite

  • 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

Deployment

  • Create a feature branch for your changes
  • Deploy your code
  • After your development is done, create a pull request

Contributting

Contributions, issues, and feature requests are welcome. If you would like to contribute to this project, please see CONTRIBUTING.

License

Project is distributed under the MIT License. See LICENSE for more information.

Testing

Application testing was carried out using the Postman software. Collection of all tests can be found under this directory

docs/tests

Documentation

Documentation describing all end-points of the API can be found under this URL

'baseURL'/api/v1/docs/swagger-ui/index.html

Contact

You can contact the author of the project under this e-mail.

Acknowledgments

  • Ing. Vojtěch Růžička