Skip to content
Nile Js
Examples

Examples

Build complete Nile Js features step by step, with every file, the exact commands and the output you should see

Read Markdown ↗

Start from the CLI project and add one feature at a time. Run these commands from the project folder with Bun 1.4.2 or later.

ExampleWhat you buildFeatures used
Tasks API in ReactA task list and form in a React component that calls the API through @nilejs/clientActions, client Results, CORS
Protected profileA JWT-protected profile action and a role-checked audit actionJWT, accessControl, global before hook
File uploadA document action that accepts a file with size and type limitsUploads, structured payload, client upload
Realtime order updatesTyped order topics, a protected status action and a socket clientTopics, WebSocket policies, socket client
Weekly reportA Monday morning report built by a cron job and delivered through a queueCron jobs, queues, lifecycle
Rate-limited quoteA public price action that allows a short burst per clientRate limiting

Before you start

  1. Install Bun 1.4.2 or later and check bun --version.
  2. Create the starter project with bunx @nilejs/cli new my-app, then cd my-app and bun install.
  3. Keep one terminal running bun run dev while you call the server from a second terminal.

Each example says which files to create or replace. Files that are not mentioned stay as the starter generated them. Stop a running server with Ctrl+C before you run a script that starts its own server on port 8000.

On this page