/ts-app

Boilerplate project for a TypeScript API (Express, tsoa) + UI (React/TSX)

Primary LanguageTypeScript

ts-app: Full-stack TypeScript Development Framework

This project is a starting point for developing an API-first application using TypeScript, Node.js, and React.

Unlike tools such as create-react-app, this project aims to use a "domain-driven" approach. The developer designs the API (and database, if applicable). A client library is automatically generated from the API, providing a statically typed interface with which to interact with the API from the React UI.

The overall goal is to provide a type-safe and productive developer experience for rapid web application development.

Technologies Used

  • TypeScript
  • Backend
    • Node.js
    • Express
    • tsoa
      • Generates Express Routes from TypeScript controllers
      • Generates OpenAPI ("Swagger") specification, enabling automatic documentation and client library generation
    • PostgreSQL as RDBMS
      • TypeORM for code-first database migrations
        • Optional: ORM-like queries
    • Redis for caching/messaging
  • Frontend
    • React.js
    • openapi-ts-client-gen for API client generation
    • SASS as a CSS preprocessor
    • webpack for bundling static assets and dev server
    • Aside from the items above, UI remains fairly unopinionated and assumes some knowledge of how to build a React app
  • Developer environment
    • docker and docker-compose for non-Node.js project dependencies
    • Single start script that live reloads the API, UI, and related services
    • VSCode launch.json settings have been included to allow debugging
  • Testing
    • Mocha/Chai tests for API

Getting Started

System Requirements

Starting the app

  • yarn to install dependencies
  • yarn start to start environment

alt text

Database Operations

Creating a new migration

Update database with pending migrations

  • yarn db:update

Contributing

  • Features and bug fixes welcome