Getting Started

Get up and running with Thunder - the fast, serverless-first Deno framework.

Introduction

Thunder is a modern, serverless-first HTTP framework built on top of Deno.js. Designed for developers who value speed, type-safety, and simplicity, Thunder eliminates the boilerplate of traditional server frameworks and lets you focus entirely on building your API - not configuring infrastructure.

Because Thunder runs on Deno's serverless runtime model, every request is handled in an isolated, stateless execution context. This means zero cold-start penalties in production, predictable memory consumption, and a dramatically simpler deployment story - no complex build pipelines, just your code.

Prerequisites

Before you begin, ensure you have Deno installed on your machine. Deno is the only runtime dependency Thunder requires.

Visit the official Deno installation guide to install Deno for your operating system.

Installation

Clone the Thunder Repository

Start by cloning the official Thunder repository to your local machine:

git clone https://github.com/Huruf-Tech/thunder.git my-thunder-app
cd my-thunder-app

Initialize the Project

Once inside the project directory, run the initialization task to set up your project:

deno task init

Remember! The command deno task init is only intended for initializing a freshly cloned project. Do not run this command again after your initial setup - it will delete your existing .git folder and reinitialize the repository, potentially causing irreversible loss of your version history.

Add a Database Connection

Create a .env file with your MongoDB connection string:

echo "DATABASE_URL=mongodb://localhost:27017/my-db" > .env

Learn more on the Environment Variables page.

Thunder ships as a minimal framework. To get essential features such as authentication, RBAC, CORS, security headers, and an admin user-management panel, install the official thunder-core plugin:

deno task add:plugin -n Huruf-Tech/thunder-core

See the Plugins page for the full plugin ecosystem.

Start the Development Server

With the project initialized, start the development server using:

deno task dev

Once the development server starts listening, open your browser or an API client such as Postman and send a request to: http://localhost:8000

Project Structure

A Thunder project follows a predictable, convention-over-configuration layout:

index.ts
users.ts
serve.ts
database.ts
.env
deno.json
Directory / FilePurpose
routes/File-based route handlers. Only top-level .ts files are registered; subfolders are ignored.
hooks/Pre/post request interceptors.
schemas/MongoDB collection schemas with Zod validation.
plugins/External Thunder projects installed as plugins ({org}/{name}/).
scripts/One-time setup scripts such as database indexes.
workers/Optional background workers for separate deployment.
public/Static assets (public/www is the default web root).
core/Framework internals - do not modify.

Files inside core/ (and serve.base.ts) are framework internals and should not be edited.

Serverless-First Architecture

Thunder is designed for serverless environments:

  • No background jobs - serverless doesn't support long-running processes. Use a separate worker instead.
  • Fast cold starts - database indexes are created via scripts, not on startup.
  • Stateless - each request is independent and isolated.

On this page