marketcore-E-commerce-springboot-template

MarketCore – README détaillé

Frameworks principaux : Spring Boot 3 / Spring 6, Spring Security 6, Spring Data JPA, Thymeleaf 3.1, TailwindCSS (classes utilitaires dans les templates)

projet is live on for test : https://www.demo.marketcore.tech Youtube: https://youtu.be/ULajONYnKfw

⚠️ Note importante : Cette version sur Git est une version lite destinée à explorer le projet. Pour obtenir la version complète avec toutes les fonctionnalités avancées, rendez-vous sur : https://jaouher6.gumroad.com/l/kwwbic


📚 Table of Contents

  1. Overview & Features
  2. Technical Architecture
  3. Prerequisites
  4. Installation & Quick Start
  5. Configuration (application.properties / .yml)
  6. Roles & Account Management
  7. Main Modules Functionality
  8. Useful Commands
  9. Demo Data / Seed
  10. Troubleshooting (common errors)
  11. Roadmap / Improvement Ideas
  12. License & Credits

Overview & Features

Public Side

Seller Side / “Seller” Space

Seller dashboard with:

Back-office / Administration

Security / Authentication

I18n ready

Miscellaneous


🗺️ Automatic Sitemap Generation

The project includes a dynamic sitemap.xml generation module.
Whenever a product, category or main page is added or modified, the sitemap is automatically regenerated and exposed at the URL.

🚀 Quality & Performance

The project has been audited with Google Lighthouse:

Criteria Score
⚡ Performance 76 / 100
♿ Accessibility 90 / 100
✅ Best Practices 100 / 100

These results demonstrate code quality, compliance with web standards (semantic HTML, security, HTTPS, etc.) and the lightweight nature of the Thymeleaf/Tailwind architecture.


Technical Architecture

src/
 ├── main/java/
 │   └── com.example.marketcore
 │        ├── controller/         # Web Controllers (MVC)
 │        ├── service/            # Business Services
 │        ├── repository/         # Spring Data JPA Repositories
 │        ├── model/entity/       # JPA Entities (Product, Category, User, CartItem, Order, etc.)
 │        ├── security/           # Spring Security Config & classes
 │        └── config/             # Various configurations
 │
 ├── main/resources/
 │   ├── templates/               # Thymeleaf Views
 │   │    ├── fragments/          # Layout, header, footer...
 │   │    ├── cart/               # Shopping cart
 │   │    ├── product/            # Product pages, admin products
 │   │    ├── order/              # Checkout, confirmation
 │   │    └── ...
 │   ├── static/                  # CSS/JS (if needed)
 │   ├── application.properties   # Spring Boot Config
 │   ├── data.sql (optional)      # Initial data sets
 │   └── schema.sql (optional)
 │
 └── test/java/                   # Unit / Integration tests

Prerequisites


Installation & Quick Start

# 1. Clone the repo (or extract the zip)
$ git clone https://github.com/my-org/marketcore.git
$ cd marketcore

# 2. Configure the DB (see next section) in application.properties

# 3. Launch the app
$ ./mvnw spring-boot:run    # or mvn spring-boot:run

# 4. Access the app
# Front office: http://localhost:8080
# Back office:  http://localhost:8080/admin/products

To generate an executable jar:

mvn clean package -DskipTests
java -jar target/marketcore-*.jar

Configuration (application.properties / .yml)

Example src/main/resources/application.properties:

# --- DB ---
spring.datasource.url=jdbc:mysql://localhost:3306/marketcore?useSSL=false&serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=secret
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=false

# --- Thymeleaf ---
spring.thymeleaf.cache=false

# --- App ---
app.currencySymbol=

Tip for Thymeleaf price formatting: use literal syntax to avoid escaping errors:

th:text="|${#numbers.formatDecimal(i.price,1,'COMMA',2,'POINT')} ${currencySymbol}|"

Roles & Account Management

Depending on your implementation, a data.sql script can create:

INSERT INTO users (id, email, password, full_name, enabled) VALUES (...);
INSERT INTO roles (id, name) VALUES (1,'ADMIN'), (2,'SELLER'), (3,'USER');
INSERT INTO users_roles (user_id, role_id) VALUES (...);

📧 Email Sending System

The project integrates an email sending system via Mailjet for automatic notifications.

Configuration

Add the following properties in application.properties:

# --- Mailjet Configuration ---
mailjet.api.key=your_api_key
mailjet.secret.key=your_secret_key
mailjet.sender.email=noreply@marketcore.com
mailjet.sender.name=marketcore
app.base.url=https://marketcore.com

Implemented Features

1. 🔑 Password Reset Email

Sent automatically when a user requests to reset their password.

Trigger: Via the forgot password form

Content:

Code usage:

emailService.sendPasswordResetEmail(userEmail, resetToken);

2. ✅ Order Confirmation Email

Sent automatically after each successfully validated order.

Trigger: Automatic after orderService.placeOrder()

Content:

Code usage:

emailService.sendOrderConfirmationEmail(
    clientEmail,
    orderNumber,
    customerName,
    totalAmount,
    orderDetails
);

Example of order details:

2x iPhone 13 - 2500.00 EUR
1x AirPods Pro - 450.00 EUR
3x USB-C Cable - 30.00 EUR

Error Handling

The email system is designed not to block critical operations:

Architecture

EmailService (interface)
  └── MailjetEmailService (implementation)
       ├── sendPasswordResetEmail()
       ├── sendOrderConfirmationEmail()
       └── Integrated HTML Templates

HTML Templates

Emails use responsive HTML templates with:


Useful Commands

# Run tests
mvn test

# Formatting / checkstyle (if configured)
mvn spotless:apply

# Generate a jar
mvn clean package -DskipTests

# Run with specific profile
env SPRING_PROFILES_ACTIVE=prod java -jar target/marketcore.jar

Roadmap / Improvement Ideas


License & Credits

✅ Personal and professional use authorized.

🚫 Resale, redistribution or code publication prohibited.

🛠️ Installation support provided. This support only covers help with initial project setup (installation, basic configuration, launch).

📦 Product sold as is.