- SmartBrain v1: Client / Server
- SmartBrain v2: Client / Server
- SmartBrain Docker v1: Docker Server
- SmartBrain Docker v2: Docker Client + Server
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
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
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
- 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;
Check the following links in your web browser load with no issues;
Client Front-End: http://localhost:3000
Server Back-End: http://localhost:3001
Then test the Sign-In form with the following test login details;
Email: a@a.com
Password: a
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
Finally, Sign-Out, then Register as a new user to test its working too.
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! 👏
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.
👤 Rishi Singh Bhachu
Contact me via LinkedIn
If you liked this project it would be greatly appreciated to show your support by simply giving this repo a ⭐️ rating too, many thanks!