As developers, what are the things that give us the most headaches? It has to be the tedious work of environment configuration, version control, and various deployment configurations and so on.
Imagine if you could have a fully configured development environment with support for every major technology stack from Java to Python, from React to Vue in just a few mouse clicks.
And you can automatically assign domain names and HTTPS certificates, eliminating the tedious configuration process and allowing you to focus on the code itself.And after writing the code can be deployed to the production environment, do not have to write any Dockerfile, do not have to write any K8s orchestration file, do not need to write anything, directly on the line, that would be how cool?
Sealos Devbox does indeed fulfill all of these visions, and it has a very wide range of applications:
- Microservice Development: Help developers quickly build and manage multiple microservices development environments for debugging and testing.
- Web Development: Help Web developers quickly set up front-end and back-end development environments, and automatically configure domain names and HTTPS certificates for developers to develop and deploy.
- Remote teamwork: Helps remote team members share development environments and improve team collaboration.
- Secondary development of open source applications: Helps developers quickly set up development environments for open source applications and perform secondary development and customization, for example, you can use Devbox to quickly set up theWordPress development environment and modify its themes and plugins.
- Teaching and training: Helps teachers quickly create unified teaching environments for students to practice and experiment, for example, teachers can use Devbox to createPython development environment for programming.
I'm going toAn example of how to get started quickly with Devbox is to create a Gin framework project.
Getting Started with Devbox
1. Create the Gin framework project
first enterSealos Desktop, then open the Debox application and create a new project. devbox supports many major languages and frameworks, here we choose to experience the Gin framework:
CPU and RAM can be adjusted according to your needs, and choosing a lower configuration will save you money. Network configuration does not need to be changed, the system will automatically assign an HTTPS domain name through which you can access port 8080 in Devbox.
Select the framework and click Create to launch the development environment in a few seconds.
2. Using Cursor to connect to the development environment
Select Use Cursor Connection in the Action Options:
When you open it for the first time, you will be prompted to install the Devbox plugin, which will automatically connect you to the development environment.
Isn't it very simple?Directly omit the configuration of domain name resolution, apply for SSL certificates, configure the gateway and other non-development-related tedious operation, cool!
3. Compile and run the project
Open a terminal and type directlygo run
Start the project. The service can then be accessed through the previously assigned domain name.
4. Writing code with Cursor
For example, we can use Cursor to write a code that proxies to OpenAI.
The snap is written. Since we can't access OpenAI at home, we can change the URL toFastGPT's address。
Exit the previously running process in the Cursor terminal and type againgo run
Start the application and test it with the assigned HTTPS domain name:
It can also be tested using the command line:
curl --location --request POST '/api/v1/chat/completions' \
--header 'Authorization: Bearer fastgpt-tfW22BXI20dLBj3jG9KYtkGw3NpkE5Tzq9zSEnYZ3d0PLvM400ZACErbuNf' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gpt-4o",
"messages": [
{
"role": "user",
"content": "How are you?"
}
]
}'
Deployment to production environments
After the code test is completed, it can be deployed to the production environment, and after the deployment is completed, it can be automatically updated and fault self-recovery, which improves the operation and maintenance efficiency and system stability.
The first step is to use the command in the Cursor terminalgo build
Compile the source code into a binary file.
Then click Details in Actions in the Devbox list, click Release Version in History, fill in the information and click Send.
Note: Release will stop Devbox temporarily, after release it will start automatically, please save the project first to avoid losing data.
Wait a moment, you can find the release information in the version list, click on the online will jump to the deployment page, click on the deployment application can be deployed to the production environment.
The HTTPS domain name assigned to the production environment is independent of the development environment, and the service can be accessed through the production environment domain name after deployment.
Tested using a production environment domain name:
concluding remarks
Devbox provides developers with a brand new development experience with its extreme speed, convenience and low cost. It simplifies the development process, improves development efficiency, and solves the problems of consistency between development and production environments, allowing developers to focus more on code creation. If you are looking for an efficient and easy-to-use cloud development tool, Devbox is definitely the right choice for you!
Experience Devbox today and start your journey to blazing-fast cloud development!