Skip to content

Latest commit

 

History

History
74 lines (49 loc) · 2.27 KB

File metadata and controls

74 lines (49 loc) · 2.27 KB

Initial Setup Guide

This project uses profile-based YAML configuration. Only application-example.yml is committed to git to keep credentials secure.

First Time Setup

1. Create Configuration Files

Copy the example configuration file to create your actual configuration files:

# Copy base configuration
cp src/main/resources/application-example.yml src/main/resources/application.yml

# Copy development configuration
cp src/main/resources/application-example.yml src/main/resources/application-dev.yml

# Copy production configuration
cp src/main/resources/application-example.yml src/main/resources/application-prod.yml

2. Update Development Configuration

Edit src/main/resources/application-dev.yml and update the database password:

spring:
  datasource:
    password: ${DB_PASSWORD:your_actual_password_here}

Note: These files are already in .gitignore and will not be committed to git.

3. Update Production Configuration (Optional)

For production deployments, edit src/main/resources/application-prod.yml and ensure all environment variables are properly configured. Never commit real production credentials.

Configuration Files

  • application-example.yml - Template file (committed to git)
  • application.yml - Base configuration (gitignored)
  • application-dev.yml - Development configuration (gitignored)
  • application-prod.yml - Production configuration (gitignored)

Quick Start

After creating the configuration files:

  1. Set your database password in application-dev.yml (or use environment variable)
  2. Run the application:
    ./mvnw spring-boot:run

The application will use the dev profile by default.

Using Environment Variables

You can also use environment variables instead of hardcoding values:

export DB_PASSWORD=your_password
export MONGODB_URI=mongodb://localhost:27017/order_platform
./mvnw spring-boot:run

Environment variables take precedence over values in YAML files.

Security Notes

  • ⚠️ Never commit actual configuration files to git
  • ⚠️ Only application-example.yml should be in version control
  • ⚠️ Keep your local application-dev.yml secure
  • ✅ The .gitignore file already excludes these files