Skip to content

blackphoenix42/Smart-Brain-Server

Repository files navigation

LOGO

Smart Brain

Join official Discord Server for discussion.

forthebadge forthebadge forthebadge

📃About

An app that uses Clarifai Api to detect the face in an image from an URL. Backend and Frontend are hosted on Heroku.

🌱 Quick Start

  • Star🌟 and Fork this repository

  • Clone this repository remotely.

git clone https://github.com/blackphoenix42/Smart-Brain-Server.git

🕹Setup on your local machine

  • Install the dependencies
npm install
  • Download and install PostgreSQL🐘

  • Create database smart-brain or any of your choice.

  • Create following tables:

Login:

CREATE TABLE login(
	id serial PRIMARY KEY,
	hash varchar(100) NOT NULL,
	email text UNIQUE NOT NULL
)

Users:

CREATE TABLE users(
	id serial PRIMARY KEY,
	name VARCHAR(100),
	email text UNIQUE NOT NULL,
	entries BIGINT DEFAULT 0,
	joined TIMESTAMP NOT NULL
)
  • In ./server.js file update the following:
const db = require("knex")({
  client: "pg",
  connection: {
    host: "127.0.0.1",
    user: "postgres",
    password: "test123", //Whatever Password You set in Postgres
    database: "smart-brain", // Name of Your Database
  },
});
  • Now go to Clarifai and sign up. You will be provided with a default my-first-application. Copy its API KEY.

  • Now go to ./controllers/image.js and change the following function:

const app = new Clarifai.App({
  apiKey: "YOUR API KEY",
});
  • Start the server
npm start

🚀 How to Contribute to Project?

👾 Project Admin


blackphoenix42

👑 Admin