Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

TechCell-Project/tech-cell-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

Project License Tech Cell Server CI/CD Build and test on pull request RESTful API Documentation Source Code Docs

πŸš€ Deployed

πŸ“– Description

This application is built using a microservices architecture with Nest and RabbitMQ. It includes the following features:

πŸ“¦ Installation

⚑ Require installed

⚠️ Attention:

  • Ubuntu or WSL (Windows subsystems for Linux) is recommended for both development and production
  • Windows is not recommended, can use in development not for production

πŸ“ Before start

  • Copy the .env.example and rename to .env.
  • Change the default values to your own.

🐳 With docker, docker-compose

πŸ”¨ Services

  • Core services:
    • Database
    • Message Broker
    • Reverse proxy
  • Application services (each folder in apps folder is a service):
    • api
    • auth
    • search
    • .etc..

Starting

First, you need to start the core services

yarn up:core # start core services

Then, you can start the application services

  • service_name - optional: is the name of the service you want to start, by default it will start all services
yarn up:prod <service_name> # start all services in production mode

Stopping

  • service_name - optional: is the name of the service you want to start, by default it will start all services
yarn down:prod <service_name>  # stop all services
# or
yarn down:core # stop core services

Restart and rebuild

  • service_name - optional: is the name of the service you want to start, by default it will start all services
yarn restart:prod <service_name> # restart and rebuild all services 
# or
yarn restart:core # restart and rebuild core services

Update the services

  • service_name - optional: is the name of the service you want to start, by default it will start all services
  • Update the services to the latest version from the docker registry
  • Make sure your github repository is up to date
git pull # update the repository

yarn update:prod <service_name> # update core services

🦽 With manual run

Required

  • Make sure all the following core services have been installed and run successfully
    • RabbitMQ: port 5672
    • Mongodb: port 27017, replica set mode
    • Redis: port 6379
  • Or you can run core services in docker and run app services manually
  • Or you can using cloud services like mongodb atlas, redis cloud, rabbitmq cloud

Starting

  • service_name - optional: is the name of the service you want to start, by default it is api service
# You can run core services in docker and run app services manually

yarn start <service_name> # start the service as normal mode
yarn start:dev <service_name> # start the service as development mode
yarn start:prod <service_name> # start the service as production mode

Stopping

# Just CTRL-C to stop the service

Use Docker

  • Check what is running on docker:
docker ps -a
  • Get the log of a container:
docker logs <CONTAINER_ID> # get logs

docker logs -f <CONTAINER_ID> # get logs realtime
# Remember to replace `<CONTAINER_ID>` with the actual ID of the container you want to inspect.
  • To remove all containers, volumes, and images that are not currently running, you can use the following commands:
docker container prune # remove all stopped containers
docker volume prune # remove all unused volumes
docker image prune # remove all unused images
# or just one
docker system prune -a # remove all stopped containers and unused volumes, images

🦽 License

Nest is MIT licensed.