GitXplorerGitXplorer
R

node-architeture-project-design

public
11 stars
0 forks
0 issues

Commits

List of commits on branch master.
Verified
7dba02db92427208860ba5a770704dce0ab64bdd

Delete package-lock.json

RRafaelGSS committed 5 years ago
Verified
a7151112592f325ed197761dc1fc356651d46314

Merge pull request #2 from RafaelGSS/dependabot/npm_and_yarn/lodash-4.17.13

RRafaelGSS committed 5 years ago
Verified
fe24bfe2d2034dd44fca466fc7cd2610ecd2c50e

Bump lodash from 4.17.11 to 4.17.13

ddependabot[bot] committed 5 years ago
Verified
c4865b35f25f1b5bdd42ae5709fe5c1257b96f9e

Update README.md

RRafaelGSS committed 5 years ago
Verified
587a8cf3d21e106b45f1534b5f86008ed80e408a

docs: Update reference for CONTRIBUITING and TODO

RRafaelGSS committed 5 years ago
Verified
406d87b779a5fd27439cd6be225b69c63068ef95

docs: Rename CONTRIBUITING

RRafaelGSS committed 5 years ago

README

The README file for this repository.

NodeJS API Structure

The project structure for helping new api using any http server ( Using express for these boilerplate )

Install from CLI

HERE

Structure

bin/
config/
  routes/
/src/
|- data/
|-- connections/
|-- repositories/
|-- structures/    
|- domain/
|- handlers/
|- middlewares/
|- routes/
|- services/
|- utils/
/tests/

Concept of Structure

This structure, is based on some designs like DDD, Middleware Based NodeJS and the folders has the follow objectives:

bin/ - Binaries folder, can be used for routines postinstall of npm.

config/ - All of the configurations autoload of the project, like database variables.

config/routes/ - Autoload of routes for less dependency.

src/data/ - Contains the files for manipulating the connection ( repositories, structures, connection )

src/domain/ - Following the concept of DDD, the domain can be a domain of your application.

src/handlers/ - Following the concept of Middleware Based, the handlers manipulate the requests and delegate to your services.

src/middlewares/ - Middleware of routes, can be Auth, Roles...

src/routes/ - All routes for your project ( Obs: The route need has the name like *.route.js inside folder routes/ ).

src/services/ - Services for your application.

src/utils/ - Utils for your application, parser, and any util.

tests/ - Tests, actually using JEST.

Tests

npm install
npm test

Dependencies

  • dotenv: Loads environment variables from .env file
  • express: Fast, unopinionated, minimalist web framework
  • express-rescue: A wrapper for async functions which makes sure all async errors are passed to your errors handler
  • filter-files: Recursively read directories and return a list of files, filtered to have only the files for which the (optional) filter function returns true. Sync and async.
  • is-directory: Returns true if a filepath exists on the file system and it's directory.
  • lodash: Lodash modular utilities.
  • mongodb: The official MongoDB driver for Node.js

Dev Dependencies

  • @types/dotenv: TypeScript definitions for dotenv
  • @types/express: TypeScript definitions for Express
  • @types/node: TypeScript definitions for Node.js
  • chai: BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
  • mocha: simple, flexible, fun test framework
  • nodemon: Simple monitor script for use during development of a node.js app.
  • tslint: An extensible static analysis linter for the TypeScript language
  • typescript: TypeScript is a language for application scale JavaScript development

License

MIT

CONTRIBUITING

Please read CONTRIBUITING.md

TODO

Please read TODO