The CloudVision Vultr Hackathon API provides tools for managing infrastructure, tracking costs, and analyzing cloud resources. This project includes several services for interacting with the Vultr cloud platform, and utilizes Terraform for infrastructure automation.
- Infrastructure Management: Manage cloud infrastructure with automated setup, update, and teardown operations.
- Cost Tracking: Monitor and analyze the cost of running infrastructure.
- Resource Extraction: Extract detailed cloud resource information.
- Modular Services: Built with a microservices approach for scalability.
-
Clone the Repository
git clone https://github.com/username/cloudvision-vultr-hackathon-api.git cd cloudvision-vultr-hackathon-api -
Install dependencies:
cd your-project bun install --production -
Start the application:
bun start
To run this project, you will need to add the following environment variables to your .env file
DATABASE_URL= 'your_postgres_url'
DIRECT_URL='direct_url_for_db_migration'
VULTR_HOST_NAME='vultr host name'
VULTR_SECRET_ACCESS_KEY='your_secret_access_key'
VULTR_DIAGRAM_BUCKET_NAME='your_bucket_name'
AWS_ACCESS_KEY='your_access_key'
AWS_SECRET_ACCESS_KEY='your_secret_access_key'
VULTR_API_KEY='vultr_api_key'
GENERATE_CODE_ARN='ecs_task_arn'
INFRA_BUILD_ARN='ecs_task_arn'
VULTR_INFERENCE_KEY='your_vultr_inference_key'
REDIS_URL='your_redis_db_url'
POST api/v1/upload/diagram| Parameter | Type | Description |
|---|---|---|
Headers |
Authorization | Required. Bearer token |
file |
Multipart form-data containing files. | Required. Image file |
username |
string | Required. user name |
{
"success": true,
"msg": "File uploaded Successfully",
"data": {
"dbDiagram": {
"id": "diagram id",
"userID": "userid",
"userId": null,
"uploadAt": "date",
"url": "url",
"status": "PROCESSING",
"terraformID": null
}
}
} POST api/v1/chatbot/completion| Parameter | Type | Description |
|---|---|---|
Headers |
Authorization | Required. Bearer vultr inference token |
userMessage |
string | Required. Image file |
{
"userMessage":"what is vultr"
}{
"success": true,
"msg": "message from Chatbot",
"data": "Vultr is a cloud computing platform that provides on-demand virtual servers, also known as VPS (Virtual Private Servers), in multiple locations around the world. It allows users to quickly and easily deploy their own computing environments with root access and full control over the operating system and software installed."
} POST /api/v1/infra/create| Parameter | Type | Description |
|---|---|---|
Headers |
Authorization | Required. Bearer token |
diagramID |
string | Required. Image file |
{
"diagramID":"86bc9a12-6d0a-4eed-917e-686ccede55c7"
} GET /api/v1/infra/allno need of request parameter
{
"success": true,
"msg": "Infrastucture fetched successfully",
"data": {
"blockStorage": {
"blocks": [],
"meta": {
"total": 0,
"links": {
"next": "",
"prev": ""
}
}
},
"instances": {
"instances": [],
"meta": {
"total": 0,
"links": {
"next": "",
"prev": ""
}
}
},
"db": {
"databases": [],
"meta": {
"total": 0
}
}
}
}
The project uses several services to encapsulate core logic:
-
Cost Service (services/cost.service.ts): Handles cost estimation logic for infrastructure resources.
-
Infra Service (services/infra.service.ts): Manages infrastructure operations, including creation, fetching details, and deletion.
-
Upload Service (services/upload.service.ts): Handles file storage operations with S3.
-
User Service (services/user.service.ts): Manages user authentication and other user-related operations.
Client: Next.js , TailwindCSS, Shadcn liberary
Server: Typescript , Bun , Hono , Vultr services, Aws services