Skip to content

Latest commit

 

History

History
205 lines (130 loc) · 6.88 KB

README.en.md

File metadata and controls

205 lines (130 loc) · 6.88 KB

Milestone hacktoberfest


DeepSource Docker Pulls Docker Image Version

Despensa-app - REST API

Description

Despensa-app is an app that allows you to manage those products that you often buy.

This project provides with the needed resources for web project.

Features
  • View/Create/Update/Delete lists
  • Public lists
  • Lists by user (private)
  • Add products to the list
  • Filter products
  • View product information
  • Tick off products on a list
  • Create a user
  • Authentication
  • JWT Authorization
  • Management (Pending)

Getting Started

Local deployment

Requirements

Configure database

  • Create the despensa_app schema.
  • Set the password for the root user in the spring.datasource.password property of the application.properties file.
  • Manually execute the following scripts:

Compile and start the project

Open a terminal in the root of the project and run the following commands:

  • .\mvnw clean install
  • .\mvnw spring-boot:run

Deployment with docker

With this option, we won't need to install MySQL. The scripts (schema.sql and data.sql) will always run at startup, as the application will start with the dockerdev profile.

Start Docker Hub image

docker compose -f compose.despensa-rest-api.yaml up -d

Create image and start

docker compose up --build -d

Working in IntelliJ IDEA

Community Edition

The following instructions are for the Ultimate version, although most of them work with the Community Edition as well.

You can find a demo of local deployment with the Community Edition available in the discussions section of this repository.

Clone project

File > New > Project from Version Control

Set local Maven path

(Not necessary if you intend to use mvnw)

File > Settings > Build, Execution, Deployment > Build Tools > Maven

  • maven home path

Run configurations

Run > Run...

  • [clean,install]: Compile the project without test.
  • [clean,install] Tests: Compile running the test.
  • [spring-boot:run]: Start the project.
  • App: Start the project. (IDEA Ultimate version)
  • docker compose: Create an image and start the project.
  • docker compose (despensa-rest-api): Start the docker hub image.

Enable EditorConfig

EditorConfig support needs to be enabled:

Settings > Editor > Code Style

  • Enable Editor Config Support

Set save options

I recommend enabling the save actions: Reformat code and Optimize imports.

Settings > Tools > Actions on save

EditorConfig needs to be enabled.

Spring-boot-devtools

Enable automatic project compilation:

Settings > Build, Execution, Development > Compiler

  • Build project automatically

Swagger

When starting the application, we can access the following URL and test the available resources:

Using postman

As an alternative to Swagger, you can fork or view the application's resource collection at the following link:

Run In Postman

Contributions

Any contribution you make will be greatly appreciated.

Before you start coding, please read the contribution guidelines.

Acknowledgements

Thanks to JetBrains for providing a license for IntelliJ IDEA to develop this project.

JetBrains IntelliJ IDEA
JetBrains logo IntelliJ IDEA logo

License

MIT license.