Skip to content

A really simple CRUD GraphQL API based on Docker and TypeScript.

License

Notifications You must be signed in to change notification settings

joseesco24/users_crud_api_typescript

Repository files navigation

Users Crud Api TypeScript

A really simple CRUD GraphQL API based on Docker and TypeScript.

Note: In develop mode and running locally the docs are available at this url


Project Commands

Note: Before running any of these commands be sure that your CWD is users_crud_api_typescript directory.

Clean TypeScript Test Files Using Grep

RUN find . | grep -E "(/.spec.ts$|/.spec.js$)" | xargs rm -rf

Install All TypeScript Dependencies

npm install

Update The Depedencies With Ncu

Note: Before running this command you need to install the dev dependencies.

ncu -u

Format The Code Using Prettier

Note: Before running this command you need to install the dev dependencies.

npm run format

Lint The Code Using EsLinter

Note: Before running this command you need to install the dev dependencies.

npm run lint

Run On Development Mode

ENVIRONMENT_MODE=development node dist/main.js

Run On Testing Mode

ENVIRONMENT_MODE=testing node dist/main.js

Run On Production Mode

ENVIRONMENT_MODE=production node dist/main.js

Docker Project Commands

Note: Before running any of these commands be sure that your CWD is users_crud_api_typescript directory.

Docker App Building Without Cache

docker build --no-cache --tag ghcr.io/joseesco24/users_crud_api_typescript:latest .

Docker App Building With Cache

docker build --tag ghcr.io/joseesco24/users_crud_api_typescript:latest .

Docker App Deployment Without Detach

docker run --rm --name users_crud_api_typescript_app --publish 10046:10046 --env-file ./.env --env ENVIRONMENT_MODE=production ghcr.io/joseesco24/users_crud_api_typescript:latest

Docker App Deployment With Detach

docker run --detach --rm --name users_crud_api_typescript_app --publish 10046:10046 --env-file ./.env --env ENVIRONMENT_MODE=production ghcr.io/joseesco24/users_crud_api_typescript:latest

Docker Access To The Container Terminal

docker exec -it users_crud_api_typescript_app /bin/ash

Docker Killing Containerized App

docker kill users_crud_api_typescript_app

Docker Login Into Github Container Registry

docker login -u joseesco24 -p < authentication token > ghcr.io

Docker Push The Image To Github Container Registry

docker push ghcr.io/joseesco24/users_crud_api_typescript:latest

Docker Pull The Image From Github Container Registry

docker pull ghcr.io/joseesco24/users_crud_api_typescript:latest

Docker Compose Project Commands

Note: Before running any of these commands be sure that your CWD is users_crud_api_typescript directory.

Docker Compose Build Image Using Compose File

docker-compose -f compose.build.yaml build

Docker Compose Start Dbs Services Using Compose File

docker-compose -f compose.databases.yaml up

Docker Compose Stop Dbs Services Using Compose File

docker-compose -f compose.databases.yaml down

Docker Compose Start Project Using Compose File

docker-compose -f compose.project.yaml up

Docker Compose Stop Project Using Compose File

docker-compose -f compose.project.yaml down