Skip to content

Commit 4e4ace8

Browse files
committed
Sync code with the last course lesson
1 parent adb66d8 commit 4e4ace8

File tree

328 files changed

+45931
-9781
lines changed

Some content is hidden

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

328 files changed

+45931
-9781
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ node_modules/
22
dist/
33
.tmp
44
logs/
5-
src/Contexts/Mooc/Courses/infrastructure/persistence/courses.*
65
data
76
test-results.xml
7+
/src/Contexts/Mooc/Courses/infrastructure/persistence/courses.*.repo

.vscode/extensions.json

-3
This file was deleted.

.vscode/launch.json

-15
This file was deleted.

Makefile

+1-17
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,10 @@ default: build
2626
build:
2727
docker build -t $(IMAGE_NAME):dev .
2828

29-
# Run tests
30-
test: build
31-
docker-compose run --rm $(SERVICE_NAME) bash -c 'npm run build && npm run test'
32-
33-
# Start mooc backend app
34-
start-mooc-backend: build
35-
docker-compose up $(MOOC_APP_NAME)-backend && docker-compose down
36-
37-
# Start backoffice frontend app
38-
start-backoffice-frontend: build
39-
docker-compose up $(BACKOFFICE_APP_NAME)-frontend && docker-compose down
40-
41-
# Start backoffice backend app
42-
start-backoffice-backend: build
43-
docker-compose up $(BACKOFFICE_APP_NAME)-backend && docker-compose down
44-
4529
# Clean containers
4630
clean:
4731
docker-compose down --rmi local --volumes --remove-orphans
4832

4933
# Start databases containers in background
5034
start_database:
51-
docker-compose up -d mongo elasticsearch rabbitmq
35+
docker-compose up -d mongo elasticsearch rabbitmq

README.md

+4-32
Original file line numberDiff line numberDiff line change
@@ -5,44 +5,16 @@
55
</p>
66

77
<h1 align="center">
8-
🔷🎯 Hexagonal Architecture, DDD & CQRS in TypeScript
8+
🐘🎯 Hexagonal Architecture, DDD & CQRS in Typescript
99
</h1>
1010

1111
<p align="center">
1212
<a href="https://github.com/CodelyTV"><img src="https://img.shields.io/badge/CodelyTV-OS-green.svg?style=flat-square" alt="codely.tv"/></a>
1313
<a href="http://pro.codely.tv"><img src="https://img.shields.io/badge/CodelyTV-PRO-black.svg?style=flat-square" alt="CodelyTV Courses"/></a>
14-
<a href="https://github.com/CodelyTV/typescript-ddd-example/actions"><img src="https://github.com/CodelyTV/typescript-ddd-example/workflows/Node%20CI/badge.svg" alt="CI pipeline status" /></a>
1514
</p>
1615

