trebol-ecommerce / trebol-backend-monolith

Monolithic eCommerce backend web application that exposes a RESTful API.
MIT License
16 stars 21 forks source link
ecommerce java java17 jdk17 jwt querydsl-jpa shop solution spring-boot spring-data-jpa spring-mvc spring-security webpayplus

Trébol Backend Monolith

Spring Logo [![All Contributors](https://img.shields.io/badge/all_contributors-14-orange.svg?style=flat-square)](#contributors-) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=trebol-ecommerce_spring-boot-backend&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=trebol-ecommerce_spring-boot-backend) [![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 backend web application for the eCommerce project Trébol, built using [Spring Boot v2.6](https://docs.spring.io/spring-boot/docs/2.6.x/reference/html/). Since then it's been migrated migrated to [Spring Boot v3.2](https://docs.spring.io/spring-boot/docs/3.2.x/reference/html/).

Current Status

Recently, this project has been set up to work with Java 17, and as such, the artifact id of the project object model was changed to reflect on that.

Currently, this backend implementation is aligned with the Trébol API v3.0. But at the same time, this application includes endpoints that are beyond the scope of that API. These enable some important features:

Please take a look at the CHANGELOG file for full explanation on the most recent changes, additions and fixes.

Features

Data model diagram

There was an Entity-Relationship diagram included in this part of the README file here, but after some of the recent, more heavy changes, it became outdated so it was deleted. It's not very good practice to store binary data in a version control system either...

However, please remember that this repo does contain the schema file to spin up a new database from. If you need/want to have a diagram to look at, I recommend trying Azimutt to create and design one from it. It's a powerful little program, really intuitive and easy to use too.

Getting started

Requirements

Supported JDK versions

Java version Supported?
< 17 no
17 yes
19 compatible
21 compatible

Installation

First and foremost, please don't forget to download, install and enable the correct Project Lombok plugin for your IDE if you haven't done so by now.

After cloning the repository, run mvn verify and get yourself comfortable because it'll take a while. That command will:

  1. Download & install dependencies.
  2. Generate some of the source code.
  3. Compile the project.
  4. Generate the WAR package file.
  5. Install it to your local maven repo.
  6. Run unit tests.
  7. Check code coverage.

One very important step that may confuse some, is no. 2, generating some source code. We have set up type-safe queries by relying on dynamically-created QueryDSL classes such as QUser and QProduct, which are un-versioned and only brought in to the code through a Maven plugin within the project dependencies.

So if for any reason you fail to compile the project, please reassure said step is successful by running mvn clean generate-sources first. Then try the former command again.

How to use

You can quickly run the application on top of an embedded server by executing the Spring Boot Run maven goal mvn spring-boot:run.

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 to know how to proceed about said Spring profile.

Configuration

The default configuration properties are located in the default properties file. These are sane, briefly documented defaults. You can run the application out-of-the-box with these. You can also totally play around with them.

Also remember, that Spring Boot does support using more than one profile at once. The sections in the official guide that explain External configuration and Profiles can help you understand these mechanisms.

Contributing to this repository 😍

Please review the contributing guidelines before proceeding.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Amigoscode
Amigoscode

🤔
bglamadrid
bglamadrid

💻 🎨
Trang Nguyen
Trang Nguyen

💻
Parundeep Singh
Parundeep Singh

💻
Markus Mutas
Markus Mutas

💻
vaishakhvh
vaishakhvh

💻
Rod Fetalvero
Rod Fetalvero

💻 ⚠️ 🤔 🚧 👀
mepox
mepox

💻 🚧 🤔 👀
Shivam Purohit
Shivam Purohit

💻
Ujwal Kumar
Ujwal Kumar

💻
angelmr
angelmr

💻
Prashriya Acharya
Prashriya Acharya

💻
Loges R
Loges R

💻
Marcin Słowiak
Marcin Słowiak

📖

This project follows the all-contributors specification. Contributions of any kind welcome!