Setting up the server
Introduction
This guide will help you setup the server and builder for the project.
We also offer this in video format. You can check it out here.
!!! 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:
Checking if you have Node.js and Python installed
You can check if you have Node.js installed by running the following command:
node -v
You can check if you have Python installed by running the following command:
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:
npm install -g yarn
- Installing Poetry
Poetry is a package manager for Python. You can install it by running the following command:
pip install poetry
Installing the dependencies
Once you have installed Yarn and Poetry, you can run the following command to install the dependencies:
cd rnd/autogpt_server
poetry install
In another terminal, run the following command to install the dependencies for the frontend:
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:
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:
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:
poetry run app
In the other terminal, you can run the following command to start the frontend:
yarn dev
Checking if the server is running
You can check if the server is running by visiting http://localhost:3000 in your browser.