Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add quick start example #25

Merged
merged 5 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ dist-ssr
.cache
server/dist
public/dist
.idea
.idea
.yarn
.pnp.*js
41 changes: 41 additions & 0 deletions QuickStart.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Development Environment

Get a local development environment up and running with as few steps as possible.

## Required Variables

- **OPENAI_API_KEY:** [Get your GPT-4 OpenAI key](https://platform.openai.com/api-keys)

## Start

```shell
yarn set version classic
yarn install
yarn contracts:solo-up
yarn contracts:deploy:solo

PORT=3000 \
ORIGIN="*" \
OPENAI_API_KEY="sk-proj-.." \
ADMIN_MNEMONIC="denial kitchen pet squirrel other broom bar gas better priority spoil cross" \
NETWORK_URL=http://localhost:8669 \
REWARD_AMOUNT=1 \
yarn dev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like the idea of the quickstart! But

OPENAI_API_KEY="sk-proj-.." would configure the backend with a wrong API key

Users might mistake the steps as a copy and paste and everything will work.

Possible solution could be adding the "Result" section of the Quickstart below the Readme here:
image

```

## Result

Link | Service
--- | ---
http://localhost:8082 | Frontend
http://localhost:3000 | Backend
http://localhost:8081 | Inspector
http://localhost:8669 | Solo Thor

Deployed contracts documented in: [packages/config-contract/config.ts](packages/config-contract/config.ts)

## Shutdown

```shell
yarn contracts:solo-down
```
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ yarn contracts:deploy:solo
Once the deployment is completed successfully you can go ahead and start the frontend and backend:

> ⚠️ **Warning:**
> Remeber to set the OPENAI_API_KEY env variable in the backend .env.development.local file. Refer to the [Environment Variables](#environment-variables) section for more information.
> Remember to set the OPENAI_API_KEY env variable in the backend .env.development.local file. Refer to the [Environment Variables](#environment-variables) section for more information.

```bash
yarn dev
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import winstonDaily from 'winston-daily-rotate-file';
import { LOG_DIR } from '../config';

// logs dir
const logDir: string = join(__dirname, LOG_DIR);
const logDir: string = join(__dirname, LOG_DIR ?? '../logs');

if (!existsSync(logDir)) {
mkdirSync(logDir);
Expand Down
Loading