This is a Spring Boot application for drawing and managing pixel art collections.
Follow these instructions to set up and run the application locally.
- Java 11+
- Maven 3.6+
- PostgreSQL database (version 10 or higher recommended)
- Git
-
Clone the repository:
git clone https://github.com/Tooonia/pixelart-back.git cd pixelart-back -
Database Configuration: This application requires a PostgreSQL database. Ensure you have a PostgreSQL instance running (e.g., via Docker, or a local installation).
Environment Variables for Database & Secrets: The application relies on several environment variables for sensitive data and environment-specific configuration. These must be set in your operating system's environment or in your IDE's run configuration. Do NOT hardcode these values in
application.propertiesor commit them to Git.Variable Name Purpose Example Value (for local dev) Required Notes PORTThe port on which the Spring Boot application will run. 8085Optional Defaults to 8085if not set.DB_URLThe JDBC URL for the PostgreSQL database connection. jdbc:postgresql://localhost:5432/pixelart_devYes Use a separate database for development (e.g., pixelart_dev).DB_USERNAMEUsername for the PostgreSQL database. pixelart_dev_userYes Ensure this user has appropriate permissions on the pixelart_devdatabase.DB_PASSWORDPassword for the PostgreSQL database user. your_secure_dev_passwordYes CRITICAL: Keep this secure. Never commit to Git. HIBERNATE_DDL_AUTOControls Hibernate's schema update behavior. updateOptional For local development, updatecan be convenient for automatic schema generation.
For production, this should benoneorvalidateto prevent accidental schema changes. Defaults tononeif not set.JWT_SECRET_KEYThe secret key used for signing and verifying JWTs. aVeryLongAndComplexSecretKeyThatIsAtLeast256BitsOrMoreYes CRITICAL: This is highly sensitive. Generate a strong, unique key. Never commit to Git. How to Set Environment Variables:
- For permanent local setup (Linux/macOS): Add
export VAR_NAME="value"lines to your~/.bashrc,~/.zshrc, or~/.profileand thensourcethe file. - For permanent local setup (Windows): Use
setx VAR_NAME "value"in Command Prompt (restart terminal/IDE to take effect), or set them via the System Properties dialog. - For IDE Run Configuration: In IntelliJ IDEA/VS Code, configure the environment variables directly within your application's run/debug configuration settings.
- For permanent local setup (Linux/macOS): Add
-
Run the application:
./mvnw spring-boot:run
(Or run from your IDE).