rbhachu / smartbrain-master-docker

Fully 'Dockerised' version of both Client and Server SmartBrain repos, merged into a single self contained Docker container with a PostgreSQL and Redis Database.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

All SmartBrain Repos


SmartBrain Docker v2
(Fully `Dockererized` Client + Server)


Description

Fully `Dockerised` version of both Client and Server SmartBrain repos, merged into a single self contained Docker container including a PostgreSQL and Redis Databases.

Original separate dedicated repos;
SmartBrain Master Client: https://github.com/rbhachu/smartbrain-frontend-jwt
SmartBrain Master Server: https://github.com/rbhachu/smartbrain-backend-jwt


Installation Prerequisites

Docker Desktop

To run the Docker container locally, you will need to have Docker Desktop installed on your computer.
Download Link: https://www.docker.com/products/docker-desktop

Clarifai API Key

You will also need a Clarifai API Key (free) which gives access to the Face Detection API component.
Download Link: https://www.clarifai.com/models/ai-face-detection


Installation

  • Start Docker Desktop
  • Open your terminal software client (VS code etc)
  • Clone the SmartBrain Master Docker repo to download it to your local computer;
    git clone https://github.com/rbhachu/smartbrain-master-docker.git
  • 'CD' into the newly downloaded repo directory
  • Open the .env file in the root of site
  • Add your Clarifai API Key to the .env file;
    API_CLARIFAI=xxxxxxxxx
  • Save the .env file
  • Run the following command in your terminal client (ensuring you are in the root directory of the repo)
    docker-compose up --build


Now grab a cup of tea or coffee, as it will take a few minutes to create the Docker container and images in Docker Desktop

Once complete you should see confirmation of successful deployment in your terminal output.

Your Docker Desktop should also show the SmartBrain-Master-Docker Container and its respective Images (Client, Server, Redis and PostgreSQL), as per the example below;

Docker Desktop Containers Docker Desktop Images


Testing

Check the following links in your web browser load with no issues;

Client Front-End: http://localhost:3000
Server Back-End: http://localhost:3001

Client Front-End Server Back-End

Then test the Sign-In form with the following test login details;
Email: a@a.com
Password: a

Login

If successful, continue on to a test an image;

Get an image from the web or use the test image link below and paste it into the upload field and click detect

Test Image: https://rbhachu-smartbrain-f-master.herokuapp.com/test-image.jpg

Image Link Face Detection


Finally, Sign-Out, then Register as a new user to test its working too.

Register Tab Register New User


If you have no issues, you have successfully deployed a Docker Container with a fully functioning React App, running an API, PostgreSQL and Redis Databases.
So give yourself a pat on the back! 👏


Issues

If however, you do encounter any issues, check the following;

  • Is Docker Desktop running the SmartBrain Docker Container, with all 4 images (Client, Server, PostgreSQL and Redis) without any issues?
  • Are there any errors being reported for the Client and Server pages in the browser console (CTRL+SHIFT+I > Console Tab)?
  • Have you added the correct key in the .env file for Clarifai API?

If you still continue to experience issues deploying and running the Docker container please drop me a message via LinkedIn and I will try to help.


Author

👤 Rishi Singh Bhachu
Contact me via LinkedIn

Show your support

If you liked this project it would be greatly appreciated to show your support by simply giving this repo a ⭐️ rating too, many thanks!

About

Fully 'Dockerised' version of both Client and Server SmartBrain repos, merged into a single self contained Docker container with a PostgreSQL and Redis Database.


Languages

Language:JavaScript 86.2%Language:CSS 7.9%Language:HTML 3.7%Language:Dockerfile 1.5%Language:PLpgSQL 0.4%Language:Shell 0.3%