1.0.1 • Published 4 years ago
host-panel v1.0.1
HostPanel
Folder Structure:
- DDD Folder structure , Every folder has to contain every thing it needs , if there is a common utility that is needed move it to common.
- Every Component in the DDD has 3 core files
- API - Contains only routings handlers
- Controller - Prepper data and call service method.
- Service - Buisness logic
.env
When running locally, Create this file at the root folder with this properties instead of adding it to the run command:
# .env
NODE_ENV = development/prod
ANALYTICS_DB_CONNECTION_STRING = ''
ANALYTICS_DB_HOST = ''
ANALYTICS_DB_PASSWORD = ''
ANALYTICS_DB_USER = ''
ANALYTICS_DB = ''
ANALYTICS_DB_PORT =
REDIS_URL = ''
REDIS_DB_NAME = ''
REDIS_Q_NAME = ''
SERVICE_NAME = ''
DEBUG=knex:query - For debugging queries on db
Every one who runs the service should fill hes own .env , and should not upload it to the Github !
Debug and running locally
First run Npm Install
Its possible to run it on VsCode with a debugger options,
create in the root folder .vscode
folder if its not created already and
add to it a launch.json
file.
Inside the file put this options :
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug TypeScript in Node.js",
"preLaunchTask": "tsc: build - tsconfig.json",
"program": "${workspaceFolder}/src/App.ts",
"cwd": "${workspaceFolder}",
"protocol": "inspector",
"outputCapture": "std",
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
"envFile": "${workspaceFolder}/.env"
}
]
}
Running on Docker Compose
In addition once you update the .env
file you can just docker-compose -f "docker-compose.yml" up -d --build
or just on .vs code right click on the docker-compose.yml and choose up
1.0.1
4 years ago