fix(platform): Refresh doc setup instruction (#8142)

This commit is contained in:
Zamil Majdy
2024-09-24 17:43:54 -05:00
committed by GitHub
parent 2b0ec123cd
commit 6da8007ce0
2 changed files with 100 additions and 101 deletions

View File

@@ -8,39 +8,60 @@ 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
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>
cd AutoGPT/autogpt_platform
```
2. Run the following command:
```
git submodule update --init --recursive
```
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:
```
git submodule update --init --recursive
cp supabase/docker/.env.example .env
```
4. Navigate back to autogpt_platform (cd ..)
5. Run the following command:
```
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.
7. Run the following command:
```
npm install
npm run dev
```
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 install && yarn dev
```
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:
```
cp .env.example .env.local
```
9. Run the following command:
```
yarn dev
```
8. Open your browser and navigate to `http://localhost:3000` to access the AutoGPT Platform frontend.
### Docker Compose Commands

View File

@@ -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.
If you need assistance installing Node.js:
https://nodejs.org/en/download/
NPM is included with Node.js, but if you need assistance installing NPM:
https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
You can check if you have Node.js & NPM installed by running the following command:
```bash
node -v
npm -v
```
You can check if you have Python installed by running the following command:
Once you have Node.js installed, you can proceed to the next step.
```bash
python --version
```
Once you have node and python installed, you can proceed to the next step.
### Installing the package managers
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:
```bash
npm install -g yarn
```
- Installing Poetry
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:
Docker-compose is included in Docker Desktop, but if you need assistance installing docker compose:
https://docs.docker.com/compose/install/
### Installing the dependencies
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.
```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:
* Run the following command:
```
npm install
npm run dev
```
This command will install the necessary dependencies and start the frontend application in development mode.
```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
```
### 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