Documentation Index
Fetch the complete documentation index at: https://mintlify.com/WalysonGomes/secure-link-api/llms.txt
Use this file to discover all available pages before exploring further.
Spring Profiles
Secure Link API uses Spring profiles to manage different environments:| Profile | Purpose | Database |
|---|---|---|
dev | Local development | MySQL |
prod | Production deployment | MySQL |
test | Automated testing | H2 (in-memory) |
Activating a Profile
Environment Variables
The application uses environment variables for sensitive configuration. These can be set in a.env file (loaded automatically) or as system environment variables.
Required Variables
| Variable | Description | Example |
|---|---|---|
BASE_URL | Public URL for the API | http://localhost:8080 |
DB_HOST | MySQL host address | localhost |
DB_PORT | MySQL port | 3307 |
DB_NAME | Database name | secure_link |
DB_USERNAME | Database user | admin |
DB_PASSWORD | Database password | secure_password |
Example .env File
.env
Application Properties
Core Configuration
The base configuration inapplication.properties:
application.properties
Dev Profile Configuration
Configuration specific toapplication-dev.properties:
application-dev.properties
Production Profile Configuration
Configuration forapplication-prod.properties:
application-prod.properties
Production profile hides health check details for security. Only the overall status is exposed.
Test Profile Configuration
Configuration forapplication-test.properties:
application-test.properties
Configuration Properties Reference
Link Settings
| Property | Description | Default |
|---|---|---|
app.link.default-ttl | Default link expiration time (ISO-8601) | PT24H (24 hours) |
app.base-url | Base URL for link generation | http://localhost:8080 |
Storage Settings
| Property | Description | Default |
|---|---|---|
app.storage.path | Directory for uploaded files | /tmp/uploads/ |
spring.servlet.multipart.max-file-size | Maximum file size | 50MB |
spring.servlet.multipart.max-request-size | Maximum request size | 50MB |
CORS Settings
| Property | Description | Default |
|---|---|---|
app.cors.allowed-origins | Comma-separated allowed origins | http://localhost:4200,http://127.0.0.1:4200 |
Database Settings
| Property | Description |
|---|---|
spring.datasource.url | JDBC connection URL |
spring.datasource.username | Database username |
spring.datasource.password | Database password |
spring.jpa.hibernate.ddl-auto | Schema generation strategy (validate recommended) |
Actuator Settings
| Property | Description |
|---|---|
management.endpoints.web.exposure.include | Exposed actuator endpoints |
management.endpoint.health.show-details | Health endpoint detail level |
Monitoring and Observability
Health Checks
The application provides detailed health information at/actuator/health:
- Database connectivity - Verifies MySQL connection
- Disk space - Checks available storage
- Storage health - Validates upload directory
- Expiration job - Monitors scheduled task status
Prometheus Metrics
Exposed at/actuator/prometheus (dev profile only):
secure_link_resolve_success_total- Successful link resolutionssecure_link_resolve_failure_total- Failed access attempts- Standard JVM, HTTP, and database metrics
Logging Configuration
Correlation IDs
Every request includes a correlation ID in logs and response headers:X-Correlation-Id response header.
Log Levels
Adjust log levels per package:Security Configuration
Password Encryption
Link passwords are encrypted using BCrypt with strength 10:CORS Policy
Configure allowed origins for cross-origin requests:Database Migration
Flyway automatically manages database schema versions:- Migration scripts:
src/main/resources/db/migration/ - Naming convention:
V{version}__{description}.sql - Baseline on migrate: Enabled for existing databases
Common Flyway Commands
Production Recommendations
Performance Tuning
File Storage
For production, consider using:- Network-attached storage (NAS)
- Object storage (S3, MinIO)
- Persistent volumes in containerized environments
app.storage.path accordingly:
Next Steps
- Deploy with Docker for containerized environments
- Install locally for development
- Review API Reference for usage
