Before you begin, ensure you have met the following requirements:
cat .env.sample
nvm use
On Windows, you can use the following command:
nvm use $(Get-Content .nvmrc)
This ensures that the project uses the specified Node.js version.
pnpm install
This will install all the necessary dependencies for your project.
pnpm dev
This command will use nodemon to watch for changes and restart your application when changes are detected.
pnpm gen-types
This command will generate TypeScript types based on your Mongoose models.
pnpm gen-swagger
This command will generate Swagger documentation, accessible at http://localhost:{port}/api-docs/#/
pnpm gen-docs
This command will generate documentation using TypeDoc for the source code and save it in a "docs" folder.
pnpm build
This command will clean the build/
directory and compile your TypeScript code.
pnpm start
This command will start your application using the compiled code.
git clone https://github.com/prometheus-x/contract-manager.git
cd contract-manager
docker network create ptx
docker-compose up -d
docker-compose build
and restart with: docker-compose up -d
docker run -d -p your-port:your-port --name contract-manager contract-manager
after running docker-compose build
cd terraform
terraform init
terraform apply
terraform output contract_manager_service_ip
- Replace placeholder values in the
kubernetes_secret
resource with actual values from your.env
.- Ensure the
server_port
value matches the port used in your application.- Adjust the
host_path
in thekubernetes_persistent_volume
resource to an appropriate path on your Kubernetes nodes.
Install Helm: Ensure Helm is installed on your machine. You can install it following the instructions here.
Package the Helm chart:
helm package ./path/to/contract-manager
Deploy the Helm chart:
helm install contract-manager ./path/to/contract-manager
Verify the deployment:
kubectl get all -n contract-manager
Retrieve Service IP:
kubectl get svc -n contract-manager
- Replace placeholder values in the
values.yaml
file with actual values from your.env
.- Ensure the
server_port
value matches the port used in your application.- Configure your MongoDB connection details in the values.yaml file to point to your managed MongoDB instance.
pnpm test
This command will run your tests using Mocha. Make sure your tests are
located in ./src/tests/*.test.ts
.
This project is licensed under MIT License