Project Structure

Exploring the structure of the Conduit implementation.

The Conduit application is located in apps/conduit and serves as a blueprint for the Bedstack Project Structure.

Feature Modules

The application is broken down into domain-driven features. Each feature is self-contained under src/.

FeatureResponsibility
usersAuthentication, registration, and user profiles.
profilesFollowing and unfollowing other users.
articlesArticle CRUD, filtering, and tagging support.
commentsAdding and deleting comments on articles.
tagsManaging and listing unique tags.

The "Anatomy" of a Feature

Let's look at the articles feature as an example:

articles.controller.ts
articles.service.ts
articles.repository.ts
articles.mapper.ts

Dependency Flow

A key rule in this codebase is the unidirectional dependency flow: ControllerServiceRepositoryDatabase

Services never touch the db object directly; they always go through a Repository. This makes the logic easy to test and ensures a clean separation of concerns.

Shared Infrastructure

Items that are not feature-specific live in src/shared:

Database Management

The drizzle/ folder in the root contains database migration files generated by drizzle-kit. We use relational queries where it makes sense, but fall back to SQL-like queries for complex filtering logic in the repository layer.

On this page