Coder Social home page Coder Social logo

possumop / face-model-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from harshcut/face-model-api

0.0 0.0 0.0 50 KB

Backend API Service for Face Model. Built with Express.js & PostgreSQL database hosted on Heroku.

Home Page: https://face-model-api.herokuapp.com

License: MIT License

JavaScript 100.00%

face-model-api's Introduction

Getting Started

The face-model-api is a backend api for the project face-model with backend authentication and a PostgreSQL database, hosted on Heroku. Get response from Clarifai API and see it visualize. More on Clarifai's face-detection model can be found here.

Developing

Fork the repository using this guide, then clone it locally.

git clone https://github.com/harshcut/face-model-api
cd face-model-api
yarn install

You can now run the Express Server on your localhost.

yarn start

PostgreSQL Database

This project uses PostgreSQL database which is a powerful, open source object-relational database system. It uses and extends the SQL language combined with many features that safely store and scale the most complicated data workloads.

Create Database

CREATE DATABASE creates a new PostgreSQL database.

CREATE DATABASE "face-model-storage";

Create Tables

To create a new table, you use the CREATE TABLE statement. Make sure to create the tables in the face-model-storage database.

CREATE TABLE "face-model-registry" (
  id VARCHAR(36) NOT NULL PRIMARY KEY,
  first_name TEXT NOT NULL,
  last_name TEXT NOT NULL,
  email TEXT NOT NULL UNIQUE,
  password TEXT NOT NULL,
  entries INTEGER NOT NULL DEFAULT 0
);

Registered user credentials are stored in face-model-registry and their detection history is logged in face-model-history.

CREATE TABLE "face-model-history" (
  serial SERIAL NOT NULL PRIMARY KEY,
  timestamp TIMESTAMP NOT NULL,
  id VARCHAR(36) NOT NULL,
  email TEXT NOT NULL,
  image TEXT NOT NULL
);

Replace values of user and password in index.js according to your database configuration.

{
  host: "127.0.0.1",
  user: "postgres",
  password: "post",
  database: "face-model-storage",
}

Environment Variables

Create a .env file in the root of the project and add the Clarifai API Key. The value assigned for API_KEY below is fake and will not work. To create your own api key, Sign Up for a Clarifai account and create an application. For more information visit Clarifi's Quick Start Guide.

Assign your client's URL to ORIGIN to prevent cross-domain based attacks. Note that it is an optional variable and can be skipped, without creating any extra modifications.

To run the project in development mode and connect to a local database, set DEV to true. Note that the variable assigned is a string and not a boolean.

API_KEY=3d20e9dea9a6f5a297ac3b1a
ORIGIN=http://localhost:3001
DEV=true

License

This project is licensed under the MIT License.

face-model-api's People

Contributors

harshcut avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.