How to Set Up ChartBrew Locally

Dec 21, 2023 | Programming

If you are looking to visualize your data effortlessly with beautiful charts and dashboards, ChartBrew is the tool for you! In this guide, we will walk you through the process of setting up ChartBrew on your local machine.

What is ChartBrew?

ChartBrew is an open-source web application that allows you to connect directly to databases and APIs, using the data to create stunning charts. It includes features like a chart builder, editable dashboards, embeddable charts, and team collaboration capabilities. You can explore more at ChartBrew.

Prerequisites

Before we dive into the installation process, make sure you have the following prerequisites:

  • NodeJS v20
  • MySQL (5+) or PostgreSQL (12.5+)
  • Redis (v6+)

Setting Up ChartBrew Locally

Create a New Database

ChartBrew supports both MySQL and PostgreSQL. Create an empty database that will be used by ChartBrew.

Clone and Set Up the Project

To get started, clone the ChartBrew repository and set up the project:

git clone https://github.com/chartbrew/chartbrew.git
cd chartbrew
npm run setup

Don’t forget to complete the required environmental variables in the chartbrew.env file. You can check which variables need to be set here.

Run the Project in Development

Open two terminal windows – one for the front-end and one for the back-end:

# frontend
cd client
npm run start

# backend
cd server
npm run start-dev

Once both parts of the application are running, navigate to http://localhost:4018 to see the app in action and create your first user account.

Deploying ChartBrew

ChartBrew can also be deployed on various platforms:

  • For deployment on Render, refer to the detailed guidelines here.
  • For deploying on Heroku and Vercel, check this guide.
  • If you’re looking to run it with Docker, you can find the full guide here.

Quickstart with Docker

If you’re eager to try out ChartBrew with Docker, follow these quick steps:

A ChartBrew Docker image is available and is built with every new release. Before running the commands, ensure you have a MySQL server running and an empty database for ChartBrew:

# Generate a 32-byte AES encryption key
node -e 'console.log(require("crypto").randomBytes(32).toString("hex"))'

# Pull the docker image and run it
docker pull razvanilin/chartbrew
docker run -p 4019:4019 -p 4018:4018 \
  -e CB_ENCRYPTION_KEY=your_32_bytes_key \
  -e CB_API_HOST=0.0.0.0 \
  -e CB_API_PORT=4019 \
  -e CB_DB_HOST=host.docker.internal \
  -e CB_DB_PORT=3306 \
  -e CB_DB_NAME=chartbrew \
  -e CB_DB_USERNAME=root \
  -e CB_DB_PASSWORD=password \
  -e CB_REDIS_HOST=host.docker.internal \
  -e CB_REDIS_PORT=6379 \
  -e CB_REDIS_PASSWORD=password \
  -e VITE_APP_CLIENT_HOST=http://localhost:4018 \
  -e VITE_APP_CLIENT_PORT=4018 \
  -e VITE_APP_API_HOST=http://localhost:4019 \
  razvanilin/chartbrew

Running ChartBrew with Docker simplifies the setup process significantly!

Troubleshooting

If you encounter any issues while setting up ChartBrew, here are some troubleshooting tips:

  • Ensure all prerequisites are installed correctly.
  • Double-check the environmental variables in your chartbrew.env file.
  • Make sure your database is running and accessible.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Conclusion

Setting up ChartBrew is a breeze, and it opens a world of data visualization possibilities. Now you can turn complex data into insightful graphs with ease!

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox