docs/contributing/platform/backend/folder-structure.mdx
├── scripts
├── e2e-test
├── bdd
└── src/
├── @types/
│ ├── knex.d.ts
│ ├── fastify.d.ts
│ ├── ...
├── db/
│ ├── migrations
│ ├── schemas
│ └── seeds
├── keystore/
├── lib/
│ ├── api-docs
│ ├── aws
│ ├── axios
│ ├── base64
│ ├── casl
│ ├── certificates
│ ├── config
│ ├── crypto
│ ├── dates
│ ├── delay
│ ├── error-codes
│ ├── errors
│ ├── files
│ ├── fn
│ ├── ...
├── queue
├── server/
│ ├── routes/
│ │ ├── v1
│ │ ├── v2
│ │ ├── v3
│ │ └── v4
│ ├── plugins
│ ├── config
│ └── lib
├── services/
│ ├── auth
│ ├── org
│ ├── ...
│ └── project/
│ ├── project-service.ts
│ ├── project-types.ts
│ └── project-dal.ts
└── ee/
├── routes
└── services
backend/scriptsContains reusable scripts for backend automation, like running migrations and generating SQL schemas.
backend/e2e-testIntegration tests for the APIs.
backend/bddBehavior-Driven Development (BDD) tests using Python and Gherkin feature files.
backend/srcThe source code of the backend.
@types: Type definitions for libraries like Fastify, Knex, and other third-party dependencies.db: Knex.js configuration for the database, including migrations, seed files, and SQL type schemas.keystore: Key-value store abstraction layer supporting Redis and PostgreSQL for application caching, distributed locking, and coordination.lib: Stateless, reusable functions used across the codebase, organized by functionality (crypto, config, dates, etc.).queue: Infisical's queue system based on BullMQ.src/serversrc/servicesHandles the core business logic for all operations.
Follows the co-location principle: related components should be kept together.
Each service component typically contains:
secret-queue.ts.src/eeFollows the same pattern as above, with the exception of a license change from MIT to Infisical Proprietary License.
/src/server/routes/index.ts, following the principle of simple dependency injection.npm run lint:fix and type-checked with npm run type:check.audit-log that require access to request object data.