Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/albertobasalo/proton
Boilerplate for Express API services coded with TypeScript
https://github.com/albertobasalo/proton
api boilerplate express mongodb typescript
Last synced: 19 days ago
JSON representation
Boilerplate for Express API services coded with TypeScript
- Host: GitHub
- URL: https://github.com/albertobasalo/proton
- Owner: AlbertoBasalo
- License: mit
- Created: 2021-01-08T11:07:24.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-29T07:43:48.000Z (almost 3 years ago)
- Last Synced: 2023-03-10T22:58:36.727Z (almost 2 years ago)
- Topics: api, boilerplate, express, mongodb, typescript
- Language: TypeScript
- Homepage: https://proton-angular-builders.herokuapp.com/v1/test
- Size: 3.02 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# proton
PROfessional Typescript bOilerplate with Node and express
> Clone, fork or use as a template repository for creating your next **Node TypeScript** project.
```terminal
git clone https://github.com/AtomicBuilders/proton/ your-project
cd your-project
npm install
```#### Based on [_quark_: fundamental Typescript boilerplate](https://github.com/AtomicBuilders/quark/)
## ๐ฏ Motivation
Create an Express application, but not from scratch.
Have a template to create _TypeScript_ APIs with an application already configurated.
A **boilerplate** ready to apply clean code techniques and testing.
## ๐ฉ Features
### ๐ Setup
#### Configuration
#### Logging
#### Error Handling### ๐ Routing
#### OpenApi Swagger
#### Middleware
#### Uniform response
#### Error handling### ๐ Data Repositories
#### Controller and repositories
#### In Memory
#### MongoDB (no mongoose nor other ORM)
#### Static typed with generics## โ Workflows
### ๐จโ๐ป Dev Workflow
While developing, make sure to install the recommended extensions for a better dev experience.
#### Testing
Run `npm run test:watch` it will run test after each change. Ideal for TDD or testing just in time.
#### Running
To run your code without having to build it just execute `npm run dev`
#### Updating
To keep your dependencies up to date use `npm run updates` and it will check for updates. Then cherry pick what you want to update.
### ๐ Deploy Workflow
#### Testing
Run `npm run test` it will run all test once and stops. Default for CI/CD most common environments.
If you want also the coverage report then use `npm run test:coverage` .
#### Publish
If you want to publish your work as a package or simply want to keep track of your releases, then there is a script for you: `npm run release`. It will:
- update the version number
- update the change log file.
- push and tag changes#### Build and run
The standard `npm start` will run de build process before, so you can deploy the source code alone.
This way you can automate the deployment with the former release script.
### ๐ค Scripts
Here you have a recap of the available scripts
```json
"scripts": {
"start": "node ./dist/main.js",
"prestart": "npm run build",
"build": "tsc",
"dev": "ts-node ./src/main.ts",
"test": "jest",
"test:watch": "jest --watch --verbose",
"test:coverage": "jest --coverage",
"format": "prettier --write \"./**/*.{ts,json}\"",
"lint": "eslint src --ext .ts",
"lint:fix": "npm run lint -- --fix",
"prerelease": "standard-version ",
"release": "git push --follow-tags origin master",
"updates": "ncu -u"
}
```## ๐ Tools
### ๐ GitHub Issues
Use GitHub issues for tracking _User Stories_ and _developer tasks_.
- Each issue may be labeled with
- categories: feature, bug, test, refactor, dependencies, chore
- priorities: must, should, could, wont [MoSCoW priority](https://en.wikipedia.org/wiki/MoSCoW_method)
- milestones: may be epics or releases
- project: a Kanban automated dashboard to track issue workflow> More info in Spanish at [GitHub Projects and Tools](https://www.notion.so/albr/GitHub-Projects-and-Tools-59f285b78acf4ff9b84076c526bafc03)
### ๐ฆ Commits and release
- Use [standard-version](https://www.npmjs.com/package/standard-version) to produce a changelog file from [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
### ๐ Code style with Prettier
- Installed and configured prettier
> Recommended [prettier extension](https://github.com/prettier/prettier-vscode)
### ๐ Code linting with esLint
- Installed and configured eslint to work with prettier
> Recommended [esLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
### ๐งช Code tested with Jest
- Installed and configured **jest** to run specs
- Configured to conform with **eslint**
- Uses `ts-jest` to work natively with **TypeScript**> Use this snippets `.vscode\js-snippets.json` as an inspiration to create yours
### ๐งฉ VS Code Extensions
Recommendations
- [Auto Rename Tag](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag)
- [Bracket Pair Colorizer 2](https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer-2)
- [Better Comments](https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments)
- [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome)
- [Editor Config](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig)
- [EsLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [GitHub Pull Requests and Issues](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github)
- [html tag wrapper](https://marketplace.visualstudio.com/items?itemName=hwencc.html-tag-wrapper)
- [Material Icon Theme](https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme)
- [JavaScript Booster](https://marketplace.visualstudio.com/items?itemName=sburg.vscode-javascript-booster)
- [JavaScript (ES6) code snippets](https://marketplace.visualstudio.com/items?itemName=xabikos.JavaScriptSnippets)
- [Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer)
- [npm Intellisense](https://marketplace.visualstudio.com/items?itemName=christian-kohler.npm-intellisense)
- [OpenAPI (Swagger) Editor](https://marketplace.visualstudio.com/items?itemName=42crunch.vscode-openapi)
- [Path Intellisense](https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense)
- [Peacock](https://marketplace.visualstudio.com/items?itemName=johnpapa.vscode-peacock)
- [Prettier](https://github.com/prettier/prettier-vscode)
- [Spell Right](https://marketplace.visualstudio.com/items?itemName=ban.spellright)
- [Visual Studio IntelliCode](https://marketplace.visualstudio.com/items?itemName=VisualStudioExptTeam.vscodeintellicode)### ๐ฝ Extra
#### ๐ง Settings and Snippets
> See User and WorkSpace configurations at `.vscode` folder as an inspiration for yours
> See also `.vscode\ts-snippets.json` to use in your TypeScript snippets for easy testing#### โจ VS Code Shortcuts
TOP 10
- `F1` :command list
- `CTRL+P` : file
- `CTRL+T` : search code
- `CTRL+K CTRL+Z` : code comment
- `CTRL+K CTRL+U` : uncomment code
- `F12` : go to definition
- `CTRL+ร` : show hide terminal
- `CTRL+B`: show hide navigation bar
- `CTRL+K S` : save al files
- `ALT+up|dawn` : move line## ๐จ Created by Alberto Basalo
[@albertobasalo](https://twitter.com/albertobasalo)