Skip to content

danielgraciapalacios/FitZoneSpring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FitZoneSpring

Overview

FitZoneSpring is a command-line Spring Boot application for managing gym client records. This document provides a high-level introduction to the application's purpose, technology stack, and architectural design.

Relevant source files:

  • .gitattributes
  • pom.xml
  • src/main/java/fit_zone/fit_zone/FitZoneSpringApplication.java
  • src/main/resources/application.properties

Purpose and Scope

FitZoneSpring is a console-based Spring Boot application designed to manage client records for a gym facility. The application provides a command-line interface for performing CRUD (Create, Read, Update, Delete) operations on client data stored in a MySQL database. Unlike typical Spring Boot applications that serve web requests, FitZoneSpring is configured to run as a standalone console application that executes immediately upon startup via the CommandLineRunner interface.

The application allows gym staff to:

  • List all registered clients
  • Search for a specific client by ID
  • Add new client records with membership information
  • Modify existing client details
  • Delete client records

Technology Stack

FitZoneSpring is built using the following technologies and frameworks:

Component Technology Version Purpose
Runtime Java 17 Application runtime environment
Framework Spring Boot 4.0.0 Application framework and dependency injection
Persistence Spring Data JPA (via starter) Data access layer abstraction
ORM Hibernate (via JPA starter) Object-relational mapping provider
Database MySQL 8.0 Relational database for client data storage
JDBC Driver MySQL Connector/J (runtime) Database connectivity
Code Generation Lombok (compile-time) Boilerplate code reduction
Build Tool Maven 3.9.11 (via wrapper) Dependency management and build automation
Logging SLF4J/Logback (via Spring Boot) Application logging
CI/CD Jenkins N/A Continuous integration pipeline

System Architecture

FitZoneSpring follows a classic three-tier layered architecture, with clear separation between the presentation layer (console UI), business logic layer (services), and data access layer (repositories).

Component Hierarchy:

  • Presentation Layer: FitZoneSpringApplication (CLI Interface)
  • Business Logic Layer: ClientService / IClientService
  • Data Access Layer: ClientRepository (Spring Data JPA)
  • Domain Model: Client (JPA Entity)

Key Features and Capabilities

Console Menu System

The application provides an interactive console menu with the following operations:

Menu Option Service Method Called Description
1 listClients() Displays all registered clients
2 findClientById(Integer) Retrieves a specific client by ID
3 saveClient(Client) Creates a new client record
4 findClientById() + saveClient() Updates existing client information
5 findClientById() + deleteClient() Deletes a client record
6 N/A Exits the application

Spring Boot Configuration

The application is configured through application.properties with several critical settings:

  • Database Connection: JDBC URL pointing to MySQL at 127.0.0.1:3306/fit_zone_db with credentials root/admin
  • Schema Management: spring.jpa.hibernate.ddl-auto=none prevents automatic schema generation
  • Web Disabled: spring.main.web-application-type=none disables the embedded web server
  • Naming Strategy: PhysicalNamingStrategyStandardImpl preserves exact field names

Data Persistence Model

The Client entity uses JPA annotations to map Java objects to the clients database table:

Java Field Java Type Database Column Constraints
idClient Integer idClient Primary Key, Auto-increment
firstName String first_name NOT NULL
lastName1 String last_name1 NOT NULL
lastName2 String last_name2 NOT NULL
membershipNumber Integer membership_number UNIQUE

The ClientRepository interface extends JpaRepository<Client, Integer>, providing automatic implementations for standard CRUD operations.

Build and Deployment

The application is built using Maven, with the Maven Wrapper ensuring consistent builds across environments:

  • Build Command: ./mvnw clean package or mvnw.cmd clean package (Windows)
  • Output Artifact: target/fit_zone-0.0.1-SNAPSHOT.jar (executable JAR with embedded dependencies)
  • Execution: java -jar target/fit_zone-0.0.1-SNAPSHOT.jar
  • CI/CD: Jenkins pipeline defined in Jenkinsfile automates build, test, and package stages

The spring-boot-maven-plugin creates a "fat JAR" containing all dependencies, making the application self-contained and deployable without additional setup beyond Java 17 and MySQL 8.0.

Next Steps

For detailed information on specific aspects of FitZoneSpring, refer to the complete documentation covering:

  • Setting up the development environment
  • Understanding the architectural layers
  • Component documentation
  • Configuration options
  • Build system details
  • Database schema reference

About

FitZoneSpring is a command-line Spring Boot application for managing gym client records

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages