Prerequisites
Before installing TechStore, ensure your system meets the following requirements:Required Software
Java 21
TechStore is built with Java 21 and Spring Boot 3.4.1
MySQL 8.0+
Primary database (PostgreSQL also supported)
Maven 3.6+
Build tool (or use included wrapper)
Git
Version control for cloning the repository
System Requirements
- RAM: 4GB minimum, 8GB recommended
- Disk Space: 500MB for application + database
- OS: Linux, macOS, or Windows
Installation Steps
1. Install Java 21
- Ubuntu/Debian
- macOS
- Windows
2. Install MySQL
- Ubuntu/Debian
- macOS
- Windows
3. Database Setup
Create Database
Connect to MySQL and create the database:Schema Initialization
TechStore uses Hibernate DDL Auto mode, which automatically creates and updates database tables based on your entity classes.The
spring.jpa.hibernate.ddl-auto=update setting means:- Tables are created automatically on first run
- Schema changes are applied on application restart
- Existing data is preserved
usuarios- User accounts with authenticationroles- User role definitions (ADMIN, USER)usuarios_roles- Many-to-many relationshipproductos- Product catalogcategorias- Product categoriespedidos- Customer orderspedido_detalle- Order line itemscarrito- Shopping cart sessionscarrito_item- Cart itemsproducto_imagen- Product image gallery
4. Application Configuration
Basic Configuration
Create or editsrc/main/resources/application.properties:
Email Service Configuration (Optional but Recommended)
TechStore includes an email service for user verification and password recovery:Security Configuration
TechStore uses RSA asymmetric encryption for JWT tokens. Keys are generated automatically on startup, but you can configure:src/main/java/ab/tienda_online/security/SecurityConfig.java:143-151) automatically generates 2048-bit RSA keys for secure JWT signing.
5. Build the Application
Using Maven Wrapper (recommended):The first build downloads all dependencies (~200MB). Subsequent builds are much faster.
6. Run the Application
Development Mode
Production Mode
For production, build an executable JAR and run with production profile:Run as System Service (Linux)
Create/etc/systemd/system/techstore.service:
Development vs Production
Development Settings
Production Settings
Verify Installation
Check that the application is running correctly:Troubleshooting
Port 8080 already in use
Port 8080 already in use
Error: Or kill the process using port 8080:
Web server failed to start. Port 8080 was already in use.Solution:Change the port in application.properties:Database connection refused
Database connection refused
Error:
Communications link failure or Connection refusedSolution:-
Verify MySQL is running:
-
Check connection details in
application.properties: -
Test connection manually:
-
Verify user permissions:
Java version mismatch
Java version mismatch
Error: If you have multiple Java versions, set
Unsupported class file major version 65Solution:TechStore requires Java 21. Check your version:JAVA_HOME:JWT token generation fails
JWT token generation fails
Error: The RSA key generation happens in
IllegalStateException during RSA key generationSolution:This is rare but can happen if your JVM lacks cryptography libraries. Ensure you’re using a full JDK (not JRE):SecurityConfig.java:143-151.Email sending fails
Email sending fails
Error:
Authentication failed or Could not send mailSolutions:-
Gmail App Password: Don’t use your regular Gmail password. Generate an App Password:
- Go to myaccount.google.com/apppasswords
- Generate a 16-character password
- Use this in
application.properties
-
Check SMTP settings:
-
Enable debug mode:
-
Test with curl:
Maven build fails
Maven build fails
Error:
Failed to execute goal or dependency issuesSolutions:-
Clear Maven cache:
-
Use Maven wrapper instead of system Maven:
- Check network connectivity (Maven downloads dependencies)
-
Verify
pom.xmlis not corrupted:
Hibernate schema update errors
Hibernate schema update errors
Error:
Table doesn't exist or Column not foundSolution:-
Development: Drop and recreate database:
-
Production: Use manual migration:
Then apply schema changes manually.
-
Check entity classes match database:
Usuario.java:43-49- User roles relationshipProducto.java:42-44- Product category relationship
CORS errors from frontend
CORS errors from frontend
Error: Or in
Access to fetch blocked by CORS policySolution:Add your frontend URL to CORS configuration in SecurityConfig.java:66-73:application.properties:Next Steps
Quickstart Guide
Make your first API request in 5 minutes
Configuration
Advanced configuration options
API Reference
Explore all available endpoints
Deployment
Deploy to production (Docker, AWS, etc.)
Additional Resources
Having issues? Check the GitHub Issues or reach out to the community.