@bengo.co/typescript-web-starter

A simple website project written in TypeScript. Use this as a starting point for your project.

Usage no npm install needed!

<script type="module">
  import bengoCoTypescriptWebStarter from 'https://cdn.skypack.dev/@bengo.co/typescript-web-starter';
</script>

README

typescript-web-starter

A simple website project written in TypeScript. Use this as a starting point for your project.

Save yourself some time. Launch sooner.

Features

  • React for view composition
  • Material UI react components for common UI elements like buttons, grid, etc. Type-checked.
  • client-side state management with Redux
  • web server using koa
  • server side rendering (SSR) - Faster apparent page loads + your website will load for end-users without JavaScript.
  • Hot Module Replacement (HMR) - When running the web server with NODE_ENV=development, saving any file (e.g. a React Component) will instantly reload and re-render your app.
  • Testing:
    • Convention to be able to run any test file (or all) using ./src/test/cli. No magic tests runner CLIs
    • Tests are type-checked, thanks to alsatian-test
  • VS Code Project
    • Debug projects in VS Code GUI with ts-node launcher
  • prettier - standard code formatting
  • tslint - Consistent coding practices, enforced.

Usage

  1. Fork or clone this repository.
  2. npm install - to download dependencies
  • dev mode (HMR enabled): npm run dev
    • or NODE_ENV=development npm start
  • build assets for production: npm run build
    • TypeScript -> JavaScript output goes in ./lib/
    • Minfied JavaScript for web browser goes in ./dist/
  • production mode
    • first, compile JS to be loaded in the browser: npm run build
    • npm start
  • test: npm test
  • tslint: npm run tslint
  • prettier: npm run prettier