Skip to content

Commit 6bb4600

Browse files
Initial commit
0 parents  commit 6bb4600

314 files changed

Lines changed: 9357 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
9+
[*.java]
10+
indent_size = 4
11+
indent_style = space

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# See apps/main/resources/.env

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v1
12+
13+
- name: Start all the environment
14+
run: docker-compose up -d
15+
16+
- name: Wait for the environment to get up
17+
run: |
18+
while ! make ping-mysql &>/dev/null; do
19+
echo "Waiting for database connection..."
20+
sleep 2
21+
done
22+
23+
- name: Run the tests
24+
run: make test

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Gradle
2+
.gradle
3+
build/
4+
5+
# Ignore Gradle GUI config
6+
gradle-app.setting
7+
8+
/var/log/*
9+
!/var/log/.gitkeep
10+
11+
.env.local
12+
.env.*.local

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM openjdk:11-slim-buster
2+
WORKDIR /app

Makefile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
.PHONY: all
2+
all: build
3+
4+
.PHONY: up
5+
up:
6+
@docker-compose up -d
7+
8+
.PHONY: build
9+
build:
10+
@./gradlew build --warning-mode all
11+
12+
.PHONY: run-tests
13+
run-tests:
14+
@./gradlew test --warning-mode all
15+
16+
.PHONY: test
17+
test:
18+
@docker exec codelytv-ddd_skeleton-java ./gradlew test --warning-mode all
19+
20+
.PHONY: run
21+
run:
22+
@./gradlew :run
23+
24+
.PHONY: ping-mysql
25+
ping-mysql:
26+
@docker exec codelytv-java_ddd_skeleton-mysql mysqladmin --user=root --password= --host "127.0.0.1" ping --silent
27+
28+
# Start the app
29+
.PHONY: start-mooc_backend
30+
start-mooc_backend:
31+
@./gradlew :run --args='mooc_backend server'
32+
33+
.PHONY: start-backoffice_frontend
34+
start-backoffice_frontend:
35+
@./gradlew :run --args='backoffice_frontend server'

README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# ☕🚀 Java DDD Skeleton: Save the boilerplate in your new projects
2+
3+
<img src="http://codely.tv/wp-content/uploads/2016/05/cropped-logo-codelyTV.png" align="left" width="192px" height="192px"/>
4+
<img align="left" width="0" height="192px" hspace="10"/>
5+
6+
> ⚡ Start your Java projects as fast as possible
7+
8+
[![CodelyTV](https://img.shields.io/badge/codely-tv-green.svg?style=flat-square)](https://codely.tv)
9+
[![CI pipeline status](https://github.com/CodelyTV/java-ddd-skeleton/workflows/CI/badge.svg)](https://github.com/CodelyTV/java-ddd-skeleton/actions)
10+
11+
## ℹ️ Introduction
12+
13+
This is a repository intended to serve as a starting point if you want to bootstrap a Java project with JUnit and Gradle.
14+
15+
Here you have the [course on CodelyTV Pro where we explain step by step all this](https://pro.codely.tv/library/ddd-en-java/about/?utm_source=github&utm_medium=social&utm_campaign=readme) (Spanish)
16+
17+
## 🏁 How To Start
18+
19+
1. Install Java 11: `brew cask install corretto`
20+
2. Set it as your default JVM: `export JAVA_HOME='/Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home'`
21+
3. Clone this repository: `git clone https://github.com/CodelyTV/java-ddd-skeleton`.
22+
4. Bring up the Docker environment: `make up`.
23+
5. Execute some [Gradle lifecycle tasks](https://docs.gradle.org/current/userguide/java_plugin.html#lifecycle_tasks) in order to check everything is OK:
24+
1. Create [the project JAR](https://docs.gradle.org/current/userguide/java_plugin.html#sec:jar): `make build`
25+
2. Run the tests and plugins verification tasks: `make test`
26+
6. Start developing!
27+
28+
## ☝️ How to update dependencies
29+
30+
* Gradle ([releases](https://gradle.org/releases/)): `./gradlew wrapper --gradle-version=WANTED_VERSION --distribution-type=bin`
31+
32+
## 💡 Related repositories
33+
34+
### ☕ Java
35+
36+
* 📂 [Java Basic Skeleton](https://github.com/CodelyTV/java-basic-skeleton)
37+
*[Java OOP Examples](https://github.com/CodelyTV/java-oop-examples)
38+
* 🧱 [Java SOLID Examples](https://github.com/CodelyTV/java-solid-examples)
39+
* 🥦 [Java DDD Example](https://github.com/CodelyTV/java-ddd-example)
40+
41+
### 🐘 PHP
42+
43+
* 📂 [PHP Basic Skeleton](https://github.com/CodelyTV/php-basic-skeleton)
44+
* 🎩 [PHP DDD Skeleton](https://github.com/CodelyTV/php-ddd-skeleton)
45+
* 🥦 [PHP DDD Example](https://github.com/CodelyTV/php-ddd-example)
46+
47+
### 🧬 Scala
48+
49+
* 📂 [Scala Basic Skeleton](https://github.com/CodelyTV/scala-basic-skeleton)
50+
*[Scala Basic Skeleton (g8 template)](https://github.com/CodelyTV/scala-basic-skeleton.g8)
51+
*[Scala Examples](https://github.com/CodelyTV/scala-examples)
52+
* 🥦 [Scala DDD Example](https://github.com/CodelyTV/scala-ddd-example)

apps/main/resources/.env

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# MOOC #
2+
#--------------------------------#
3+
MOOC_BACKEND_SERVER_PORT=8081
4+
# MySql
5+
MOOC_DATABASE_HOST=codelytv-java_ddd_skeleton-mysql
6+
MOOC_DATABASE_PORT=3306
7+
MOOC_DATABASE_NAME=mooc
8+
MOOC_DATABASE_USER=root
9+
MOOC_DATABASE_PASSWORD=
10+
11+
# BACKOFFICE #
12+
#--------------------------------#
13+
BACKOFFICE_FRONTEND_SERVER_PORT=8090
14+
BACKOFFICE_BACKEND_SERVER_PORT=8091
15+
# MySql
16+
BACKOFFICE_DATABASE_HOST=codelytv-java_ddd_skeleton-mysql
17+
BACKOFFICE_DATABASE_PORT=3306
18+
BACKOFFICE_DATABASE_NAME=backoffice
19+
BACKOFFICE_DATABASE_USER=root
20+
BACKOFFICE_DATABASE_PASSWORD=
21+
# Elasticsearch
22+
BACKOFFICE_ELASTICSEARCH_HOST=codelytv-java_ddd_skeleton-elasticsearch
23+
BACKOFFICE_ELASTICSEARCH_PORT=9200
24+
BACKOFFICE_ELASTICSEARCH_INDEX_PREFIX=backoffice
25+
26+
# COMMON #
27+
#--------------------------------#
28+
# RabbitMQ
29+
RABBITMQ_HOST=codelytv-java_ddd_skeleton-rabbitmq
30+
RABBITMQ_PORT=5672
31+
RABBITMQ_LOGIN=codelytv
32+
RABBITMQ_PASSWORD=c0d3ly
33+
RABBITMQ_EXCHANGE=domain_events
34+
RABBITMQ_MAX_RETRIES=5
4.09 KB
Loading
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<#import "spring.ftl" as spring />
2+
3+
<!doctype html>
4+
<html lang="en">
5+
<head>
6+
<meta charset="UTF-8">
7+
<meta name="viewport"
8+
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
9+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
10+
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
11+
12+
<title>${title}</title>
13+
<title>${description}</title>
14+
</head>
15+
<body>
16+
<#include "partials/header.ftl">
17+
18+
<div class="container mx-auto px-4 p-5">
19+
<h1 class="font-sans text-gray-800 text-center text-5xl mb-10"><@page_title/></h1>
20+
<@main/>
21+
</div>
22+
23+
<div class="clearfix"></div>
24+
25+
<#include "partials/footer.ftl">
26+
</body>
27+
</html>

0 commit comments

Comments
 (0)