Skip to main content
Feathers Framework

Overview

Feathers is a lightweight web framework for creating APIs and real-time applications using TypeScript or JavaScript. It provides everything you need to build modern web and mobile applications with minimal boilerplate. Feathers can interact with any backend technology, supports many databases out of the box, and works with any frontend like React, VueJS, Angular, React Native, Android or iOS.

Quick Start

Get your first Feathers app running in minutes with our step-by-step guide

Tutorial

Build a complete real-time application from scratch

Services

Learn about Feathers’ powerful service-oriented architecture

Real-time

Automatic real-time events via Socket.io and WebSockets

Installation

Get started with just three commands:
npm create feathers my-new-app
cd my-new-app
npm run dev

Key Features

Service Architecture

Feathers is built around the concept of services. A service is an object or class that implements specific methods. Services provide a uniform, protocol-independent interface for interacting with data.
packages/feathers/src/service.ts
export const defaultServiceMethods = ['find', 'get', 'create', 'update', 'patch', 'remove']

export const defaultServiceArguments = {
  find: ['params'],
  get: ['id', 'params'],
  create: ['data', 'params'],
  update: ['id', 'data', 'params'],
  patch: ['id', 'data', 'params'],
  remove: ['id', 'params']
}
Every service automatically supports standard CRUD operations:
  • find - Find all records (with optional query)
  • get - Get a single record by ID
  • create - Create a new record
  • update - Replace an existing record
  • patch - Update specific fields of a record
  • remove - Remove a record

Real-time by Default

Feathers automatically sends real-time events when a service method creates, updates, patches, or removes data:
packages/feathers/src/service.ts
export const defaultEventMap = {
  create: 'created',
  update: 'updated',
  patch: 'patched',
  remove: 'removed'
}

export const defaultServiceEvents = Object.values(defaultEventMap)
This means clients connected via Socket.io or other real-time transports automatically receive updates when data changes.

Universal API

The same service interface works across multiple protocols:
// Works automatically via HTTP REST
GET    /messages        -> messages.find()
GET    /messages/1      -> messages.get(1)
POST   /messages        -> messages.create(data)
PUT    /messages/1      -> messages.update(1, data)
PATCH  /messages/1      -> messages.patch(1, data)
DELETE /messages/1      -> messages.remove(1)

Powerful Hooks System

Hooks are middleware functions that can run before, after, or around service methods. They’re perfect for validation, authorization, logging, and more:
packages/feathers/src/hooks.ts
type ConvertedMap = { [type in HookType]: ReturnType<typeof convertHookData> }

type HookStore = {
  around: { [method: string]: AroundHookFunction[] }
  before: { [method: string]: HookFunction[] }
  after: { [method: string]: HookFunction[] }
  error: { [method: string]: HookFunction[] }
  collected: { [method: string]: AroundHookFunction[] }
  collectedAll: { before?: AroundHookFunction[]; after?: AroundHookFunction[] }
}
Example usage:
Example
app.service('messages').hooks({
  before: {
    create: [
      async (context) => {
        // Add timestamp
        context.data.createdAt = new Date()
      }
    ]
  },
  after: {
    get: [
      async (context) => {
        // Add computed property
        context.result.fromHook = true
      }
    ]
  }
})

Database Agnostic

Feathers includes adapters for many popular databases:

Memory

In-memory data store for testing

MongoDB

Native MongoDB adapter

SQL (Knex)

PostgreSQL, MySQL, SQLite via Knex.js
All adapters share the same interface, making it easy to switch databases:
packages/memory/src/index.ts
export class MemoryService<
  Result = any,
  Data = Partial<Result>,
  ServiceParams extends AdapterParams = AdapterParams,
  PatchData = Partial<Data>
> extends MemoryAdapter<Result, Data, ServiceParams, PatchData> {
  async find(params?: ServiceParams): Promise<Paginated<Result> | Result[]> {
    return this._find({
      ...params,
      query: await this.sanitizeQuery(params)
    })
  }

  async get(id: Id, params?: ServiceParams): Promise<Result> {
    return this._get(id, {
      ...params,
      query: await this.sanitizeQuery(params)
    })
  }

  async create(data: Data | Data[], params?: ServiceParams): Promise<Result | Result[]> {
    if (Array.isArray(data) && !this.allowsMulti('create', params)) {
      throw new MethodNotAllowed('Can not create multiple entries')
    }
    return this._create(data, params)
  }
}

Express and Koa Compatible

Feathers extends Express or Koa, so you can use any existing middleware:
packages/express/src/index.ts
export default function feathersExpress<S = any, C = any>(
  feathersApp?: FeathersApplication<S, C>,
  expressApp: Express = express()
): Application<S, C> {
  if (!feathersApp) {
    return expressApp as any
  }

  if (typeof feathersApp.setup !== 'function') {
    throw new Error('@feathersjs/express requires a valid Feathers application instance')
  }

  const app = expressApp as any as Application<S, C>
  // ... merges Feathers and Express functionality

  return app
}
This means you can use CORS, compression, body parsing, and any other Express middleware:
Example
import { feathers } from '@feathersjs/feathers'
import express, { cors, compression } from '@feathersjs/express'

const app = express(feathers())

app.use(cors())
app.use(compression())
app.use(express.json())

Architecture Benefits

Full TypeScript support with generics for services, hooks, and configuration. Get autocomplete and type checking throughout your application.
Write your business logic once and expose it via REST, Socket.io, or any custom protocol. The same code works everywhere.
Service-oriented architecture makes it easy to split functionality into microservices as your application grows.
Hooks, middleware, and plugins allow you to customize every aspect of your application without modifying core code.

What’s Next?

Quick Start Guide

Create your first Feathers application in 5 minutes

Complete Tutorial

Build a full-featured chat application step by step

Community

  • GitHub - Star the repo and contribute
  • Discord - Join the community chat
  • Documentation - Full documentation and guides
  • NPM - View package details
Feathers is MIT licensed and maintained by a vibrant community of contributors. It powers applications for startups and enterprises alike.

Build docs developers (and LLMs) love