Skip to content

Glossary for Beginners

Quick reference for key terms in Ignis documentation.

Core Framework Terms

TermDescription
ApplicationMain entry point extending BaseApplication. Registers all components.
ControllerHandles HTTP requests, defines API endpoints (@controller, @get, @post)
ServiceContains business logic between controllers and repositories
RepositoryDatabase operations for one entity (find, create, updateById, etc.)
DataSourceDatabase connection configuration (host, port, credentials)
Model/EntityDefines data structure and relationships using Drizzle schema
ComponentReusable plugin that bundles related functionality
DI ContainerCentral registry that stores and resolves dependencies. The Application class acts as the container.
typescript
// Application registers everything
export class Application extends BaseApplication {
  preConfigure() {
    this.dataSource(PostgresDataSource);
    this.repository(TodoRepository);
    this.controller(TodoController);
  }
}

// Controller handles HTTP
const TodoRoutes = {
  GET_ALL: {
    method: HTTP.Methods.GET,
    path: '/',
    responses: jsonResponse({ schema: z.array(z.object({ id: z.string() })) }),
  },
} as const;

@controller({ path: '/todos' })
export class TodoController extends BaseController {
  @get({ configs: TodoRoutes.GET_ALL })
  async getAll(c: TRouteContext) {
    const todos = await this.repository.find({});
    return c.json(todos, HTTP.ResultCodes.RS_2.Ok);
  }
}

// Repository handles database
@repository({ model: Todo, dataSource: PostgresDataSource })
export class TodoRepository extends DefaultCRUDRepository<typeof Todo.schema> {}

Related: Application | Controllers | Services | Repositories

TypeScript & Pattern Terms

Decorators

Annotations starting with @ that add behavior to classes/methods.

DecoratorPurpose
@controllerMarks class as controller
@modelMarks class as model/entity
@repositoryMarks class as repository
@datasourceMarks class as datasource
@injectRequests dependency from container
@get, @post, @patch, @deleteHTTP route handlers

Dependency Injection (DI)

Classes receive dependencies from an external container instead of creating them internally. Benefits: testable, flexible, maintainable.

typescript
// ❌ Without DI - creates own dependencies
class TodoController {
  private repository = new TodoRepository(new PostgresDataSource());
}

// ✅ With DI - receives from container
class TodoController {
  constructor(
    @inject({ key: 'repositories.TodoRepository' })
    private repository: TodoRepository
  ) {}
}

Container & Binding

Container stores all dependencies. Binding registers classes/values under keys.

typescript
// Register in Application
this.repository(TodoRepository);  // Key: 'repositories.TodoRepository'
this.bind({ key: 'config.apiKey' }).toValue('sk_live_xxx');

// Resolve via @inject
@inject({ key: 'repositories.TodoRepository' }) private repository: TodoRepository;

Generic Types

TypeScript feature for reusable components: <T> or <SomeType>.

typescript
class DefaultCRUDRepository<TSchema> { find(): TSchema[] { ... } }
class TodoRepository extends DefaultCRUDRepository<typeof Todo.schema> {}

Related: Dependency Injection Guide

Database Terms

TermDescription
ORMTool to work with databases using code instead of raw SQL. Ignis uses Drizzle ORM.
Drizzle ORMType-safe ORM library. Docs
SchemaTable structure definition using Drizzle syntax
MigrationScript that creates/modifies tables. Version control for database structure.
ConnectorDatabase driver that executes queries (via dataSource.connector)
RelationsConnections between tables (hasMany, belongsTo, hasOne)
typescript
// Schema definition
export const todoTable = pgTable('Todo', {
  id: text('id').primaryKey(),
  title: text('title').notNull(),
  completed: boolean('completed').default(false),
});

// Relations
export const userRelations = createRelations({
  source: userTable,
  relations: [{ type: 'hasMany', model: () => Post, foreignKey: 'authorId' }],
});

// Query with relations
await userRepo.find({ filter: { include: [{ relation: 'posts' }] } });
bash
# Migrations
bun run drizzle-kit generate  # Generate from schema changes
bun run migrate:dev           # Apply to database

Query & Filter Terms

Filter Object

Specifies what data to retrieve: where, limit, order, include.

typescript
await repository.find({
  filter: {
    where: { status: 'active', age: { gte: 18 } },
    order: ['createdAt DESC'],
    limit: 10,
    include: [{ relation: 'author' }],
  }
});

Operators

OperatorMeaningExample
eqEqual{ status: { eq: 'active' } }
neNot equal{ status: { ne: 'deleted' } }
gt, gteGreater than (or equal){ age: { gte: 18 } }
lt, lteLess than (or equal){ price: { lt: 100 } }
like, ilikePattern match{ name: { like: '%john%' } }
in, ninIn list / not in list{ id: { in: [1, 2, 3] } }
betweenRange{ age: { between: [18, 65] } }

Related: Filter System | Repositories

HTTP & API Terms

REST API Methods

MethodURLAction
GET/todosList all
GET/todos/:idGet one
POST/todosCreate
PATCH/todos/:idUpdate
DELETE/todos/:idDelete
typescript
const TodoRoutes = {
  GET_ALL: { method: HTTP.Methods.GET, path: '/', responses: jsonResponse({ schema: z.array(z.any()) }) },
  GET_BY_ID: { method: HTTP.Methods.GET, path: '/:id', request: { params: z.object({ id: z.string() }) }, responses: jsonResponse({ schema: z.any() }) },
  CREATE: { method: HTTP.Methods.POST, path: '/', request: { body: jsonContent({ schema: z.any() }) }, responses: jsonResponse({ schema: z.any() }) },
} as const;

@controller({ path: '/todos' })
class TodoController {
  @get({ configs: TodoRoutes.GET_ALL })
  async getAll(c: TRouteContext) { ... }

  @get({ configs: TodoRoutes.GET_BY_ID })
  async getById(c: TRouteContext) {
    const { id } = c.req.valid<{ id: string }>('param');
    ...
  }

  @post({ configs: TodoRoutes.CREATE })
  async create(c: TRouteContext) {
    const data = c.req.valid('json');
    ...
  }
}
TermDescription
EndpointURL path that API responds to (e.g., GET /todos)
Route ParameterVariable in URL marked with : (e.g., :id)
Request BodyJSON data sent with POST/PATCH requests
OpenAPI/SwaggerAuto-generated API docs at /docs

Environment & Configuration

Environment variables store configuration outside code (in .env files). Ignis uses APP_ENV_ prefix to avoid system conflicts.

bash
# .env file
APP_ENV_POSTGRES_HOST=localhost
APP_ENV_POSTGRES_PASSWORD=secret123
APP_ENV_SERVER_PORT=3000
typescript
const host = process.env.APP_ENV_POSTGRES_HOST;

Related: Environment Variables Reference

See Also

5-Minute Quickstart | Building a CRUD API | Repositories