Skip to content

mongodb-industry-solutions/leafy_factory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LEAFY FACTORY DEMO

MongoDB FastAPI Kafka Mosquitto NPM Next JS Python Postgres React Redux

Prerequisites

  • MongoDB Shell (mongosh) installed (at least version 2.0)

  • Node.js (14 or higher): Installed and up to date

  • Python (3.12 or higher): The project relies on Python to run the backend and manage dependencies.

  • Docker (27.4.0 or higher): The project relies on Docker to run the frontend and backend components.

  • PostgreSQL (15.10 or higher): The demo will use a hosted PostgreSQL cluster.

  • MongoDB Atlas Cluster (8.0.4 or higher): Under atlasAdmin role:

  • Apache Kafka (3.9.0): For the purpose of this internal README, the demo will use a hosted Kafka cluster.

  • Java JDK (Minimum version 23): Java JDK is essential for running Kafka and its plugins.

  • Git: Ensure you have Git installed on your development machine.

Inside your frontend/src folder:

  • Create a .env file and add the following lines:
MONGO_URI="<YOUR_CONNECTION_STRING>"
NEXT_PUBLIC_BACKEND_URL="http://localhost:8000"

Inside your backend/app folder:

  • Create a .env file and add the following lines:
MONGO_URI="<YOUR_CONNECTION_STRING>"
BACKEND_URL="http://localhost:8000/"
SQL_USERNAME="<YOUR_SQL_DEPLOYMENT_USER>"
SQL_PASSWORD="<YOUR_SQL_DEPLOYMENT_PASSWORD>"
SQL_HOSTNAME="<YOUR_CONNECTION_STRING_TO_YOUR_SQL_DEPLOYMENT>"
SQL_DATABASE="leafyfactorydb"
MQTT_TOPIC = "sensor/data"

For the project execution (Docker):

  • Once you have created the .env files, now you can run the following command on the leafy_factory folder:
docker-compose up --build -d

Run the following instructions in case you want to deploy it without Docker

  • To install the dependencies and packages, execute npm install in your Terminal.

  • You're all set, now you can run npm run dev

  • To execute the backend dependencies and start your server.

For the project execution:

  • Once finalized both steps in frontendand backend, now you can:

  • Run uvicorn app.main:app --reload in your backend folder.

  • Run npm run dev in your frontend/src folder.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6