1716
<p align="center">
18-
Example of a <strong>TypeScript application following Domain-Driven Design (DDD) and Command Query Responsibility Segregation
19-
(CQRS) principles</strong> keeping the code as simple as possible.
20-
<br />
21-
<br />
22-
Take a look, play and have fun with this.
23-
<a href="https://github.com/CodelyTV/typescript-ddd-example/stargazers">Stars are welcome 😊</a>
24-
</p>
25-
26-
# 🤩 Related links
27-
28-
## 🔷 Repositories also in TypeScript
29-
30-
- [🔷🌱 TypeScript Basic Skeleton](https://github.com/CodelyTV/typescript-basic-skeleton): Bootstrap your new TypeScript frontend project
31-
- [🔷🌍 TypeScript API Skeleton](https://github.com/CodelyTV/typescript-api-skeleton): Bootstrap your new TypeScript backend project
32-
- [🔷✨ TypeScript DDD Skeleton](https://github.com/CodelyTV/typescript-ddd-skeleton): Bootstrap your new TypeScript projects applying Hexagonal Architecture and Domain-Driven Design patterns
33-
- [🔷🔖 TypeScript DDD Course](https://github.com/CodelyTV/typescript-ddd-course): Learn Domain-Driven Design in TS lesson by lesson
34-
- [🔷🎯 TypeScript DDD Example](https://github.com/CodelyTV/typescript-ddd-example): Complete project applying Hexagonal Architecture and Domain-Driven Design patterns
35-
36-
## 🎯 Repositories also applying these software architecture patterns
37-
38-
- [☕🎯 Java DDD Example](https://github.com/CodelyTV/java-ddd-example)
39-
- [🐘🎯 PHP DDD Example](https://github.com/CodelyTV/php-ddd-example)
40-
- [λ🎯 Scala DDD Example](https://github.com/CodelyTV/scala-ddd-example)
41-
- [🦈✨ C# DDD Skeleton](https://github.com/CodelyTV/csharp-ddd-skeleton)
42-
43-
## 🎥 Video explanations to these examples
44-
45-
- [🔖 Domain-Driven Design en TypeScript](https://pro.codely.tv/library/ddd-en-typescript-modelado-y-arquitectura-172533/375662/about/): The complete video course for which we have developed this example repository
46-
- [📂 DDD en TypeScript: Estructura de carpetas](https://youtu.be/AJJRk7qmVHg): First video of the course
47-
- [🫐 Optimiza tu código TYPESCRIPT gracias a TIPOS ANÓNIMOS](https://youtu.be/qjwHbKUU8Rw): Video from the course lesson regarding Aggregates
17+
Example of a Typescript application following Domain-Driven Design (DDD) and
18+
Command Query Responsibility Segregation (CQRS) principles keeping the code as simple as possible.
4819

20+
</p>

cucumber.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@ const common = [
22
'--require-module ts-node/register' // Load TypeScript module
33
];
44

5-
const backoffice_backend = [
6-
...common,
7-
'tests/apps/backoffice/backend/features/**/*.feature',
8-
'--require tests/apps/backoffice/backend/features/step_definitions/*.steps.ts'
9-
].join(' ');
105
const mooc_backend = [
116
...common,
127
'tests/apps/mooc/backend/features/**/*.feature',
138
'--require tests/apps/mooc/backend/features/step_definitions/*.steps.ts'
149
].join(' ');
1510

11+
const backoffice_backend = [
12+
...common,
13+
'tests/apps/backoffice/backend/features/**/*.feature',
14+
'--require tests/apps/backoffice/backend/features/step_definitions/*.steps.ts'
15+
].join(' ');
16+
1617
module.exports = {
17-
backoffice_backend,
18-
mooc_backend
18+
mooc_backend,
19+
backoffice_backend
1920
};

cypress.json

-10
This file was deleted.

docker-compose.yml

+19-45
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,36 @@
11
version: '3.8'
22

3-
x-app-service: &default-app
4-
build: .
5-
command: ''
6-
environment:
7-
- MONGO_URL=mongodb://mongo:27017/dev
8-
depends_on:
9-
- mongo
10-
- kibana
11-
- elasticsearch
12-
volumes:
13-
- .:/code:delegated
14-
- node_modules:/code/node_modules:delegated
15-
163
services:
17-
app:
18-
<<: *default-app
19-
20-
mooc-backend:
21-
<<: *default-app
22-
command: bash -c "npm run build && npm run start:mooc:backend"
23-
ports:
24-
- 3000:3000
25-
26-
backoffice-frontend:
27-
<<: *default-app
28-
command: bash -c "npm run build && npm run start:backoffice:frontend"
29-
ports:
30-
- 8032:8032
31-
32-
backoffice-backend:
33-
<<: *default-app
34-
command: bash -c "npm run build && npm run start:backoffice:backend"
35-
ports:
36-
- 3001:3000
37-
384
mongo:
39-
image: mongo:3.4.6
5+
image: mongo:5.0.0
6+
environment:
7+
- MONGO_URL=mongodb://mongo:27017/dev
408
volumes:
419
- ./data/mongo:/data/db:delegated
4210
ports:
4311
- 27017:27017
44-
12+
postgres:
13+
image: postgres
14+
environment:
15+
- POSTGRES_PASSWORD=codely
16+
- POSTGRES_USER=codely
17+
- POSTGRES_DB=mooc-backend-dev
18+
ports:
19+
- '5432:5432'
20+
restart: always
21+
rabbitmq:
22+
image: 'rabbitmq:3.8-management'
23+
ports:
24+
- 5672:5672
25+
- 15672:15672
4526
elasticsearch:
4627
image: docker.elastic.co/elasticsearch/elasticsearch:7.9.3
4728
container_name: codely-elasticsearch
4829
environment:
4930
- node.name=codely-elasticsearch
5031
- discovery.type=single-node #Elasticsearch forms a single-node cluster
5132
- bootstrap.memory_lock=true # might cause the JVM or shell session to exit if it tries to allocate more memory than is available!
52-
- 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
33+
- 'ES_JAVA_OPTS=-Xms2048m -Xmx2048m'
5334
ulimits:
5435
memlock:
5536
soft: -1 # The memlock soft and hard values configures the range of memory that ElasticSearch will use. Setting this to –1 means unlimited.
@@ -58,7 +39,6 @@ services:
5839
- esdata:/usr/share/elasticsearch/data
5940
ports:
6041
- '9200:9200'
61-
6242
kibana:
6343
image: docker.elastic.co/kibana/kibana:7.8.1
6444
container_name: codely-kibana
@@ -68,13 +48,7 @@ services:
6848
ports:
6949
- 5601:5601
7050

71-
rabbitmq:
72-
image: 'rabbitmq:3.8-management'
73-
ports:
74-
- 5672:5672
75-
- 15672:15672
76-
7751
volumes:
7852
node_modules:
7953
esdata:
80-
driver: local
54+
driver: local

0 commit comments

Comments
 (0)