Skip to content

freemansfreedom/smartbrain-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smartbrain learning project - Backend

This project was made as a learning experience in making a web app. Comes from "The Complete Web Developer in 2021: Zero to Mastery" course from @aneagoie. Functionality is simple, put an image in and it will detect if there are any faces on it using Clarifai AI pretrained model for that purpose. Outside of that, it also has a very simple login/signup form. This is the backend part of the project, which uses Node.js and Express for the basic web framework, bcryptjs as the Bcrypt hash implementation for safe password storage, and knex.js with node-postgres for connexting to a PostgreSQL database for information storage.

Getting started

Clone this repo with:

git clone https://github.com/llomellamomario/smartbrain-backend

Then install dependencies and start the server with:

yarn install
yarn start

It should automatically start the new server on the port you've specified in app.js. Outside any unforseen problems, it should be able to receive requests and communicate with the database specified in app.js It does need 2 tables in the database, 'users' and 'login'. Table 'users' should contain 'id', 'name', 'email', 'entries' and 'joined', while 'login' should contain 'id', 'email' and 'hash'. Still deciding if to just include a file with the relevant SQL queries, forcing a manual install, or to go a step further and integrate it so it asks on first run. Code is still messy (everything is inside app.js, when it should be properly separated), will get cleaned up.

TO-DO

  • Separate functionality in appropiate files based on concerns.
  • Move Clarifai API calls to the backend, so the API key doesn't get exposed to a (malicious) end user.
  • Add input validation. Probably there is middleware that implements said functionality.
  • Add CLI parameters to pass port/db on runtime.
  • Add a nice way to create the database structure.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published