This is a project template for making full-stack Typescript apps.
This doesn't make use any complicated build tools or web frameworks, but does use Typescript, Express.js, Embedded Javascript, Socket.io, and Sass, which is what I use for my personal projects.
Call these with npm run [command]
build
: run all build commands in parallel, withrun-p
(fromnpm-run-all
)build-server
:tsc
builds server-side code, using--watch
flag.build-client
:tsc
builds client-side code, using--watch
flag.build-sass
:sass
builds stylesheets, using--watch
flag.
Source code is organized like this:
src (from root project directory)
├── src/client # Client-side typescript
│ └── main.ts
├── src/server # Server-side typescript
│ └── server.ts
└── src/styles # CSS/SCSS/Sass styles
└── main.css
From here, it is compiled to the public/dist directory:
dist (from root project directory)
└── server.js # Output server-side javascript here
public/dist (from root project directory)
├── css # Output css here (also outputs map files by default)
│ ├── main.css
│ └── main.css.map
└── js # Output client-side javascript here
└── main.js
DeviatorsLegacy, 2021