Prerequisites
Before you begin, ensure you have the following installed:- Java 17 or higher
- Maven 3.6+ (or use the included Maven wrapper)
- MySQL 8.0+
- Git
This application uses Spring Boot 3.5.7 with Java 17. Make sure your JAVA_HOME environment variable is properly configured.
Quick Setup
Follow these steps to get your API running locally:Configure MySQL Database
Create a MySQL database for the application:Update the database credentials in
src/main/resources/application.properties:Build the Application
Use Maven to build the project and download dependencies:This command will:
- Download all required dependencies
- Compile the source code
- Run tests
- Package the application
Run the Application
Start the Spring Boot application:The application will start on
http://localhost:8080 by default.The application uses
spring.jpa.hibernate.ddl-auto=update, which means database tables will be created automatically on first run.Test Your First API Request
Now that your API is running, let’s test it with some example requests:Expected Response
A successful user registration will return:Password validation requires:
- Minimum 8 characters
- Maximum 64 characters
- At least one letter
- At least one number
ContrasenaVO (Value Object) in the domain layer.Project Structure Overview
After cloning, your project structure will look like this:Key Dependencies
The application uses the following core dependencies:Next Steps
Architecture Overview
Learn about the clean architecture and CQRS patterns used in this project
User API Endpoints
Explore user registration and login endpoints
Authentication Guide
Understand how user authentication works
User Model
Deep dive into the user domain model
Troubleshooting
Application won’t start
Database connection errors:- Verify MySQL is running:
mysql -u root -p - Check credentials in
application.properties - Ensure the
ecommercedatabase exists
- Change the default port by adding to
application.properties:
- Check your Java version:
java -version - Ensure it’s Java 17 or higher
- Set JAVA_HOME:
export JAVA_HOME=/path/to/java17
Maven build failures
- Clear Maven cache:
./mvnw clean - Update dependencies:
./mvnw dependency:resolve - Check internet connection for dependency downloads
For more detailed troubleshooting, check the application logs in the console output or enable debug logging by adding
logging.level.root=DEBUG to your application.properties.