Last update: 2025-06-16T16:46:57.000Z
Content:
---
title: "Datafiles · Tinybird Docs"
theme-color: "#171612"
description: "Datafiles describe your Tinybird resources, like data sources, pipes, and so on. They're the source code of your project."
inkeep:version: "forward"
---




# Datafiles [¶](https://www.tinybird.co/docs/forward/dev-reference/datafiles#datafiles)

Copy as MD Datafiles describe your Tinybird resources, like data sources, pipes, and so on. They're the source code of your project.

You can use datafiles to manage your projects as source code and take advantage of version control. Tinybird CLI helps you produce and push datafiles to the Tinybird platform.

## Data projects [¶](https://www.tinybird.co/docs/forward/dev-reference/datafiles#data-projects)

A data project is a collection of datafiles that describe your Tinybird resources.

The minimal data project includes:

- A .datasource file, which describes the source and schema of your data.
- A pipe, typically a .endpoint file, which describes how to process and serve the data.

For example:

- Data source
- Pipe

SCHEMA >
    `day` Date `json:$.day`,
    `station` String `json:$.station`,
    `abslevel` Nullable(Float32) `json:$.abslevel`,
    `percentagevolume` Float32 `json:$.percentagevolume`,
    `volume` Float32 `json:$.volume`

ENGINE "MergeTree"
ENGINE_PARTITION_KEY "station"
ENGINE_SORTING_KEY "day, station"
## Folder structure [¶](https://www.tinybird.co/docs/forward/dev-reference/datafiles#folder-structure)

Tinybird projects are organized in a folder structure that helps you organize the source for each resource type.

The datafiles that you generate when you run `tb create` are organized in the following folders:

- `connections`   : Contains[  connection files](/docs/forward/dev-reference/datafiles/connection-files)  .
- `copies`   : Contains the[  copy pipes](/docs/forward/dev-reference/datafiles/pipe-files#copy-pipes)  .
- `datasources`   : Contains the[  data sources](/docs/forward/dev-reference/datafiles/datasource-files)  .
- `endpoints`   : Contains the[  endpoint pipes](/docs/forward/dev-reference/datafiles/pipe-files#endpoint-pipes)  .
- `fixtures`   : Contains test fixtures and test data.
- `infra`   : Contains the infrastructure files. See[  tb infra](/docs/forward/dev-reference/commands/tb-infra)  .
- `materializations`   : Contains[  materialized views](/docs/forward/dev-reference/datafiles/pipe-files#materialized-pipes)  .
- `pipes`   : Contains non-published[  pipes](/docs/forward/dev-reference/datafiles/pipe-files)  .
- `sinks`   : Contains the[  sink pipes](/docs/forward/dev-reference/datafiles/pipe-files#sink-pipes)  .
- `tests`   : Contains the test suites.

The following example shows a typical `tinybird` project folder structure that includes subfolders for supported types:

##### Example file structure

.
├── .tinyb
├── connections
├── copies
├── datasources
│   └── user_actions.datasource
├── endpoints
│   ├── user_actions_line_chart.pipe
│   └── user_actions_total_widget.pipe
├── fixtures
│   ├── user_actions.prompt
│   └── user_actions_d1046873.ndjson
├── infra
│   └── aws
│       ├── config.json
│       ├── k8s.yaml
│       └── main.tf
├── materializations
├── pipes
├── sinks
└── tests
    └── user_actions_line_chart.yaml The .tinyb file contains the Tinybird project configuration, including the authentication token obtained by running `tb login` . See [.tinyb file](/docs/forward/dev-reference/datafiles/tinyb-file).

## Types of datafiles [¶](https://www.tinybird.co/docs/forward/dev-reference/datafiles#types-of-datafiles)

Tinybird uses the following types of datafiles:

- Datasource files (.datasource) represent data sources. See[  Datasource files](/docs/forward/dev-reference/datafiles/datasource-files)  .
- Pipe files (.pipe) represent pipes of various types. See[  Pipe files](/docs/forward/dev-reference/datafiles/pipe-files)  .

## Syntactic conventions [¶](https://www.tinybird.co/docs/forward/dev-reference/datafiles#syntactic-conventions)

Datafiles follow the same syntactic conventions.

### Casing [¶](https://www.tinybird.co/docs/forward/dev-reference/datafiles#casing)

Instructions always appear at the beginning of a line in upper case. For example:

##### Basic syntax

COMMAND value
ANOTHER_INSTR "Value with multiple words"
### Multiple lines [¶](https://www.tinybird.co/docs/forward/dev-reference/datafiles#multiple-lines)

Instructions can span multiples lines. For example:

##### Multiline syntax

SCHEMA >
    `d` DateTime,
    `total` Int32,
    `from_novoa` Int16
### Comments [¶](https://www.tinybird.co/docs/forward/dev-reference/datafiles#comments)

You can add comments using the `#` character. For example:

# This is a comment
COMMAND value
## Next steps [¶](https://www.tinybird.co/docs/forward/dev-reference/datafiles#next-steps)

- Learn about[  datasource files](/docs/forward/dev-reference/datafiles/datasource-files)  .
- Learn about[  connection files](/docs/forward/dev-reference/datafiles/connection-files)  .
- Learn about[  pipe files](/docs/forward/dev-reference/datafiles/pipe-files)  .


