Skip to content

Latest commit

 

History

History
 
 

photography-site-demo.js

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

photography-site

This sample app demonstrates a photography site by using express, mongoose and stargate-mongoose.

Environment

cassandra backend

Make sure you have Cassandra support

If want to run cassandra locally, you need to have a local Stargate instance(DSE-Next) and JSON API running as described on the main page of this repo.

If want to run against AstraDB, please go to AstraDB create your database and keyspace 'photography' .

python and google-mediapipe

Make sure you have a local python (3.8 - 3.11) environment
install google-mediapipe pip install mediapipe

node

Make sure you have Node.js 17 or higher

.env

Setting up .env file to run against AstraDB

  1. Copy the .env.example file to .env and fill in the values for the environment variables.
  2. Set IS_ASTRA to true
  3. Set OPENAI_API_KEY to your openAI api key
  4. Set ASTRA_DBID to your AstraDB database ID
  5. Set ASTRA_REGION to your AstraDB database region
  6. Set ASTRA_KEYSPACE to your AstraDB keyspace
  7. Set ASTRA_APPLICATION_TOKEN to your AstraDB application token

Setting up .env file to run against self-hosted DB

  1. Copy the .env.example file to .env and fill in the values for the environment variables.
  2. Set IS_ASTRA to false
  3. Set OPENAI_API_KEY to your openAI api key
  4. Set JSON_API_URL to http://127.0.0.1:8181/v1/photography
  5. Set JSON_API_AUTH_URL to http://127.0.0.1:8181/v1/auth
  6. Set JSON_API_AUTH_USERNAME to cassandra
  7. Set JSON_API_AUTH_PASSWORD to cassandra

Running This Sample

  1. Run npm install
  2. Run npm run seed
  3. Run npm start
  4. Visit http://127.0.0.1:3000 to see the UI