Skip to main content

Squid Project Structure

This page describes the standard folder layout and configuration files used in squid projects.
All files and folders except package.json are optional, though most squids will include many of these for full functionality.

Configuration Files

package.json

Configuration file for dependencies and the build script (invoked with npm run build).
This file is required for deploying to SQD Cloud.

Lock files

One of package-lock.json, yarn.lock, or pnpm-lock.yaml - dependencies shrinkwrap file. Required for Cloud deployment, except those that override the dependencies installation command.

tsconfig.json

TypeScript compiler configuration. Required for most squids.

squid.yaml

Deployment manifest defining squid services. Used for running locally with sqd run and deploying to SQD Cloud.

.squidignore

Files and patterns to exclude when deploying to Cloud. See the reference page for details on default exclusions.

schema.graphql

Schema definition file for your data model. Required if your squid stores its data in PostgreSQL.

Source Code

/src

The TypeScript source code folder for the squid processor:
  • /src/main.ts - Entry point of the squid processor process. Typically contains a processor.run() call.
  • /src/processor.ts - Processor object (Tron) definition and configuration.
  • /src/model/generated - TypeORM entities generated from schema.graphql.
  • /src/model - Module exporting the entity classes.
  • /src/server-extension/resolvers - User-defined GraphQL resolvers for OpenReader.
  • /src/abi - ABI utilities for Tron smart contract interactions.

Build Output and Artifacts

/lib

Output folder for the compiled squid code (generated by npm run build).

/db

Folder containing database migrations.

Additional Folders

/assets

Designated folder for custom user-provided files (e.g., static data files to seed the squid processor).

/abi

Designated folder for Tron ABI files used for smart contract interactions.

Local Development Files

docker-compose.yml

Docker Compose file for local development. Includes a PostgreSQL service definition by default.

.env

Environment variables used by docker-compose.yml and when the squid runs locally.

commands.json

User-defined scripts picked up by Squid CLI. See also the CLI cheatsheet.

Next Steps