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/.
| Feature | Responsibility |
|---|---|
users | Authentication, registration, and user profiles. |
profiles | Following and unfollowing other users. |
articles | Article CRUD, filtering, and tagging support. |
comments | Adding and deleting comments on articles. |
tags | Managing and listing unique tags. |
The "Anatomy" of a Feature
Let's look at the articles feature as an example:
Dependency Flow
A key rule in this codebase is the unidirectional dependency flow:
Controller → Service → Repository → Database
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.