Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(platform): Refresh doc setup instruction #8142

Merged
49 changes: 35 additions & 14 deletions autogpt_platform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,61 @@ Welcome to the AutoGPT Platform - a powerful system for creating and running AI

- Docker
- Docker Compose V2 (comes with Docker Desktop, or can be installed separately)
- Node.js & NPM (for running the frontend application)

### Running the System

To run the AutoGPT Platform, follow these steps:

1. Clone this repository to your local machine.
2. Navigate to autogpt_platform/supabase
3. Run the following command:
1. Clone this repository to your local machine and navigate to the `autogpt_platform` directory within the repository:
```
git clone <https://github.com/Significant-Gravitas/AutoGPT.git | git@github.com:Significant-Gravitas/AutoGPT.git>
majdyz marked this conversation as resolved.
Show resolved Hide resolved
cd AutoGPT/autogpt_platform
```

2. Run the following command:
```
git submodule update --init --recursive
git submodule update --init --recursive
```
4. Navigate back to autogpt_platform (cd ..)
5. Run the following command:
This command will initialize and update the submodules in the repository. The `supabase` folder will be cloned to the root directory.

3. Run the following command:
```
cp supabase/docker/.env.example .env
cp supabase/docker/.env.example .env
```
6. Run the following command:
This command will copy the `.env.example` file to `.env` in the `supabase/docker` directory. You can modify the `.env` file to add your own environment variables.

4. Run the following command:
```
docker compose up -d
```
This command will start all the necessary backend services defined in the `docker-compose.yml` file in detached mode.

5. Navigate to `frontend` within the `autogpt_platform` directory:
```
cd frontend
```
You will need to run your frontend application separately on your local machine.

6. Run the following command:
```
cp .env.example .env
```
This command will copy the `.env.example` file to `.env` in the `frontend` directory. You can modify the `.env` within this folder to add your own environment variables for the frontend application.

This command will start all the necessary backend services defined in the `docker-compose.combined.yml` file in detached mode.
7. Navigate to autogpt_platform/frontend.
8. Run the following command:
7. Run the following command:
```
cp .env.example .env.local
npm install
npm run dev
```
9. Run the following command:
This command will install the necessary dependencies and start the frontend application in development mode.
If you are using Yarn, you can run the following commands instead:
```
yarn dev
yarn install && yarn dev
```

8. Open your browser and navigate to `http://localhost:3000` to access the AutoGPT Platform frontend.

### Docker Compose Commands

Here are some useful Docker Compose commands for managing your AutoGPT Platform:
Expand Down
138 changes: 58 additions & 80 deletions docs/content/server/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,121 +19,99 @@ We also offer this in video format. You can check it out [here](https://github.c
To setup the server, you need to have the following installed:

- [Node.js](https://nodejs.org/en/)
- [Python 3.10](https://www.python.org/downloads/)
- [Docker](https://docs.docker.com/get-docker/)

### Checking if you have Node.js and Python installed
### Checking if you have Node.js & NPM installed

You can check if you have Node.js installed by running the following command:
We use Node.js to run our frontend application.

```bash
node -v
```

You can check if you have Python installed by running the following command:

```bash
python --version
```

Once you have node and python installed, you can proceed to the next step.
If you need assistance installing Node.js:
https://nodejs.org/en/download/

### Installing the package managers
NPM is included with Node.js, but if you need assistance installing NPM:
https://docs.npmjs.com/downloading-and-installing-node-js-and-npm

In order to install the dependencies, you need to have the appropriate package managers installed.

- Installing Yarn

Yarn is a package manager for Node.js. You can install it by running the following command:
You can check if you have Node.js & NPM installed by running the following command:

```bash
npm install -g yarn
node -v
npm -v
```

- Installing Poetry
Once you have Node.js installed, you can proceed to the next step.

Poetry is a package manager for Python. You can install it by running the following command:

```bash
pip install poetry
```
- Installing Docker and Docker Compose
### Checking if you have Docker & Docker Compose installed

Docker containerizes applications, while Docker Compose orchestrates multi-container Docker applications.

You can follow the steps here:

If you need assistance installing docker:
https://docs.docker.com/desktop/
If you need assistance installing docker compose:
https://docs.docker.com/compose/install/

### Installing the dependencies
Docker-compose is included in Docker Desktop, but if you need assistance installing docker compose:
https://docs.docker.com/compose/install/

Once you have installed Yarn and Poetry, you can run the following command to install the dependencies:
You can check if you have Docker installed by running the following command:

```bash
cd autogpt_platform/backend
cp .env.example .env
poetry install
docker -v
docker-compose -v
```

**In another terminal**, run the following command to install the dependencies for the frontend:
Once you have Docker and Docker Compose installed, you can proceed to the next step.

```bash
cd autogpt_platform/frontend
yarn install
```
## Running the backend services

Once you have installed the dependencies, you can proceed to the next step.
To run the backend services, follow these steps:

### Setting up the database
* Within the repository, clone the submodules and navigate to the `autogpt_platform` directory:
```bash
git submodule update --init --recursive
cd autogpt_platform
```
This command will initialize and update the submodules in the repository. The `supabase` folder will be cloned to the root directory.

In order to setup the database, you need to run the following commands, in the same terminal you ran the `poetry install` command:
* Copy the `.env.example` file available in the `supabase/docker` directory to `.env` in `autogpt_platform`:
```
cp supabase/docker/.env.example .env
```
This command will copy the `.env.example` file to `.env` in the `supabase/docker` directory. You can modify the `.env` file to add your own environment variables.

```sh
docker compose up postgres redis -d
poetry run prisma migrate dev
```
After deploying the migration, to ensure that the database schema is correctly mapped to your codebase, allowing the application to interact with the database properly, you need to generate the Prisma database model:
* Run the backend services:
```
docker compose up -d
```
This command will start all the necessary backend services defined in the `docker-compose.combined.yml` file in detached mode.
majdyz marked this conversation as resolved.
Show resolved Hide resolved

```bash
poetry run prisma generate
```

Without running this command, the necessary Python modules (prisma.models) won't be available, leading to a `ModuleNotFoundError`.
## Running the frontend application

### Get access to Supabase
To run the frontend application, follow these steps:

Navigate to rnd/supabase
Run the following command:
* Navigate to `frontend` folder within the `autogpt_platform` directory:
```
cd frontend
```

```bash
git submodule update --init --recursive
```
### Running the server
* Copy the `.env.example` file available in the `frontend` directory to `.env` in the same directory:
```
cp .env.example .env
```
You can modify the `.env` within this folder to add your own environment variables for the frontend application.

To run the server, navigate back to rnd (cd..) and run the following commands in the same terminal you ran the `poetry install` command:

```bash
cp supabase/docker/.env.example .env
docker compose build
docker compose up -d
```

In the other terminal from frontend, you can run the following command to start the frontend:

```bash
cp .env.example .env
yarn dev
```
* Run the following command:
```
npm install
npm run dev
```
This command will install the necessary dependencies and start the frontend application in development mode.

### Checking if the server is running
## Checking if the application is running

You can check if the server is running by visiting [http://localhost:3000](http://localhost:3000) in your browser.

### Notes:
By default the daemons for different services run on the following ports:
By default the application for different services run on the following ports:

Execution Manager Daemon: 8002
Execution Scheduler Daemon: 8003
Rest Server Daemon: 8004
Frontend UI Server: 3000
Backend Websocket Server: 8001
Execution API Rest Server: 8006
Loading