/face-ai-api

Primary LanguageTypeScript

image

Face AI API

Backend for Face AI application.

Intro

This is a Node.js Express backend made for the Face AI application. It's built base on the final project of smart-brain-api by @Andrei Neagoie in his course "The Complete Junior to Senior Web Developer Roadmap".

Same as the Face AI application, this backend has added extra features like:

  • Use MySQL database instead with Sequelize
  • Added helmet for extra security
  • Completely written in TypeScript

Packages Used

  • typescript
  • bcrypt
  • cors
  • dotenv
  • express
  • helmet
  • morgan
  • mysql2
  • sequelize

Frontend

The frontend of this application is in another repo face-ai.

Development

Clone the repo onto your local machine, then install all the dependencies:

npm install

# or

yarn install

To run the application run:

npm run serve

# or

yarn serve

Last but not least, add a .env file in the root folder with the following content:

ALLOWED_CORS=http://localhost:3000 # Domain to allow CORS

DB_HOST=xxx.xxx.xxx.xx # Database host url
DB_PORT=3306
DB_USERNAME=face_ai
DB_PASSWORD=xxxxx # Database password
DB_NAME=face_ai

CLARIFAI_KEY=YOUR_CLARIFAI_KEY # Get your key on Clarifai