It is my attempt to create Clean Architecture based application in Typescript.
IPoster is a simple fictional application that allows users to publish posts.
- User
- Post
- Media
-
User -> IPoster
User
can createGuest
account inIPoster
User
can createAuthor
account inIPoster
-
User -> Media
Author
can create ownMedia
Author
can edit ownMedia
Author
can get ownMedia
Author
can get ownMedia
listAuthor
can remove ownMedia
-
User -> Post
Author
can create own draftPost
Author
can edit ownPost
Author
can attach an imageMedia
to ownPost
Author
can publish ownPost
Author
can get ownPost
Author
can get ownPost
listAuthor
can remove ownPost
Author
andGuest
can get publishedPost
Author
andGuest
can get list with publishedPosts
# Retrieve an authentication token and authenticate your Docker client to your registry.
$ aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 001179066666.dkr.ecr.us-east-1.amazonaws.com
# Build your Docker image using the following command.
$ docker build -t aws-deployment-nestjs-other-prod . --platform=linux/amd64
$ docker buildx build -t aws-deployment-nestjs-other-prod --platform=linux/amd64 .
$ docker run -p3005:3005 aws-deployment-nestjs-other-prod
# After the build completes, tag your image so you can push the image to this repository:
$ docker tag aws-deployment-nestjs-other-prod:latest 001179066666.dkr.ecr.us-east-1.amazonaws.com/aws-deployment-nestjs-other-prod:latest
# Run the following command to push this image to your newly created AWS repository:
$ docker push 001179066666.dkr.ecr.us-east-1.amazonaws.com/aws-deployment-nestjs-other-prod:latest
-
Docker
All necessary external services are described in the ./docker-compose.local.yml:
- Run
docker-compose -f docker-compose.local.yaml up -d
- Run
docker-compose -f docker-compose.local.yaml up --build
- Stop
docker-compose -f docker-compose.local.yaml stop
Services:
- PostgreSQL - Credentials.
- Minio - Credentials.
- Run
-
Building
- Install libraries -
npm install
- Build application -
npm run build
- Install libraries -
-
Configuring
Configuring is based on the environment variables. All environment variables must be exposed before starting the application. See all environment variables.
-
Running
-
Start application -
npm run start
-
Expose ./env/local.app.env and start application -
npm run start:local
-
-
Linting
npm run lint
-
Testing
- Prepare environment -
docker-compose -f docker-compose.test.yaml up -d
- Run tests -
npm run test
- Run tests with coverage -
npm run test:cov
- Prepare environment -
-
Libraries checking
- Show new libraries' versions -
npm run lib:check
- Upgrade libraries' versions -
npm run lib:upgrade
- Show new libraries' versions -
-
IDE
-
IntelliJ IDEA:
-
Visual Studio Code:
-