From a2ae5d62dea001d08bb5382cba29997b48701196 Mon Sep 17 00:00:00 2001 From: Zamil Majdy Date: Mon, 23 Sep 2024 16:21:37 -0500 Subject: [PATCH 1/3] fix(platform): Refresh doc setup instruction --- autogpt_platform/README.md | 49 +++++++++---- docs/content/server/setup.md | 138 +++++++++++++++-------------------- 2 files changed, 93 insertions(+), 94 deletions(-) diff --git a/autogpt_platform/README.md b/autogpt_platform/README.md index 4415ce1a3c6d..5cfaf6b98183 100644 --- a/autogpt_platform/README.md +++ b/autogpt_platform/README.md @@ -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 -3. Run the following command: +1. Clone this repository to your local machine and navigate to the `autogpt_platform` directory within the repository: ``` - git submodule update --init --recursive + git clone + cd AutoGPT/autogpt_platform ``` -4. Navigate back to autogpt_platform (cd ..) -5. Run the following command: + +2. Run the following command: ``` - cp supabase/docker/.env.example .env + git submodule update --init --recursive ``` -6. 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 + ``` + 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.combined.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. - 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: +6. Run the following command: ``` - cp .env.example .env.local + cp .env.example .env ``` -9. Run the following command: + 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: ``` - yarn dev + 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 + ``` + +8. Open your browser and navigate to `http://localhost:3000` to access the AutoGPT Platform frontend. ### Docker Compose Commands diff --git a/docs/content/server/setup.md b/docs/content/server/setup.md index cf850cfae2d7..4286c0cce516 100644 --- a/docs/content/server/setup.md +++ b/docs/content/server/setup.md @@ -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. -```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 appplication 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 +Backend API Rest Server: 8006 From 898f3c566fdd08991890ceb42ddb9be9020e5f83 Mon Sep 17 00:00:00 2001 From: Zamil Majdy Date: Tue, 24 Sep 2024 10:30:24 -0500 Subject: [PATCH 2/3] Address comments --- autogpt_platform/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogpt_platform/README.md b/autogpt_platform/README.md index 5cfaf6b98183..db642809323f 100644 --- a/autogpt_platform/README.md +++ b/autogpt_platform/README.md @@ -36,7 +36,7 @@ To run the AutoGPT Platform, follow these steps: ``` docker compose up -d ``` - This command will start all the necessary backend services defined in the `docker-compose.combined.yml` file in detached mode. + 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: ``` From 9d995cf098bc88c31288ce8063804c7c5b480f69 Mon Sep 17 00:00:00 2001 From: Zamil Majdy Date: Tue, 24 Sep 2024 10:31:38 -0500 Subject: [PATCH 3/3] Address comments --- docs/content/server/setup.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/server/setup.md b/docs/content/server/setup.md index 4286c0cce516..3a33fc781fc4 100644 --- a/docs/content/server/setup.md +++ b/docs/content/server/setup.md @@ -110,8 +110,8 @@ To run the frontend application, follow these steps: You can check if the server is running by visiting [http://localhost:3000](http://localhost:3000) in your browser. ### Notes: -By default the appplication for different services run on the following ports: +By default the application for different services run on the following ports: Frontend UI Server: 3000 Backend Websocket Server: 8001 -Backend API Rest Server: 8006 +Execution API Rest Server: 8006