Installation

Ensure you have the following installed on your machine:

  • Python >= 3.10

  • Node.js >= 16

  • Your favorite text editor (If you’re an Emacs hacker, you’ll feel right at home)

  • Basic understanding of OpenAPI, web development, and how GPT models work

Local Development

It’s highly recommended to use a virtual environment for local development to keep the dependencies required by different projects separate and to avoid potential conflicts. A virtual environment is a self-contained directory tree that contains a Python installation for a particular version of Python, plus a number of additional packages. This way, you can work on your project using its specific dependencies, without any interference with other projects or system libraries.

To create a virtual environment, follow these steps:

  1. Install virtualenv if you haven’t already:

$ pip install virtualenv
  1. Navigate to your project directory:

$ git clone https://github.com/sergeyklay/promptly.git
$ cd promptly
  1. Create a virtual environment in the project directory:

$ virtualenv venv
  1. Activate the virtual environment:

# On Unix or MacOS, use:
$ source venv/bin/activate

# On Windows use:
$ .\venv\Scripts\activate

Now you’re in the virtual environment, and you can install dependencies isolated from your global environment.

For more information on virtual environments, check out the official Python documentation.

Installing

Clone the repository and navigate to the project directory:

$ git clone https://github.com/sergeyklay/promptly.git
$ cd promptly

Install the necessary Python libraries:

$ make init
$ make install

Install the necessary JS libraries:

$ npm ci

Build JS bundle:

$ npm run build

Run database migrations:

$ make migrate

Optionally you can add seed (fake) data to the database:

$ make seed

Testing

Run Python unit tests with coverage:

$ make test

Run JS unit tests with coverage:

$ npm run test