Install Evidence
First, create a new Evidence project using npx:Start the development server:Your app will be available at
http://localhost:3000.Connect Your Data Source
Evidence supports multiple databases. For this tutorial, we’ll use DuckDB (which comes preconfigured).Check your This connection is automatically available to all your queries.
sources/ directory. You should see a connection file:sources/my_database/connection.yaml
Write Your First Query
Create a file Evidence will automatically run this query and make the results available to your pages.
queries/orders_by_month.sql:Add Key Metrics
Enhance your dashboard with summary metrics. Add this to your page:Add this markdown to your page:Then add a SQL query:And display the results with BigValue components:The
summary
{summary} syntax references inline SQL queries defined with triple backticks.Add Multiple Visualizations
Create more insights with different chart types:First create a SQL query:Then add a chart:Evidence supports many chart types:
orders_by_category
<LineChart>- Time series and trends<BarChart>- Comparisons across categories<AreaChart>- Cumulative values<ScatterPlot>- Correlations- And many more!
Next Steps
Now that you’ve built your first app, explore these features:- Connect different data sources - PostgreSQL, Snowflake, BigQuery, and more
- Create interactive charts - Advanced visualizations and customization
- Build templated pages - Dynamic pages for categories, products, or users
- Customize styling - Match your brand with custom CSS
Common Patterns
Using Markdown for Context
Evidence pages are markdown files, so you can add rich text alongside your data:Filtering Data
Use JavaScript to filter your query results:Combining Queries
Reference one query from another using${query_name}:
Troubleshooting
Query Not Found
Make sure your query file is in thequeries/ directory and referenced in your page’s frontmatter:
Data Not Showing
Check the browser console for errors. Common issues:- Column names are case-sensitive
- Query returned no rows
- Database connection issue
Styling Issues
Ensure your custom CSS is insrc/app.css and properly imported in your layout file.