Giter Site home page Giter Site logo

spring-boot-backend's Introduction

Trébol eCommerce Spring Boot Backend

Spring Logo

All Contributors

Maintainability Rating Reliability Rating Coverage

A monolithic, Spring Boot v2.6-based backend application for the eCommerce project Trébol.

Current Status 📓

Implementing Trébol API v1.5.0.

Please take a look at the CHANGELOG.md file to review the latest changes and additions.

Features 🚀

  • Uses Project Lombok
  • Exposes a RESTful API
    • Supports all operations as described by the document
    • Filtering, sorting and pagination of data are implemented through query params
    • Login, registration and guest accounts
    • Checking out with user or guest accounts
  • Uses 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
  • Uses Spring Security
    • Implements stateless session authentication/autorization through JSON Web Tokens with aid from the 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 table
    • Passwords are encoded using BCrypt
  • Integrates payments with Webpay Plus by Transbank (Java SDK repo)
    • On due time, it may be possible to integrate more popular payment services such as Paypal and Stripe
  • Integrates mail notifications with Mailgun (an account and API key are required)
  • Self-evident properties files for configuring mission-critical parameters such as
    • CORS mappings
    • JWT secret key and duration
    • BCrypt algorithm strength
    • Webpay integration endpoints
    • Mailgun & general mail properties

Data model diagram

Schema

This schema was designed in a couple minutes using Azimutt, a MIT-licensed, handy navigation and diagram visualization tool for Entity-Relationship models.

Getting started 👍

Requirements

  • JDK 11+
  • Apache Maven 3.6.0

Installation

After cloning the repository, run mvn verify, grab a drink and wait a little. That command will:

  • Download & install dependencies
  • 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 compile the project first, because some classes (QueryDSL types such as QUser, QProduct and so on) are unversioned.

Instead, these classes are generated through a Maven plugin included within the project dependencies.

If for any reason you fail to compile, please run mvn clean generate-sources and try it again.

Also don't forget to install any Project Lombok plugin for your IDE if you don't have it already.

How to use

You can quickly run the application over an embedded server by executing mvn spring-boot:run

Mailgun integration will only be available if the mailgun profile is active. Please read the application-mailgun.empty.properties file and this bit of the Spring Boot documentation to know how to proceed with that.

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.

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

Also remember, that Spring Boot does support using more than one profile at once. This and this section of the Spring Boot guide 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

💻

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.