No Longer Maintained

Sep 25, 2023 | Programming

Latitude embedded analytics is no longer maintained as we’ve switched our focus to Latitude LLM. The license is maintained so you are still free to use this project as it is. New maintainers are welcome.

The Open-Source Framework for Embedded Analytics

The missing analytics layer between your database and your users.

Why Latitude?

Latitude lets you create API endpoints on top of your database or warehouse using just SQL, and embed interactive visualizations natively in your favorite frontend framework or through an iframe. It’s fast to get started, easy to maintain, and scales with your data.

Features

  • Connect to any database or data warehouse
  • Easily compose parameterized SQL queries and expose them as API endpoints
  • Built-in cache layer for lightning-fast query performance
  • Integrations with all common frontend frameworks (React, Svelte, Vue, VanillaJS)
  • Optional layout engine to build standalone dashboards using Svelte and Tailwind
  • Support for embedding dashboards via iframe
  • Deploy with a single command: latitude deploy
  • SSL-ready, encrypted parameters in URL and parameterized queries to protect against SQL injection attacks
  • Open-source driven by the community

Examples

You can find sample projects using Latitude in action in the examples directory.

Table Of Contents

Quick Start

Here’s a quick getting started guide to get the sample app up and running:

1. Install Latitude

Run the following command to install the Latitude CLI globally on your machine:

npm install -g @latitude-data/cli

Note that if you’re using Windows, you might need to follow these instructions first: Windows setup.

2. Create the Starter Project

Run this command to create a new Latitude project:

latitude start

The CLI will ask you the project name. Once you’re done, you’ll have a new directory with a sample app that you can run and customize.

3. Navigate to the Project and Run the App

Run the commands:

cd my-new-app
latitude dev

This will start the development server and open the sample app in your browser.

Connect to Your Data Sources

Set up the connection to your database or data warehouse through a simple configuration file.

yaml
source.yml
type: postgres
details:
  database: db
  user: username
  password: ••••••••••••••••
  host: postgres.example.com
  port: 5432
  schema: public
  ssl: true

We do not recommend storing your database credentials in the configuration file. Instead, use environment variables to store your credentials securely. Find out more about this in the documentation.

Write Your SQL Queries

Latitude makes it easy to fetch data from your database and expose it via an API endpoint in JSON format. Imagine your SQL queries as recipes; just like a chef uses a recipe to prepare a dish, you will use SQL queries to fetch and prepare data for your users. Each parameter in your query is like a specific ingredient that you adjust to get the desired result.

sql
titles.sql
select id, title, release_year, type, runtime, imdb_score
from titles
where release_year between param(start_year) and param(end_year)

The above concept allows you to create composable data pipelines akin to building a multi-course meal using different recipes. For instance, you fetch the titles and then create an aggregate query to summarize the number of titles.

Troubleshooting

If you encounter any issues, consider the following troubleshooting steps:

  • Make sure you have the correct database credentials configured.
  • Check that your database is up and running.
  • Ensure that your environment variables are set correctly for security.

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

Conclusion

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