-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Developing locally verses in the cloud with Pythagora
When you start using Pythagora, you'll be prompted to choose between developing your application locally or in the cloud. This guide explains both options, their workflows, and how to manage your development environment.
Local development means building and running your application directly on your computer. Here’s what to expect:
- Traditional Approach: Local development has been Pythagora’s default method until recently.
- Dependencies: You'll need to install MongoDB, Python, Node.js, and other dependencies on your machine.
-
File Storage: All Pythagora core files and your application will be stored locally in a directory you specify.
- To set this up, go to Pythagora's Settings page. Under
GPT Pilot path
, clickChange
and select a new, empty directory. This will house all of Pythagora's Core files and your projects.
- To set this up, go to Pythagora's Settings page. Under
Cloud development allows Pythagora to handle everything for you in a managed environment:
- Hassle-Free Setup: Only the Pythagora VS Code extension is required. No need to install MongoDB, Python, or Node.js locally.
- Cloud-Managed: All packages, dependencies, and your application are built and managed by Pythagora in the cloud.
- Convenience: Ideal for those who want a quick, streamlined setup without configuring local environments.
Note: In cloud development mode, you don't need to set GPT Pilot path
as it will be set to the cloud by default and will look like this in Pythagora's settings:
- When developing locally, all files are stored in the directory specified under
GPT Pilot path
in the Pythagora settings. - File hierarchy:
- The main folder:
pythagora-core
- Within
pythagora-core
, a subfolder calledworkspace
contains your projects:
- The main folder:
click to see this gif in a larger window
- When developing in the cloud, all files are managed by Pythagora’s cloud infrastructure.
- To access them:
- With the Cloud running, open a terminal in VS Code and you will be connected to your instance of Pythagora in the cloud.
- Use command-line commands to navigate the directory structure.
- Your applications will be stored in the directory
pythagora/pythagora-core/workspace
.
click to see this gif in a larger window
Switching between local and cloud development is simple:
-
Switch to Cloud: Go to Pythagora's Settings page and click
Use Pythagora on cloud
. -
Switch to Local: Go to the Settings page and click
Use Pythagora locally
.
When building an application with Pythagora, MongoDB is used to manage application data. Database handling varies based on your development setup:
- By default, you can run MongoDB directly on your machine and access it via the command line.
- Alternatively, you can use MongoDB Atlas to host your database in the cloud (separate from Pythagora's cloud).
- Pythagora will prompt you to provide your MongoDB database URL during development. This can also be updated in your application's
.env
file.
- Pythagora manages a MongoDB instance in Pythagora's cloud by default.
- Access the database via VS Code’s terminal using the command
mongosh
. - You can also modify your application's
.env
file to point to:- A MongoDB instance on your local machine.
- A MongoDB Atlas database you manage in the cloud (separate from Pythagora's cloud).
Feature | Local Development | Cloud Development |
---|---|---|
Setup | Requires installation of dependencies. | Requires only the VS Code extension. |
File Storage | On your local machine. | Managed in Pythagora’s cloud. |
Database Options | Local MongoDB or MongoDB Atlas. | Pythagora-managed MongoDB (default) or custom URL. |
Best For | Advanced users comfortable with setups. | Users seeking quick and hassle-free environments. |
If you have any questions, feel free to reach out to us on Discord or check our FAQ.