0.0.9 ā€¢ Published 2 years ago

@practica/generate v0.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Running the example app

Prerequisites

  1. Docker
  2. Node.js
  3. nvm

Generate a Node.js app that is packed with best practices AND simplicty in mind. Based on our repo Node.js best practices (77,000 stars)

šŸ—“ Alpha project: This project is very premature WIP, please revisit by June 2022

Table of contents

A very quick start

Run this command from terminal

npx practica

Answer few questions to customize for your own needs

Start the project

npm start

or

npm test

Standard, ah?

Make yourself acquainted with it

  • āœ… Run the routes with Postman
  • āœ… Understand the project structure by watch this 5 min YouTube šŸ“¹
  • āœ… Optional: Skim through the code, all the best practices are tagged inside the code
  • āœ… Master it by visiting our documentation website

https://user-images.githubusercontent.com/8571500/156916532-c73fd814-8815-486b-8117-04add11a5907.mp4

Our philosophy and unique value

1. Best practices on top of known Node.js frameworks

We don't invent new wheels rather use your favorite framework and empower it with more structure and practices. For example, with a single command you get express/fastify based code base with ~100 additional best practices inside

Built on top of known frameworks

2. SIMPLE like Node.js was meant to be

Keeping it simple, flat and based on native Node/JS capabilities is part of this project DNA. We believe that too many abstractions, high-complexity and fancy language features become soon a strategic slowdown for the team. To name a few example, our code flow is flat with almost no level of indirection, although using TypeScript - almost no features are being used besides types, for modularization we simply use... Node.js modules

Built on top of known frameworks

3. Supports many technologies and frameworks

Since it's about good practices and simplicity, there is no need to narrow this code to specific framework or DB. We aim to support the major Node.js frameworks and databases

Built on top of known frameworks

Practices and features

We apply more than 100 practices and optimizations, you can opt-in or out for most of these features using our CLI flags. Following is few examples of features, to learn about the full list of features, please visit here

FeatureExplanationFlagDocumentation link
Monorepo setupGenerates two components (e.g., Microservices) in a single repository with interactions between the two--monorepo, --mrDocs here
Output escaping and sanitizingClean-out outgoing responses from potential HTML security risks like XSS--output-escape, --oeDocs here
Integration (component) testingGenerates full-blown component/integration tests setup including DB--tests, --tDocs here
Unique request ID (Correlation ID)Generates module that creates a unique correlation/request ID for every incoming request. This is available for any other object during the request life-span. Internally it uses Node's built-in AsyncLocalStorage--correlation-id, --coiDocs here
DockerfileGenerates dockerfile that embodies 20> best practices--docker-file, --dfDocs here
Strong-schema configurationA configuration module that dynamically load run-time configuration keys and includes a strong schema so it can fail fastBuilt-in with basic appDocs here

šŸ“— Full features list - 100+ more

Steering committee

Practica is a community-driven open-source project. It's being led voluntarily by engineers from many companies. On top of this, these companies below which are keen to great engineeting practices chose to let their engineers contribute massively and push this project firmly šŸ’š

Autodesk

Cox2m

The people behind this

Core team

Images of core team

Contributors

Images of core contributors

Partners

These companies are obliged to implement these best practices and daily routine and they also fund this project generously

Cox2m

  1. Fork the repo
  2. Run npm i
  3. Run nvm use
  4. Run the tests Run t