Skip to content

Commit

Permalink
Merge pull request #80 from vintasoftware/docs/add-dev-setup
Browse files Browse the repository at this point in the history
Adds setup guide and .env.example file
  • Loading branch information
fjsj authored Jun 17, 2024
2 parents 9d0e4f3 + 6abc2a7 commit 73c7805
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
OPENAI_API_KEY=your-key-here
77 changes: 77 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,83 @@ Django app to integrate with [OpenAI Assistants API](https://platform.openai.com

⚠️ Under heavy development. Not launched yet!

## Dev Setup

### Clone the repo

`git clone [email protected]:vintasoftware/django-ai-assistant.git`

### Set up a virtualenv, optionally set up nvm, and activate your environment(s)

You can use [pyenv](https://github.com/pyenv/pyenv), [pipenv](https://github.com/pypa/pipenv/blob/main/docs/installation.md), vanilla venvs or the tool of your choice.

[NVM](https://github.com/nvm-sh/nvm)

### Install vite

`npm install -g vite` or install locally if you prefer

### Create a .env file at the root of the project

`cp .env.example .env`

To gather the API keys for these tools, head to the following links:
- [OpenAI](https://platform.openai.com/api-keys)
- [Weather](https://www.weatherapi.com/)
- [Tavily](https://app.tavily.com/home)
- [Firecrawl](https://www.firecrawl.dev/)

### Build the frontend

`cd frontend`

`vite build`

### Create a .env file at the example folder

`cd example`

`cp .env.example .env`

### Install dependencies

#### Backend

`cd example`

`poetry install`

Install pre-commit hooks:

`pre-commit install`

#### Frontend

`cd example`

`npm install`

### Run the project

From the example folder:

#### Frontend

`npm run start`

#### Backend

`python manage.py migrate`

`python manage.py createsuperuser`

`python manage.py runserver`

### Log in to Django Admin

Go to /admin and log in with your superuser account.


## Contributing

If you wish to contribute to this project, please first discuss the change you wish to make via an [issue](https://github.com/vintasoftware/django-react-boilerplate/issues).
Expand Down
6 changes: 6 additions & 0 deletions example/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
OPENAI_API_KEY=your-key-here
WEATHER_API_KEY=your-key-here
TAVILY_API_KEY=your-key-here
FIRECRAWL_API_KEY=your-key-here
LANGCHAIN_API_KEY=your-key-here
LANGCHAIN_TRACING_V2=True

0 comments on commit 73c7805

Please sign in to comment.