This guide explains the full development cycle for contributing to Security Shepherd.
Fork the repository or create a branch from the dev branch:
git checkout dev
git pull origin dev
git checkout -b "dev#<issue-number>"Branch naming convention: dev#<issueNumber> (e.g., dev#536)
Edit the code in your branch. Key directories:
src/main/java/- Java source codesrc/main/webapp/- Web resources (JSP, CSS, JS)src/test/java/- Unit tests
Build the application with Maven:
mvn -Pdocker clean install -DskipTestsThis generates:
- The WAR file in
target/ - HTTPS certificates for Docker
Start the full application stack using Docker Compose:
# Build and start all containers (MariaDB, MongoDB, Tomcat)
docker-compose up --build
# Or run in detached mode
docker-compose up -d --buildAccess the application:
- HTTP: http://localhost
- HTTPS: https://localhost:8443
Default login credentials:
- Username:
admin - Password:
password
# View all logs
docker-compose logs -f
# View only web container logs
docker-compose logs -f webAfter making additional changes:
# Rebuild the WAR
mvn -Pdocker clean install -DskipTests
# Rebuild and restart only the web container
docker-compose up -d --build webdocker-compose downTo also remove volumes (database data):
docker-compose down -vSee testing.md for instructions on running the unit and integration test suite.
When your changes are complete and tests pass:
- Push your branch to your fork/origin
- Create a Pull Request targeting the
devbranch - Ensure all CI checks pass
See CONTRIBUTING.md for code formatting and PR guidelines.
The .env file in the project root contains environment variables for Docker. Key variables:
| Variable | Description |
|---|---|
DB_PASS |
MariaDB root password |
HTTP_PORT |
HTTP port (default: 80) |
HTTPS_PORT |
HTTPS port (default: 8443) |
Check if ports are already in use:
# Check if port 80 is in use
lsof -i :80Ensure the database container is healthy:
docker-compose ps
docker-compose logs dbMake sure you rebuilt both the WAR and the container:
mvn -Pdocker clean install -DskipTests
docker-compose up -d --build web