Skip to content

heroku-examples/luminaire-solar-api-demo

Luminaire Solar - API

Deploy

Requirements

Installation

Install pnpm

corepack install -g pnpm@latest

Note

If corepack is not installed you can run npm install -g corepack

Install dependencies by running:

Warning

Don't mix pnpm and npm, pnpm is more performant and have better cache

pnpm install

Create an Heroku application with:

heroku create <app-name>

Install the Heroku PostgreSQL addon:

 heroku addons:create heroku-postgresql:essential-0

Install the Heroku Key-Value Store addon:

heroku addons:create heroku-redis:mini

Once the PostgreSQL database is created, setup the database schema with:

node data/migration.js

Install the Heroku Inference addon

Note

Make sure the Heroku AI CLI plugin is installed with heroku plugins:install @heroku/plugin-ai

heroku ai:models:create claude-3-7-sonnet --as inference -a <app-name>

Make sure to fetch the configuration to your local project by running:

heroku config --shell > .env

Seed the database with mock data by running:

node data/seed.js

Run the project locally with:

pnpm run dev

Environment Variables

Before running the project, you need to set up the environment variables.

Note

For a complete list of required environment variables, please refer to the sample .env file included in the repository.

For JWT authentication you need a public/private key pair. You can generate these keys using OpenSSL by running:

openssl genpkey -algorithm RSA -out private.key -pkeyopt rsa_keygen_bits:2048
openssl rsa -pubout -in private.key -out public.key

These commands will create two files (private.key and public.key) in your repository with the values stored inside.

Manual Deployment

To manually deploy to Heroku you can run:

git push heroku main

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •