Skip to content

Commit

Permalink
Merge pull request #2887 from buildcore-io/impr/readme
Browse files Browse the repository at this point in the history
Add run locally readme
  • Loading branch information
adamunchained authored Jun 7, 2024
2 parents d60c137 + e0fb369 commit ca5f76b
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,28 @@ The best way to get started with the SDK and interacting with Buildcore is [inst

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## Running it locally
Navigate to the root folder and build the entire projet by running
```sh
npm run build
```

Buildcore backend consist of 3 individually ran services.
1. Search API
This is a small express server that connects to the Postgres Database and exposes HTTP endpoints to query the data.
To run it navigate to `packages/search` folder, upate `.env.sample` with your DB connection params and run `npm run start`

2. Functions:
This is the main part of the backend. It is an express server that exposes several HTTP enpoints. One part of the enpoints are for users who wish to interrect with the backend. The other part of the endpoints are triggered by the Notifier once there is a change in the database. To run the Functions locally:
a) Navigate to `packages/functions`.
b) Upate `.env.sample` with your DB connection params
c) Run`npm run serve`. This will start the express server and it will run the Notifier locally.

3. Notifier:
The Notifier is responsible for listening to changes in the database. Every time there is a change, the Notifier calls the relevant endpoint sending the data before and after the update. Locally, the notifier calls the endpoint directly but if deployed from the `packages/notifier` folder, it posts the changes to Google pub/sub.

Currently some tests in Functions are still strongly dependent on Google Cloud Storage, so to run the full test suite, you will need a Google Cloud service account file.

<!-- CONTRIBUTING -->

## Contributing
Expand Down
17 changes: 17 additions & 0 deletions packages/functions/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ENVIRONMENT=test
PROJECT_ID=google-project-id
NFT_STORAGE_TOKEN=yourneftstoragetokne
JWT_SECRET=yourjwtsecret
ALGOLIA_APPID=your_algolia_app_id
ALGOLIA_KEY=your_algolia_key
ENCRYPTION_SALT=yout_encryption_salt
IP_INFO_TOKEN=your_ip_info_token
NEYNAR_API_KEY=your_neynary_key

DB_USER=db_user
DB_USER_PWD=db_pwd
DB_NAME=buildcore
DB_HOST=db-server-host
DB_PORT=5432

GOOGLE_APPLICATION_CREDENTIALS='path-to-your-credentials-file'
5 changes: 5 additions & 0 deletions packages/notifier/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
DB_USER=db_user
DB_USER_PWD=db_pwd
DB_NAME=buildcore
DB_HOST=db-server-host
DB_PORT=5432
6 changes: 6 additions & 0 deletions packages/search/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

DB_USER=db_user
DB_USER_PWD=db_pwd
DB_NAME=buildcore
DB_HOST=db-server-host
DB_PORT=5432

0 comments on commit ca5f76b

Please sign in to comment.