Skip to content

Latest commit

 

History

History
42 lines (38 loc) · 1.41 KB

README.md

File metadata and controls

42 lines (38 loc) · 1.41 KB

magic-brain-app-api - v1

  1. Clone this repo
  2. Run npm install
  3. Run nodemon server.js

Create a .env on your local. Use these environmental variables in your .env from the .env.example file or just change the values in the .env file to be what you want and then source ./.env to get the variables.

API_CLARIFAI= 'Key + yourApiKeyHere'
DATABASE_URL= 'yourDatabaseUrl'
DATABASE_HOST= 'yourDatabaseHost'
DATABASE_USER= 'yourDatabaseUser'
DATABASE_PW= 'yourDatabasePassword'
DATABASE_DB= 'yourDatabaseName'
PORT= 5432

The ORM for the application is Knex.js. For now please use the following schema to setup a PostgreSQL database for the application to run locally.

Users:

CREATE TABLE users (
	ID serial PRIMARY KEY,
	name VARCHAR (100) NOT NULL,
	email text UNIQUE NOT NULL,
	entries bigint DEFAULT 0,
	joined timestamp NOT NULL
);

Login:

CREATE TABLE login (
	ID serial PRIMARY KEY,
	hash VARCHAR (100) NOT NULL,
	email text UNIQUE NOT NULL
);