Skip to content

far-analytics/typescript-full-stack-monorepo-template

Repository files navigation

TypeScript Full-stack Monorepo Template

A minimal full-stack TypeScript template. The API serves static assets over HTTPS and the web app provides the front-end UI.

Requirements

  • Node.js >=24.0.0
  • npm >=11.0.0

Deploy

  1. Install dependencies at the repo root:
npm install
  1. Build the apps:
npm run build
  1. Create your environment file:
cp .env.example .env
  1. Update .env values (see Environment Variables below).

  2. Run the server:

npm run start

Environment Variables

The API reads these values from .env:

  • KEY_PATH: Path to your TLS private key.
  • CERT_PATH: Path to your TLS certificate.
  • WEB_ROOT: Absolute path to the web build output (e.g. [...]/apps/web/dist).
  • HOST_NAME: Bind address (e.g. 0.0.0.0).
  • PORT: HTTPS port (e.g. 8443).

Common Commands

From the repo root:

Build

  • Build all:
npm run build
  • Build api:
npm run build:api
  • Build web:
npm run build:api

Lint

  • Lint all:
npm run lint
  • Lint api:
npm run lint:api
  • Lint web:
npm run lint:web

Format

  • Format all:
npm run format
  • Format api:
npm run format:api
  • Format web:
npm run format:web

Run the server

  • Start server:
npm run start

Watch for changes

  • Watch all:
npm run monitor
  • Watch api:
npm run monitor:api
  • Watch web:
npm run monitor:web

Project Structure

  • apps/api: HTTPS static file server.
  • apps/web: Front-end assets (bundled by webpack).

Template Goals

  • Minimal, explicit tooling.
  • TypeScript in both API and web.
  • Linting that enforces declared dependencies.
  • HTTPS local serving out of the box.

Notes

  • Web assets are built into apps/web/dist and served by the API.
  • .env is ignored by git (see .gitignore); use .env.example as a template.

About

A minimal full-stack TypeScript template.

Topics

Resources

License

Stars

Watchers

Forks

Contributors