CronJob in express where we use Clean Code & Hexagonal Architecture, also uses Dependency Injection to use multiple databases such as PostgreSQL(PrismaORM), MongoDB(MONGOOSE), and Local with FileSystem to store the logs, email service to send the logs with high-level urgent
- Clone file .env.template a .env
- Config environment variable
PORT=
PROD=
MAIL_EMAIL=
MAIL_SECRET_KEY=
MAIL_SERVICE=
# MONGO DB
MONGO_URI=mongodb://<USER>:<PASSWORD>@<IPHOST>:<PORT>/?authMechanism=DEFAULT
MONGO_DB_NAME=NOC
MONGO_USER=alumnno
MONGO_PASS=123456
# POSTGRES DB
POSTGRES_URL=
POSTGRES_USER=alumno
POSTGRES_PASS=123456
POSTGRES_DB=NOC
3.Run
yarn install or yarn
4.Up container for database
docker-compose up -d
5.Execute prisma create database in postgres
npx prisma migrate dev
6.Run server
yarn dev