Skip to content

About

A Node.js web application template with explicit assets, routes, build, and deployment boundaries.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

eliware.org

@eliware/web-template License CI

A Node.js web application template with explicit assets, routes, build, and deployment boundaries.

Table of Contents

Features

Start with a Fastify server, a browser app shell, a validated API example, and Docker support. Read the web application guide for setup and operation details.

Requirements

Use Node.js 26 or later. Use npm to install dependencies and run repository commands.

Setup

Create a repository from this template. Run npm ci from its root directory.

Usage

Follow the web application guide to configure, build, and run the app. Read release notes for version history.

Development

Read AGENTS.md and the specifications index before changing files. Keep server code in src/backend/ and browser code in src/frontend/.

Testing

Run npm test for aggregate validation. Pass test file paths to run focused tests. See the web application guide for validation commands.

Troubleshooting

Check the web application guide for server, API, offline, browser, and container problems.

Security

Keep credentials, private data, and runtime state out of Git. Store secret values in an approved secret store.

Configuration

Set PORT to set the server port. It defaults to 1020 and accepts integers from 1 through 65535. Set LOG_LEVEL to configure Fastify logging. It defaults to info.

Operations

Run npm run build, then run node bin/web-template.mjs. Run docker compose up --build -d to build and start the container on port 1020. Run docker compose down to stop it.

Routes

Method Path Result
GET / Serves the app page.
GET /client.js Serves the browser bundle.
GET /styles.css Serves the page styles.
GET /manifest.webmanifest Serves app install metadata.
GET /service-worker.js Serves the offline worker.
GET /icons/* Serves the template icons.
GET /screenshots/* Serves the app preview images.
GET /health Returns {"status":"ok"}.
GET /ready Returns {"status":"ready"}.
POST /api/examples/:exampleId Validates an API example request.
Other methods / and asset routes Return HTTP 405.
GET Other paths Returns HTTP 404.

Assets

Keep source assets in public/. The build creates dist/client.js and dist/service-worker.js. The app page, manifest, icons, styles, and preview images come from public/.

Development server

Run npm run build, then run node bin/web-template.mjs. Run npm run puppeteer to install Chrome before browser checks. See browser validation.

Build

Run npm run build to bundle src/frontend/client-entry.mjs and the worker entry into dist/. Run npm test to validate the repository.

Deployment

The GHCR image contains this web app. The workflow publishes ghcr.io/eliware/web-template for version tags that match package.json. Set package visibility and pull access in GitHub. The repository owner maintains the Dockerfile and the linux/amd64 build target. Publication does not deploy the app. Use an approved version tag and its recorded SHA-256 digest for deployment.

Support

For help, questions, or to chat with the author and community, visit:

Discordeliware.org

eliware.org on Discord

Links

License

MIT © Eliware

About

A Node.js web application template with explicit assets, routes, build, and deployment boundaries.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages