Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dineshbyte/boilerplate-nodejs
https://github.com/dineshbyte/boilerplate-nodejs
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dineshbyte/boilerplate-nodejs
- Owner: dineshbyte
- Created: 2020-10-27T05:45:49.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-01-04T17:31:17.000Z (about 2 years ago)
- Last Synced: 2024-04-19T12:47:33.734Z (9 months ago)
- Language: TypeScript
- Size: 1.19 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bulletproof Node.js architecture 🛡️
This is the example repository from the blog post ['Bulletproof node.js project architecture'](https://softwareontheroad.com/ideal-nodejs-project-structure?utm_source=github&utm_medium=readme)
Please read the blog post in order to have a good understanding of the server architecture.
Also, the I added a lot of comments to the code that are not in the blog post, because they explain the implementation and the reason behind the choices of libraries and some personal opinions and some bad jokes.
The API by itself doesn't do anything fancy, it's just a user CRUD with authentication capabilities.
Maybe we can transform this in something useful, a more advanced example, just open an issue and let's discuss the future of the repo.## Development
We use `node` version `10.15.0`
```
nvm install 10.15.0
``````
nvm use 10.15.0
```The first time, you will need to run
```
npm install
```Then just start the server with
```
npm run start
```
It uses nodemon for livereloading :peace-fingers:# Roadmap
- [ ] API Validation layer (Celebrate+Joi)
- [ ] Unit tests examples
- [ ] [Cluster mode](https://softwareontheroad.com/nodejs-scalability-issues?utm_source=github&utm_medium=readme)
- [ ] The logging _'layer'_
- [ ] Add ageda dashboard
- [ ] Continuous integration with CircleCI 😍
- [ ] Deploys script and docs for AWS Elastic Beanstalk and Heroku
- [ ] Integration test with newman 😉
- [ ] Instructions on typescript debugging with VSCode# FAQ
## Where should I put the FrontEnd code ? Is this a good backend for Angular o React or Vue or _whatever_ ?
[It's not a good an idea to have node.js serving static assets a.k.a the frontend](https://softwareontheroad.com/nodejs-scalability-issues?utm_source=github&utm_medium=readme)
Also, I don't wanna take part in frontend frameworks wars 😅
Just use the frontend framework you like the most _or hate the less_ it will work 😁
## Don't you think you can add X layer to do Y ? Why you still use express if the Serverless Framework is better and it's more reliable?
I know this is not a perfect architecture but it's the most scalable that I know with less code and headache that I know.
It's meant for small startups or one-developer army projects.
I know If you start moving layers into another technology, you will end up with your business/domain logic into npm packages, your routing layer will be pure AWS Lambda functions and your data layer a combination of DynamoDB, Redis, maybe redshift, and Agolia.
Take a deep breath and go slowly, let the business grow and then scale up your product. You will need a team and talented developers anyway.