Skip to content

Commit

Permalink
Merge pull request #249 from trebol-ecommerce/release/0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bglamadrid authored May 27, 2023
2 parents 68cce0e + bafc449 commit f51e321
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 23 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [v0.2.0] - 2023-05-26

### Added

Expand Down
64 changes: 43 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,49 @@
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=trebol-ecommerce_spring-boot-backend&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=trebol-ecommerce_spring-boot-backend)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=trebol-ecommerce_spring-boot-backend&metric=coverage)](https://sonarcloud.io/summary/new_code?id=trebol-ecommerce_spring-boot-backend)

A monolithic, [Spring Boot v2.6](https://docs.spring.io/spring-boot/docs/2.6.12/reference/html/)-based backend application for the eCommerce project Trébol.
A monolithic backend web application for the eCommerce project Trébol
built using [Spring Boot v2.6](https://docs.spring.io/spring-boot/docs/2.6.12/reference/html/).

</div>

## Current Status 📓
## Current Status

Implementing [Trébol API v1.7.2](https://github.com/trebol-ecommerce/api/blob/v1.7.2/src/trebol-api.json).

Recently, the artifact, group and version of the project as described in the `pom.xml` were changed.
The roadmap from here isn't totally defined, but conditions to reach `v1.0` are certainly stricter than before.

Please take a look at the `CHANGELOG.md` file to review the most recent changes and additions to the codebase.

## Features 🚀

* Exposes a [RESTful API](https://github.com/trebol-ecommerce/trebol-api) and supports all the operations described by the document, such as
* Exposes a [RESTful API](https://github.com/trebol-ecommerce/trebol-api) and supports
all the operations described by the document, such as
* CRUD operations on all declared data types
* Can filter, sort and paginate through query params
* Some endpoints support partial updates using `PATCH` requests
* Login, registration and optionally, guest customer accounts
* Checking out as a registered user or a guest (when enabled)
* Uses [Project Lombok](https://projectlombok.org) in all of its API models and JPA entities
* Here's a list of [compatible IDEs and their installation guides](https://projectlombok.org/setup/) to get yourself hacking in no time
* Here's a list of [compatible IDEs and their installation guides](https://projectlombok.org/setup/)
to get yourself an instance running in no time
* Uses [Spring Data JPA](https://spring.io/projects/spring-data-jpa)
* Annotated entity classes; including constraints and indexes where they are most needed at scale
* Bundles drivers for H2 and MariaDB, but can virtually connect to any JDBC-compatible database with the correct driver
* Bundles drivers for H2 and MariaDB; can virtually connect to any JDBC-compatible database with the correct driver
* Uses [Spring Security](https://spring.io/projects/spring-security)
* Implements stateless session authentication/autorization through [JSON Web Tokens](https://jwt.io/) with aid from the [JJWT library](https://github.com/jwtk/jjwt)
* Paired with `users`, `roles`, and `permissions` database tables (see `/src/main/resources/data.sql` for an example setup with 4 roles and users)
* Do note that Authorities required in some controllers are hard-coded. These must match entries in the `permissions` database table
* Implements stateless session authentication/autorization through [JSON Web Tokens](https://jwt.io/)
with aid from the [JJWT](https://github.com/jwtk/jjwt) library
* Paired with `users`, `roles`, and `permissions` database tables
* See `/src/main/resources/data.sql` for an example setup with 4 roles and users)
* Do note that Authorities required in some controllers are hard-coded
These must match entries in the `permissions` database table
* Passwords encoded with BCrypt by default
* Integrates payments with [WebpayPlus](https://transbankdevelopers.cl/producto/webpay) by Transbank ([Java SDK repo](https://github.com/TransbankDevelopers/transbank-sdk-java))
* It is planned to integrate more internationally popular payment services such as Paypal and Stripe
* Integrates payments with [WebpayPlus](https://transbankdevelopers.cl/producto/webpay)
by Transbank ([Java SDK repo](https://github.com/TransbankDevelopers/transbank-sdk-java))
* It is planned to integrate more internationally popular payment services such as PayPal and Stripe
* Integrates mail notifications with [Mailgun](https://mailgun.com) (an account and API key are required)
* Defines quite-evident properties, and provides a throughfully-explained example file with them
* Defines quite-evident properties, and provides a throughfully-explained example file with them,
with sane defaults for quickly testing in your local machine.
* Mission-critical
* WebpayPlus properties
* Mailgun & general mail properties
Expand All @@ -59,7 +70,8 @@ Please take a look at the `CHANGELOG.md` file to review the most recent changes

![Schema](./schema.png)

This Entity-Relationship model diagram was designed in a couple minutes using [Azimutt](https://github.com/azimuttapp/azimutt), a MIT-licensed, handy ER-model-navigation, diagram-visualization-and-design tool.
This Entity-Relationship model diagram was designed very quickly using
[Azimutt](https://github.com/azimuttapp/azimutt).

## Getting started 👍

Expand All @@ -70,39 +82,49 @@ This Entity-Relationship model diagram was designed in a couple minutes using [A

### Installation

First, don't forget to install any [Project Lombok plugin for your IDE](https://projectlombok.org/setup/) if you haven't done it by the time you read this.
First, don't forget to download, install and enable
[the correct Project Lombok plugin for your IDE](https://projectlombok.org/setup/)
if you haven't done so by the time you read this.

After cloning the repository, run `mvn verify`, get yourself comfortable and wait until it is done.
That command will:

- Download & install dependencies
- Generate sources
- Generate some of the source code
- Compile the project
- Generate the WAR package file
- Install it to your local maven repo
- Run unit tests
- Check code coverage

**The important step here is to generate the sources**, because some classes (QueryDSL types such as `QUser`, `QProduct` and so on) are unversioned and instead, generated through a Maven plugin included within the project dependencies.
**The important step here that may confuse some people is to generate some of the source code**.
It is made this way because some classes (QueryDSL types such as `QUser`, `QProduct` and so on)
are unversioned and only included through a Maven plugin within the project dependencies.

If for any reason you fail to compile the project, please run `mvn clean generate-sources` instead and then try the former command again.
If for any reason you fail to compile the project,
please run `mvn clean generate-sources` instead and then try the former command again.

### How to use

You can quickly run the application over an embedded server by executing the Spring Boot Run maven goal (e.g. running `mvn spring-boot:run`)
You can quickly run the application on top of an embedded server
by executing the Spring Boot Run maven goal `mvn spring-boot:run`.

Mailgun integration will only be available if the `mailgun` profile is active (this is hard-coded). Please read the `application-mailgun.empty.properties` file and [this bit of the Spring Boot documentation](https://docs.spring.io/spring-boot/docs/2.6.12/reference/html/features.html#features.profiles) to know how to proceed with that.
Integration with Mailgun will only be available if the `mailgun` Spring profile is active.
Please read the `application-mailgun.empty.properties` file and
[this bit of the Spring Boot documentation](https://docs.spring.io/spring-boot/docs/2.6.12/reference/html/features.html#features.profiles)
to know how to proceed about said Spring profile.

### Configuration

The default configuration profile, which is located at `/src/main/resources/application.properties`
contains sane default settings and brief summaries of what everything does.
The default configuration properties are located at `/src/main/resources/application.properties`.
These are sane, briefly documented defaults. Play around if you'd like.

You _can_ run the application out-of-the-box with these, though you should have a good look at it.

Also remember, that Spring Boot does support using more than one profile at once.
[This](https://docs.spring.io/spring-boot/docs/2.6.12/reference/html/features.html#features.external-config) and
[this](https://docs.spring.io/spring-boot/docs/2.6.12/reference/html/features.html#features.profiles) section of the Spring Boot guide can help you understand these mechanisms.
[this](https://docs.spring.io/spring-boot/docs/2.6.12/reference/html/features.html#features.profiles) section of the
Spring Boot guide can help you understand these mechanisms.

## Contributing to this repository 😍

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<groupId>org.trebolecommerce</groupId>
<artifactId>trebol-backend-monolith</artifactId>
<packaging>war</packaging>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>

<name>Trébol Backend Monolith</name>
<description>Monolithic eCommerce backend web application that exposes a RESTful API compliant with the Trebol API v1.5.0 specification.</description>
Expand Down

0 comments on commit f51e321

Please sign in to comment.