TEN stack is a Typescript + Express + Node starter kit to develop REST API server apps.
Nothing new under the sun, just a straight forward combo to make server development a little bit faster. And of course, this make my freelancing days more enjoyable 😎
Comes with:
-
Everything typed with Typescript
-
ES6 features/modules
-
Run with Nodemon for automatic reload & watch
-
ESLint for code linting
-
Code formatting using Prettier
-
Configuration management using dotenv
-
Improved commits with Husky
-
Manage production app proccess with PM2
- Fork or Use this template repository.
- Clone the forked repository.
- Install the dependencies with yarn or npm.
Make sure you already have
node.jsandnpmoryarninstalled in your system.
- Set your
git remote add originpath
git remote add origin ${forked-and-cloned-path}Update the url if you already have an
origin
- Copy
.env.examplea file at the root of the application. - Add or modify specific variables and update it according to your need.
cp .env.example .envCheck the
configfolder to customize your settings (/src/config)
To make paths clean and ease to access @ is setup up for /src path
// BEFORE
import config from './config';
import routes from './routes';
// NOW
import config from '@/config';
import routes from '@/routes';You can customize this setup:
/tsconfig.json> compilerOptions.paths/eslintrc.yml> rules.settings.alias.map
Run the server locally. It will be run with Nodemon and ready to serve on port 8080 (unless you specify it on your .env)
yarn start # or npm startCheck
package.jsonto see more "scripts"
First, build the application.
yarn build # or npm run buildThen, use pm2 to start the application as a service.
yarn service:start # or npm run service:startThis repository will be managed as an open-source.
Please feel free to open an issue or a pull request to suggest changes or additions.
If you have any question or suggestion, don't hesitate to contact me:
🎧 I was listening this playlist to boost my productivity!
