Part 6 of 10
Deploy Your App
Install VS Code and Elements, build a todos app by asking an AI agent, and deploy the app to DigitalOcean. Then tour the project environment, the elements command, the website and the business.
- 1. Introduction 0:18
- 2. Install VS Code 3:30
- 3. Install Elements 1:27
- 4. Create Your First App 5:26
- 5. Set Up a Deployment Environment on DigitalOcean 4:49
- 6. Deploy Your App 3:11
- 7. The Project Environment 2:32
- 8. The Elements Tooling 6:07
- 9. The Elements Website and Community 2:48
- 10. The Elements Business 1:27
In this video we paste the droplet's addresses and the database's connection details into the agent, answer its questions, and deploy the todos app to a live site with HTTPS. Then we look at deploying again.
1. Paste the details into the agent
In the chat, write a prompt like this one, followed by the droplet's public and private IP addresses and the database's connection details:
Agent PromptDeploy my application to DigitalOcean.
If you would rather not paste them, ask the agent how to enter them by hand. It shows you which file to update and which fields to fill in.
2. Answer the agent's questions
The agent writes the deployment settings to config.jsoc, then runs the first deployment. It may ask you a few things:
- The user. On DigitalOcean, deploy as
root. - The SSH key. Use the key you selected when you created the droplet.
- A domain. We use
demo.elements.dev. If you don't have a domain, leave it blank and use the droplet's IP address. - Whether to proceed. Say yes.
Your agent might not ask anything, and that is fine. The agent adds the configuration, then asks Elements to run the deployment.
3. The first deploy completes
The first deployment takes just under a minute, and the agent reports that the site is up.
4. The live site
Open your domain in a browser. Ours opens on the app's sign in page, with load balancing set up and HTTPS certificates in place.
Without a domain, open the droplet's public IP address instead. Traffic between the browser and the server is not encrypted until you add a domain.
5. Deploy again
The machine is set up now, so later deploys usually take half a second to three seconds. Ask the agent to deploy when you finish a feature, or ask the agent to deploy after every change it makes. If something looks wrong on the live site, ask the agent to fix it and deploy again.
6. Releases
A deploy goes live as a release only when every build step passes. A type error, a program analysis or security error, a failed database migration or a failing test blocks the release, and the previous release keeps running.
Connected browsers reload with the new release automatically, so your users see it within a few seconds of the deploy.
Add a comment