NodeSeaDemo is a practical demonstration of a Single Executable Application (SEA) built with Node.js and Fastify. This project showcases how to handle file management during compilation, bundling, and runtime in a SEA context.
The application is compiled and bundled with ESBuild before the creation of the blob.
- HTTP API: A simple HTTP API built with Fastify.
- Static Assets: Handles bundled static assets.
- File Uploads: Supports dynamic file uploads.
- SEA Assets: Manages SEA assets.
- apps/node-sea-demo: Main application source code.
- apps/node-sea-demo-e2e: End-to-end tests for the application.
- dist: Compiled output directory.
- Dockerfile: Docker configuration for running the application.
- Dockerfile.sea: Docker configuration for building the SEA bundle.
- Node.js >= 20.12.0
- Docker
-
Clone the repository:
git clone https://github.com/your-repo/node-sea-demo.git cd node-sea-demo
-
Install dependencies:
npm install
To run the application locally:
nx run node-sea-demo:serve
To build and run the SEA:
nx run node-sea-demo:sea-build
./dist/apps/node-sea-demo-sea/node
To build and run the Docker container:
nx run node-sea-demo:docker-sea-build
docker run --rm -p 3000:3000 -t node-sea-demo:sea
For more details, refer to the presentation.