File size: 2,838 Bytes
b225a21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# Setting up the server

- [Introduction](#introduction)
- [Prerequisites](#prerequisites)

## Introduction

This guide will help you setup the server and builder for the project.

<!-- The video is listed in the root Readme.md of the repo -->

We also offer this in video format. You can check it out [here](https://github.com/Significant-Gravitas/AutoGPT#how-to-get-started).

!!! warning
    **DO NOT FOLLOW ANY OUTSIDE TUTORIALS AS THEY WILL LIKELY BE OUT OF DATE**

## Prerequisites

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/)

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

You can check if you have Node.js installed by running the following command:

```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.

### 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 the dependencies

Once you have installed Yarn and Poetry, you can run the following command to install the dependencies:

```bash
cd rnd/autogpt_server
poetry install
```

**In another terminal**, run the following command to install the dependencies for the frontend:

```bash
cd rnd/autogpt_builder
yarn install
```

Once you have installed the dependencies, you can proceed to the next step.

### Setting up the database

In order to setup the database, you need to run the following command, in the same terminal you ran the `poetry install` command:

```bash
poetry run prisma migrate deploy
```
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:

```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 server

To run the server, you can run the following command in the same terminal you ran the `poetry install` command:

```bash
poetry run app
```

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

```bash
yarn dev
```

### Checking if the server is running

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