egg README

The project's README from github.com/eggjs/egg. As one markdown file: README.md.

English | 简体中文

NPM version NPM quality NPM download Node.js Version FOSSA Status

Continuous Integration Test coverage Known Vulnerabilities Open Collective backers and sponsors

Features

Quickstart

Follow the commands listed below.

$ corepack enable utoo
$ mkdir showcase && cd showcase
$ ut create egg@beta
$ ut install
$ ut run dev
$ open http://localhost:7001

Node.js >= 22.18.0 required.

Monorepo Structure

This project is structured as a utoo monorepo with the following packages:

The monorepo uses utoo catalog mode for centralized dependency management, ensuring consistent versions across all packages.

Development Commands

# Install dependencies for all packages
ut install --from pnpm

# Build all packages
ut run build

# Test all packages
ut run test

# Run specific package commands
ut --filter=egg run test
ut --filter=@examples/helloworld-typescript run dev
ut --filter=site run dev

Local External Services

Some DAL, ORM, Redis, and ecosystem benchmark paths need local MySQL and Redis services. Start the repository-aligned Docker services before running those tests on a clean machine:

ut run dev:services:start

This starts MySQL 8 and Redis 7, matching the main CI service versions, and creates the databases used by local DAL/ORM/e2e fixtures: test, apple, banana, test_runtime_datasource, test_runtime_dao, test_dal_plugin, test_dal_standalone, cnpmcore, and cnpmcore_unittest.

Useful commands:

ut run dev:services:status
ut run dev:services:stop
ut run dev:services:reset

The default host ports are 127.0.0.1:3306 for MySQL and 127.0.0.1:6379 for Redis. If either port is already used, the start command stops before changing containers. Keep using the existing service if it is compatible with CI, or stop it and run the command again. You can change Docker host ports with EGG_DEV_SERVICES_MYSQL_PORT and EGG_DEV_SERVICES_REDIS_PORT; however, the full DAL/ORM/Redis local test path still expects the default host ports.

Image overrides are available for compatibility checks:

EGG_DEV_SERVICES_MYSQL_IMAGE=mysql:5.7 ut run dev:services:start
EGG_DEV_SERVICES_REDIS_IMAGE=redis:7 ut run dev:services:start

Run ut run dev:services:reset before switching MySQL image families, for example between MySQL 8 and MySQL 5.7, because MySQL data directories are not downgrade-compatible across major versions.

Current hard-coded service assumptions:

Documentations

Contributors

contributors

How to Contribute

Please let us know how can we help. Do check out issues for bug reports or suggestions first.

To become a contributor, please follow our contributing guide, and review the repository guidelines for day-to-day development tips.

Sponsors and Backers

sponsors backers

License

MIT

FOSSA Status

egg (eggjs/egg)

app-framework
Searching Database…

19K ·GitHub
What is this?Egg is a Node.js framework for building better enterprise frameworks and web apps, built on top of Koa. It has about 19,000 GitHub stars and ships documentation in English and Simplified Chinese.
Is it a framework I build my app on, or a library I call from my code?A full framework: your application is built on top of it, with Koa as the underlying server layer. The main package, packages/egg, is described in the repo as the main Eggjs framework.
How do I get an app running with it?Follow the Quickstart commands at the top of the README. The repo also ships two runnable hello-world apps — examples/helloworld-commonjs and examples/helloworld-typescript — you can start from.
What do I need installed before I start?Node.js 22.18.0 or newer. To run the repo's DAL, ORM and Redis tests locally you also start Docker services with MySQL 8 and Redis 7, matching the CI versions.
Any pitfalls in that local test setup?Fixtures expect the default ports 127.0.0.1:3306 for MySQL and 6379 for Redis, and the start command stops if either is taken. Run 'ut run dev:services:reset' before switching MySQL image families, since data directories are not downgrade-compatible.
What does Egg give me out of the box?Four headline features: built-in process management, a plugin system, framework customization, and lots of ready-made plugins to extend your app.
Why does it call itself an enterprise framework?The name is literal — it was 'born to build better enterprise frameworks and apps': larger server-side applications, with framework customization so teams can shape Egg into their own in-house framework.
What does the repository look like inside?It is a utoo monorepo: packages/egg holds the main framework and site/ hosts the documentation website, with dependency versions managed centrally across all packages.
Is Egg still actively maintained?Yes — the project dates back to 2016, has about 19,000 stars, is not archived, and runs CI workflows for unit, e2e and release pipelines.
What are similar projects?koa, elpis, crystal, apollo-server, fastify, hapi, carno.js, node-restify
Creator
eggjs
Size
29.5 MB
Stars
19K
Age
10y
Commits · 90 Days