Follow these steps to set up and run the Penpot Copilot REST API on your local machine:
-
Install Prerequisites
- Ensure Git and Node.js are installed on your system.
-
Clone the Repository
- Clone this repository to your local machine using:
git clone https://github.com/CijeTheCreator/penpot-copilot-backend
- Clone this repository to your local machine using:
-
Configure Environment Variables
-
In the root folder, create a
.env
file. Add the following variables:OPENAI_KEY
: Your OpenAI API key.PENPOT_DATABASE_URL
: The PostgreSQL connection string for your Penpot database.
Example
.env
file:OPENAI_KEY=your_openai_key PENPOT_DATABASE_URL=your_postgres_url
-
-
Set Up the Database
- Use Prisma to initialize the database schema:
npx prisma db push
- Use Prisma to initialize the database schema:
-
Install Dependencies and Start the Server
- Install the required packages and run the development server:
npm install && npm run dev
- Install the required packages and run the development server:
-
Connect the Frontend
- Copy the API's base address (e.g.,
http://localhost:3000
) and set it in your frontend's.env
file under theADDRESS
variable.
- Copy the API's base address (e.g.,