Skip to main content

Lesson 7 of 8

Mini Project: Task Manager - Part 6 (Module Structure & Toolchain)

Set up the Task Manager's production toolchain - barrel exports, path aliases, ESLint + Prettier config, separate tsconfigs for Node backend and React frontend, and a CI-ready quality pipeline. This establishes the professional project structure used for the rest of the course.

15 minBy Priygop Editorial TeamUpdated 2026Peer Reviewed & Verified

Task Manager Part 6 - Professional Toolchain Setup

Task Manager Part 6 - Professional Toolchain Setup
# ── Project structure ───────────────────────────────────────────
# task-manager/
# ├── tsconfig.base.json        ← shared strict config
# ├── tsconfig.json             ← extends base (Node backend)
# ├── tsconfig.frontend.json    ← extends base (React frontend)
# ├── eslint.config.ts
# ├── .prettierrc
# ├── package.json
# ├── src/
# │   ├── index.ts              ← barrel (public API)
# │   ├── types/
# │   │   ├── domain.ts         ← Task, User, Priority, etc.
# │   │   ├── api.ts            ← ApiResponse, ApiResult
# │   │   ├── utils.ts          ← DeepPartial, Brand, etc.
# │   │   └── express.d.ts      ← Request augmentation
# │   ├── services/
# │   │   └── taskService.ts
# │   ├── repositories/
# │   │   └── taskRepository.ts
# │   └── lib/
# │       ├── apiClient.ts
# │       ├── eventBus.ts
# │       └── guards.ts

// src/index.ts - public barrel export
export type { Task, TaskStatus, Priority, User, TaskId, UserId } from "@/types/domain";
export type { ApiResponse, ApiResult }                            from "@/types/api";
export type { DeepPartial, DeepReadonly }                         from "@/types/utils";
export      { TaskService }                                       from "@/services/taskService";
export      { InMemoryTaskRepository }                            from "@/repositories/taskRepository";
export      { EventBus }                                          from "@/lib/eventBus";
export      { apiFetch }                                          from "@/lib/apiClient";
export      { isTask, isTaskArray }                               from "@/lib/guards";

// package.json - full quality pipeline
// {
//   "scripts": {
//     "dev":          "tsx watch src/index.ts",
//     "build":        "tsc --build",
//     "type-check":   "tsc --noEmit",
//     "lint":         "eslint src --ext .ts,.tsx",
//     "lint:fix":     "eslint src --ext .ts,.tsx --fix",
//     "format":       "prettier --write "src/**/*.{ts,tsx}"",
//     "format:check": "prettier --check "src/**/*.{ts,tsx}"",
//     "qa":           "npm run type-check && npm run lint && npm run format:check",
//     "test":         "jest",
//     "test:watch":   "jest --watch"
//   }
// }

// tsconfig.base.json (shared)
// {
//   "compilerOptions": {
//     "target": "ES2022", "strict": true,
//     "noUncheckedIndexedAccess": true, "verbatimModuleSyntax": true,
//     "baseUrl": "./src",
//     "paths": { "@/*": ["./*"], "@types/*": ["./types/*"], "@lib/*": ["./lib/*"] },
//     "skipLibCheck": true, "esModuleInterop": true
//   }
// }

// tsconfig.json (backend, extends base)
// { "extends": "./tsconfig.base.json",
//   "compilerOptions": {
//     "module": "NodeNext", "moduleResolution": "NodeNext",
//     "lib": ["ES2022"], "outDir": "./dist/server"
//   }, "include": ["src/**/*"]
// }

Common Mistakes

  • No barrel (index.ts) - without a barrel, importers must know the exact file path for every module. A barrel defines the public API surface and allows internal refactoring without breaking all imports.
  • Putting everything in `src/utils/` - flat utility folders become unmaintainable at scale. Organise by responsibility: `services/`, `repositories/`, `types/`, `lib/`. Each directory owns a clear layer.
  • Skipping the CI quality pipeline - `npm run qa` should run on every PR and block merge if it fails. Type errors, lint violations, and formatting inconsistencies should never reach the main branch.

Tip

Tip

Practice Mini Project Task Manager Part 6 Module Structure Toolchain in small, isolated examples before integrating into larger projects. Breaking concepts into small experiments builds genuine understanding faster than reading alone.

Diagram
Loading diagram…

Visual architecture and concepts for Mini Project: Task Manager - Part 6 (Module Structure & Toolchain)

Practice Task

Note

Practice Task - (1) Write a working example of Mini Project Task Manager Part 6 Module Structure Toolchain from scratch without looking at notes. (2) Modify it to handle an edge case (empty input, null value, or error state). (3) Share your solution in the Priygop community for feedback.

Quick Quiz

Common Mistake

Warning

A common mistake with Mini Project Task Manager Part 6 Module Structure Toolchain is skipping edge case testing - empty inputs, null values, and unexpected data types. Always validate boundary conditions to write robust, production-ready typescript code.

Key Takeaways

  • Set up the Task Manager's production toolchain - barrel exports, path aliases, ESLint + Prettier config, separate tsconfigs for Node backend and React frontend, and a CI-ready quality pipeline.
  • No barrel (index.ts) - without a barrel, importers must know the exact file path for every module. A barrel defines the public API surface and allows internal refactoring without breaking all imports.
  • Putting everything in `src/utils/` - flat utility folders become unmaintainable at scale. Organise by responsibility: `services/`, `repositories/`, `types/`, `lib/`. Each directory owns a clear layer.
  • Skipping the CI quality pipeline - `npm run qa` should run on every PR and block merge if it fails. Type errors, lint violations, and formatting inconsistencies should never reach the main branch.

Hands-on Practice Tools for this Course

Test what you learn using these free in-browser developer utilities (no signup required).

All 40+ Tools

Topics in This Module

0/8 done