Skip to content

janit/koa-ts-boilerplate

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 

Boilerplate for Koa, TypeScript and React for server side templating

A simple boilerplate that integrates the Koa framework with TypeScript and React.js for templating.

Note that this is not pushing React for the front end, but purely for a back end templating. If you want something universal that runs the same code on the server and the browser, you can take a look at Next.js or other similar solutions. A good place to start is reading about Building Decoupled Sites and Apps with GraphQL and Next.js.

I might use this in the future, so it's mostly a personal backup. No warranty whatsoever.

Installation

If you want to try it for development, first install Nodemon, ts-node and Yarn.

Install dependencies from NPM with yarn and then run nodemon (which in turn restarts ts-node on changes):

$ yarn
$ yarn run dev

Production

For production environments you need to first compile the TypeScript source to JavaScript (to build/) and then run the app:

$ yarn run build
$ yarn run start

Note: Please note that when running in production, the environment variable NODE_ENV should be set to production as this improves the performance of Server Side Rendered React.js significantly.

About

Boilerplate for Koa, TypeScript and React for server side templating

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published