From 2a741d9520860fab320f3d91dfabfcd49ae8e985 Mon Sep 17 00:00:00 2001 From: Maria Soria Date: Fri, 11 Oct 2024 11:26:39 +0100 Subject: [PATCH 1/2] Add README.en.md file. --- translations/README.en.md | 205 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 translations/README.en.md diff --git a/translations/README.en.md b/translations/README.en.md new file mode 100644 index 0000000..660c485 --- /dev/null +++ b/translations/README.en.md @@ -0,0 +1,205 @@ + +
+ +![Milestone hacktoberfest][github-milestone-shield] + +
+
+ +--- + +[![DeepSource][deepsource-issues-badge]][deepsource-project-url] +![Docker Pulls][docker-pull-shield] +![Docker Image Version][docker-version-shield] + +# 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][github-project-web-url]. + +
+ 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](#local-deployment) + - [Requirements](#requirements) + - [Configure Database](#configure-database) + - [Compile and Start the Project](#compile-and-start-the-project) +- [Deployment with Docker](#deployment-with-docker) +- [Working in IntelliJ IDEA](#working-in-intellij-idea) +- [Swagger](#swagger) +- [Using Postman](#using-postman) + + +### Local deployment + +#### Requirements + +* [Java 21][java-temurin-url] +* [MySQL 8][mysql-url] +* [Maven 3.9.7][maven-url] (Optional) + +#### Configure database + +- Create the `despensa_app` schema. +- Set the password for the `root` user in the `spring.datasource.password` + property of the [application.properties](../src/main/resources/application.properties) file. +- Manually execute the following scripts: + - [schema.sql](../src/main/resources/db/schema.sql) + - [data.sql](../src/main/resources/db/data.sql) + +#### 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** + +```shell +docker compose -f compose.despensa-rest-api.yaml up -d +``` + +**Create image and start** + +```shell +docker compose up --build -d +``` + +### Working in IntelliJ IDEA + +- [Community Edition](#community-edition) +- [Clone project](#clone-project) +- [Set local Maven path](#set-local-maven-path) +- [Run configurations](#run-configurations) +- [Enable EditorConfig](#enable-editorconfig) +- [Set save options](#set-save-options) +- [spring-boot-devtools](#spring-boot-devtools) + +#### 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][github-discussion-url] 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: + +- http://localhost:8080/swagger-ui/index.html?urls.primaryName=Public + +### Using postman + +As an alternative to Swagger, you can fork or view the application's resource collection at the following link: + +[Run In Postman][postman-url] + +## Contributions +Any contribution you make will be greatly appreciated. + +Before you start coding, please read the [contribution guidelines](../CONTRIBUTING.md). + +## Acknowledgements + +Thanks to [JetBrains](https://www.jetbrains.com/?from=SoftN%20CMS) for providing a license for IntelliJ IDEA +to develop this project. + +| JetBrains | IntelliJ IDEA | +|-------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------| +| ![JetBrains logo](https://resources.jetbrains.com/storage/products/company/brand/logos/jetbrains.svg) | ![IntelliJ IDEA logo](https://resources.jetbrains.com/storage/products/company/brand/logos/IntelliJ_IDEA_icon.svg) | + +## License + +[MIT license](../LICENSE). + + +[deepsource-issues-badge]: https://app.deepsource.com/gh/despensa-app/despensa-rest-api.svg/?label=active+issues&show_trend=true&token=UvUyf5Wchx79wdiTOVRyO6RN + +[deepsource-project-url]: https://app.deepsource.com/gh/despensa-app/despensa-rest-api/ + +[docker-pull-shield]: https://img.shields.io/docker/pulls/nmarulo/despensa-app?style=flat-square&link=https%3A%2F%2Fhub.docker.com%2Fr%2Fnmarulo%2Fdespensa-app + +[docker-version-shield]: https://img.shields.io/docker/v/nmarulo/despensa-app?sort=date&style=flat-square&label=Docker%20versi%C3%B3n&link=https%3A%2F%2Fhub.docker.com%2Fr%2Fnmarulo%2Fdespensa-app%2Ftags + +[github-milestone-shield]: https://img.shields.io/github/milestones/progress/despensa-app/despensa-rest-api/1?style=flat-square + +[github-project-web-url]: https://github.com/despensa-app/despensa-web + +[java-temurin-url]: https://adoptium.net/es/temurin/releases/?version=21 + +[mysql-url]: https://dev.mysql.com/downloads/mysql/ + +[maven-url]: https://dlcdn.apache.org/maven/maven-3/3.9.7/binaries/ + +[postman-url]: https://app.getpostman.com/run-collection/3462094-24c69e86-2ae0-42da-a1f0-55d411d60ad6?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D3462094-24c69e86-2ae0-42da-a1f0-55d411d60ad6%26entityType%3Dcollection%26workspaceId%3Dfaa3b08b-5495-45eb-a53f-5d832821e4f2#?env%5Bdespensa-app%20-%20local%5D=W3sia2V5IjoidXJsIiwidmFsdWUiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXBpIiwiZW5hYmxlZCI6dHJ1ZSwic2Vzc2lvblZhbHVlIjoiaHR0cDovL2xvY2FsaG9zdDo4MDgwL2FwaSIsInNlc3Npb25JbmRleCI6MH1d + +[github-discussion-url]: https://github.com/despensa-app/despensa-rest-api/discussions/29 From 20f5ad99909b0efbe2d9e34faecb765c002e6b11 Mon Sep 17 00:00:00 2001 From: Maria Soria Date: Fri, 11 Oct 2024 11:27:44 +0100 Subject: [PATCH 2/2] Update README.md with link to README.en.md file. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fc18a59..0e1ed6b 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ # Despensa-app - REST API +📚 **Translations Readme**: [English](translations/README.en.md) + ## Descripción Despensa-app es una aplicación que te permite gestionar los productos que compras de forma habitual. @@ -24,7 +26,7 @@ Este proyecto proporciona los recursos a consumir por el [proyecto web][github-p Características - Ver/Crear/Modificar/Eliminar listas -- Listas publicas +- Listas públicas - Listas por usuario (privadas) - Agregar productos a la lista - Filtrar productos