- Make sure to create a
.env.devwith the following fields:
POSTGRES_USERPOSTGRES_PASSWORDPOSTGRES_DBDATABASE_URL
The DATABASE_URL field should reflect the values of the postgres credentials. Here are some sample values you can use for testing:
POSTGRES_USER="postgres"
POSTGRES_PASSWORD="postgres"
POSTGRES_DB="postgres"
DATABASE_URL="postgresql://postgres:postgres@postgres:5432/postgres?schema=public"
- Create an
env.tsfile in the root directory that has the following information:
export const env = {
port: 3000,
webserver: null,
GEMINI_API_KEY: 'YOUR GEMINI KEY',
};You can generate a Gemini API key for free here.
- Make sure Docker is installed and running.
- Run
docker compose -f docker-compose.dev.yml up --build - Visit http://localhost:3000/test to make sure the API is running
- Run
ngrok http 3000, noting the URL that's outputted. - In your Lens Studio project, make sure the base URL of the Sanctuary API scene object is set to the API url in the previous part.
- Every time you make a change to
prisma/schema.prisma, you must runnpx prisma generate. This ensures that our ORM client is up-to-date with our latest schema. - It also gives us some insane intellisense :)