Step 3 of 12 25% complete

Step 3: Configuration

What You'll Learn

  • Understand the noego.config.yml file structure
  • Configure the app, server, and client sections
  • Set up file watching for hot reload
  • Configure development ports and build output

What You'll Build

A complete understanding of your noego.config.yml file.

The Configuration File

Every NoEgo project needs a configuration file in the project root. Use noego.config.yml for project configuration.

noego.config.yml

This file tells NoEgo where to find your code, how to build it, and how to run the dev server.

Complete Example

Here's a complete configuration file with all sections:

# Project root (defaults to config file location)
root: .
# Build output directory
outDir: dist

# Application bootstrap (REQUIRED)
app:
  boot: server/boot.ts
  watch:
    - server/boot.ts
    - noego.config.yml

# Backend configuration
server:
  main: server/server.ts
  controllers: server/controller
  middleware: server/middleware
  openapi: server/stitch.yaml
  sqlGlobs:
    - server/repo/**/*.sql
  watch:
    - server/**/*.ts
    - server/openapi/**/*.yaml

# Frontend configuration
client:
  main: frontend/client.ts
  shell: frontend/index.html
  openapi: frontend/stitch.yaml
  componentDir: frontend
  watch:
    - frontend/**/*.svelte
    - frontend/**/*.ts
  exclude:
    - server/**

# Static assets to copy to dist
assets:
  - frontend/resources/**

# Development server settings
dev:
  port: 3000
  backendPort: 3001

Configuration Sections

Let's break down each section:

app

— Application bootstrap (required)
boot

Path to your Express app factory. This file must export a default function that returns an Express app.

watch

Files that trigger a full app restart when changed. Include your boot file and config here.

app:
  boot: server/boot.ts       # REQUIRED
  watch:
    - server/boot.ts
    - noego.config.yml

Example server/boot.ts:

// server/boot.ts
import express from "express";

export default function boot() {
  const app = express();

  // Add middleware
  app.use(express.json());

  return app;
}

server

— Backend API configuration
main

Server entry point that wires up Dinner with your controllers.

controllers

Directory containing your controller classes.

middleware

Directory containing middleware functions.

openapi

Path to your stitch.yaml that combines all API route files.

sqlGlobs

Glob patterns for SQL files to include in the build.

watch

Files that trigger a server rebuild on change.

server:
  main: server/server.ts
  controllers: server/controller
  middleware: server/middleware
  openapi: server/stitch.yaml
  sqlGlobs:
    - server/repo/**/*.sql

client

— Frontend Svelte configuration
main

Client entry point that initializes Forge.

shell

HTML template file with mount points for your app.

openapi

Path to stitch.yaml that combines all page route files.

componentDir

Base directory for resolving Svelte component paths.

watch

Files that trigger a client rebuild on change.

exclude

Patterns to exclude from the client bundle.

client:
  main: frontend/client.ts
  shell: frontend/index.html
  openapi: frontend/stitch.yaml
  componentDir: frontend
  exclude:
    - server/**

dev

— Development server settings
port

Frontend dev server port. Default: 3000. Override with PORT env var.

backendPort

Backend API port. Default: port + 1. Override with BACKEND_PORT env var.

dev:
  port: 3000         # Frontend: http://localhost:3000
  backendPort: 3001  # API: http://localhost:3001

How File Watching Works

NoEgo uses different watch arrays to determine what to rebuild when files change:

app.watch

Changes trigger a full app restart. Use for critical files like your Express bootstrap.

boot.ts, config files

server.watch

Changes trigger a server rebuild. Use for backend code changes.

controllers, services, repos

client.watch

Changes trigger a client rebuild with HMR. Fastest refresh.

Svelte components, pages

What's Next?

Now that you understand the configuration, let's look at the project structure in detail and see how all the pieces fit together.

Troubleshooting

NoEgo

© 2025 NoEgo. All rights reserved.