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.ymlThis 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)Path to your Express app factory. This file must export a default function that returns an Express app.
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 configurationServer entry point that wires up Dinner with your controllers.
Directory containing your controller classes.
Directory containing middleware functions.
Path to your stitch.yaml that combines all API route files.
Glob patterns for SQL files to include in the build.
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 configurationClient entry point that initializes Forge.
HTML template file with mount points for your app.
Path to stitch.yaml that combines all page route files.
Base directory for resolving Svelte component paths.
Files that trigger a client rebuild on change.
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 settingsFrontend dev server port. Default: 3000. Override with PORT env var.
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.
server.watch
Changes trigger a server rebuild. Use for backend code changes.
client.watch
Changes trigger a client rebuild with HMR. Fastest refresh.
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.