Skip to content

Commit 40758af

Browse files
committed
config: Update application.properties with database configuration for authentication example
1 parent 7a704cc commit 40758af

File tree

1 file changed

+18
-124
lines changed

1 file changed

+18
-124
lines changed
Lines changed: 18 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -1,124 +1,18 @@
1-
# JazzyFramework Database Configuration
2-
# This file demonstrates how to configure database connections for your application.
3-
# The framework supports H2 (embedded), MySQL, and PostgreSQL out of the box.
4-
5-
# ============================================================================
6-
# DATABASE CONFIGURATION
7-
# ============================================================================
8-
9-
# Enable/disable database functionality
10-
jazzy.database.enabled=true
11-
12-
# ============================================================================
13-
# H2 DATABASE (Default - for development)
14-
# ============================================================================
15-
# H2 is automatically configured if no other database is specified
16-
# Uncomment and modify these settings to customize H2 behavior
17-
18-
jazzy.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
19-
jazzy.datasource.driver-class-name=org.h2.Driver
20-
jazzy.datasource.username=sa
21-
jazzy.datasource.password=
22-
23-
# H2 Console (accessible at http://localhost:8082)
24-
jazzy.h2.console.enabled=true
25-
26-
# ============================================================================
27-
# MYSQL DATABASE (Production example)
28-
# ============================================================================
29-
# Uncomment these lines to use MySQL instead of H2
30-
# Make sure you have MySQL running and the database created
31-
32-
#jazzy.datasource.url=jdbc:mysql://localhost:3306/jazzy_app?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC
33-
#jazzy.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
34-
#jazzy.datasource.username=your_username
35-
#jazzy.datasource.password=your_password
36-
37-
# ============================================================================
38-
# POSTGRESQL DATABASE (Production example)
39-
# ============================================================================
40-
# Uncomment these lines to use PostgreSQL instead of H2
41-
# Make sure you have PostgreSQL running and the database created
42-
43-
#jazzy.datasource.url=jdbc:postgresql://localhost:5432/jazzy_app
44-
#jazzy.datasource.driver-class-name=org.postgresql.Driver
45-
#jazzy.datasource.username=your_username
46-
#jazzy.datasource.password=your_password
47-
48-
# ============================================================================
49-
# HIBERNATE/JPA CONFIGURATION
50-
# ============================================================================
51-
52-
# Database platform (automatically detected if not specified)
53-
jazzy.jpa.database-platform=org.hibernate.dialect.H2Dialect
54-
55-
# DDL mode: none, validate, update, create, create-drop
56-
jazzy.jpa.hibernate.ddl-auto=update
57-
58-
# Show SQL queries in console (useful for debugging)
59-
jazzy.jpa.show-sql=true
60-
61-
# Format SQL queries for better readability
62-
jazzy.jpa.properties.hibernate.format_sql=true
63-
64-
# Additional Hibernate properties
65-
jazzy.jpa.properties.hibernate.use_sql_comments=true
66-
jazzy.jpa.properties.hibernate.jdbc.batch_size=20
67-
jazzy.jpa.properties.hibernate.order_inserts=true
68-
jazzy.jpa.properties.hibernate.order_updates=true
69-
70-
# ============================================================================
71-
# CONNECTION POOL CONFIGURATION (HikariCP)
72-
# ============================================================================
73-
74-
# Maximum number of connections in the pool
75-
jazzy.datasource.hikari.maximum-pool-size=10
76-
77-
# Minimum number of idle connections
78-
jazzy.datasource.hikari.minimum-idle=2
79-
80-
# Connection timeout (milliseconds)
81-
jazzy.datasource.hikari.connection-timeout=30000
82-
83-
# Idle timeout (milliseconds)
84-
jazzy.datasource.hikari.idle-timeout=600000
85-
86-
# Maximum lifetime of a connection (milliseconds)
87-
jazzy.datasource.hikari.max-lifetime=1800000
88-
89-
# ============================================================================
90-
# EXAMPLE CONFIGURATIONS FOR DIFFERENT ENVIRONMENTS
91-
# ============================================================================
92-
93-
# Development (default - uses H2)
94-
# - No additional configuration needed
95-
# - H2 console available at http://localhost:8082
96-
# - Database file is in-memory (data lost on restart)
97-
98-
# Testing (persistent H2 file)
99-
# jazzy.datasource.url=jdbc:h2:file:./data/testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
100-
101-
# Staging (MySQL example)
102-
# jazzy.datasource.url=jdbc:mysql://staging-db:3306/jazzy_staging
103-
# jazzy.datasource.username=staging_user
104-
# jazzy.datasource.password=staging_password
105-
# jazzy.jpa.database-platform=org.hibernate.dialect.MySQL8Dialect
106-
107-
# Production (PostgreSQL example)
108-
# jazzy.datasource.url=jdbc:postgresql://prod-db:5432/jazzy_production
109-
# jazzy.datasource.username=prod_user
110-
# jazzy.datasource.password=secure_password
111-
# jazzy.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
112-
# jazzy.jpa.hibernate.ddl-auto=validate
113-
# jazzy.jpa.show-sql=false
114-
115-
# ============================================================================
116-
# NOTES
117-
# ============================================================================
118-
#
119-
# 1. Change jazzy.jpa.hibernate.ddl-auto to "validate" in production
120-
# 2. Set jazzy.jpa.show-sql to false in production for performance
121-
# 3. Always use strong passwords in production environments
122-
# 4. Consider using environment variables for sensitive data
123-
# 5. The framework automatically detects and registers @Entity classes
124-
# 6. Repository interfaces extending BaseRepository are auto-implemented
1+
# Generated by Jazzy CLI - Auth Configuration
2+
3+
# Security Configuration (TODO: Implement in framework)
4+
jazzy.security.enabled=true
5+
6+
# JWT Configuration
7+
jazzy.security.jwt.secret=${JWT_SECRET:change-this-secret-in-production}
8+
# jazzy.security.jwt.expiration-hours=24
9+
10+
# Database Configuration (H2 for development)
11+
jazzy.datasource.url=jdbc:h2:mem:authdb
12+
jazzy.datasource.username=sa
13+
jazzy.datasource.password=
14+
jazzy.datasource.driver-class-name=org.h2.Driver
15+
16+
# JPA Configuration
17+
jazzy.jpa.hibernate.ddl-auto=create-drop
18+
jazzy.jpa.show-sql=true

0 commit comments

Comments
 (0)