All Projects → claclacla → Building-a-Node-Express.js-Rest-API-server-using-a-repository-pattern

claclacla / Building-a-Node-Express.js-Rest-API-server-using-a-repository-pattern

Licence: MIT license
A complete example of a Node + Express.js rest api server

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Building-a-Node-Express.js-Rest-API-server-using-a-repository-pattern

Angular2 Express Mongoose Gulp Node Typescript
AngularJS 2 (Updated to 4.2.0) Mean Stack application which uses Angular2, Gulp, Express, Node, MongoDB (Mongoose) with Repository Pattern Business Layer
Stars: ✭ 201 (+346.67%)
Mutual labels:  expressjs, repository-pattern
scheduler
Laravel on my way
Stars: ✭ 20 (-55.56%)
Mutual labels:  repository-pattern
laravel-repository-pattern
Files autogenerator for repositorry pattern
Stars: ✭ 46 (+2.22%)
Mutual labels:  repository-pattern
fotongo
Simple boilerplate for building Backend services like ExpressJS with GOFIBER ⚡️
Stars: ✭ 29 (-35.56%)
Mutual labels:  expressjs
gBoards
Trello like Angular Application
Stars: ✭ 21 (-53.33%)
Mutual labels:  expressjs
infinite-wish-board
A platform for kids to make wishes at Make-A-Wish, GA.
Stars: ✭ 27 (-40%)
Mutual labels:  expressjs
react-app-simple-chat-app
A Simple Chat Application using MERN stack (MongoDB, Express JS, React JS, Node JS) and Socket.io for real time chatting
Stars: ✭ 41 (-8.89%)
Mutual labels:  expressjs
MEAN-stack-authentication
MEAN stack authentication boilerplate with Angular 5 and Angular Material
Stars: ✭ 29 (-35.56%)
Mutual labels:  expressjs
search-cities
No description or website provided.
Stars: ✭ 11 (-75.56%)
Mutual labels:  expressjs
nestjs-session
Idiomatic Session Module for NestJS. Built on top of `express-session` 😎
Stars: ✭ 150 (+233.33%)
Mutual labels:  expressjs
express-json-validator-middleware
Express middleware for validating requests against JSON schema
Stars: ✭ 148 (+228.89%)
Mutual labels:  expressjs
node-express-mongodb-reactjs-graphql
Node, Express, React.js, Graphql and MongoDB CRUD Web Application
Stars: ✭ 36 (-20%)
Mutual labels:  expressjs
MovieGo
A Website implemented using MERN (MongoDB, ExpressJS, ReactJS and NodeJS) stack, which allows users to sign-in/register and book movie tickets online.
Stars: ✭ 26 (-42.22%)
Mutual labels:  expressjs
Trybe-School
All activities while studying at Trybe fullstack software development school. Contains: projects, exercises, course summaries. Brazil, 2020-2021.
Stars: ✭ 73 (+62.22%)
Mutual labels:  expressjs
typijs
The Angular CMS Framework for building fully-featured SPA sites powered by NodeJS and MongoDB with TypeScript
Stars: ✭ 141 (+213.33%)
Mutual labels:  expressjs
RasDash
A Raspberry Pi dashboard built on NodeJS.
Stars: ✭ 21 (-53.33%)
Mutual labels:  expressjs
oors
Modular node.js framework for makers.
Stars: ✭ 25 (-44.44%)
Mutual labels:  expressjs
pothole detection
By using this app users can report the potholes on road by clicking a photo via our app and if a pothole is detected by Machine Learning modal then it is saved to our Database from where officials can view the specifics like location,reported by and official can resolve the request.User are notified by email for every update regarding their request
Stars: ✭ 17 (-62.22%)
Mutual labels:  expressjs
mean-ionic-ngrx
Monorepo as Microservices: Full MEAN stack with Angular 7, Ionic 4 and ReactiveX API (ngrx/Store + ngrx/Effects) + i18n/ngx-translate + Express NodeJS REST API servers micro-services + JWT Authentication + UnitTest/e2e exemple + Travis + DevOps scripts and many more...
Stars: ✭ 60 (+33.33%)
Mutual labels:  expressjs
express-mvc-pattern
Example nodejs using express implementation design pattern using mvc architecture.
Stars: ✭ 52 (+15.56%)
Mutual labels:  expressjs

Building a Node + Express.js Rest API server using a repository pattern

This is a complete example of a Rest API server which manages two collections: Post and BlogCategory.

Both are defined on app.js file and for the CRUD operations share the same route modules on routes folder. Their specific data mappers and repositories are created outside and passed using the dependency injection.

Routes objects validate their parameters or body data with the validators on routes/validators and dialog with the database using the injected repository methods.

In each collection a resource is identified by an unique id created with the UID lib.

The data transfer objects definitions are on dto folder and each of them has an own mapper to a repository entity object defined on entities folder. The mapping operations among dto objects and entities are performed by routes before sending and after receiving repository data.

The database used for development and testing purpose is ForeRunnerDB and the repository classes are on repositories/ForeRunnerDB folder. For other databases support it would be enough to write a new specific repository class and inject it on route creation.


Getting Started

The test server is a Node/Express.js app running on localhost:4000. If you want to modify the app port, change the configuration file config/default.yaml.

Data are saved using the database ForerunnerDB.

The tests on test/e2e folder show the different API usage.


Prerequisites

What things you need to install the software

Node.js 6.0+

Installing

The easiest way to get started is to clone the repository:

# Get the latest snapshot
git clone https://github.com/claclacla/Building-a-Node-Express.js-Rest-API-server-using-a-repository-pattern

# Change directory
cd Building-a-Node-Express.js-Rest-API-server-using-a-repository-pattern

# Install NPM dependencies
npm i

Usage

# Change directory
cd Building-a-Node-Express.js-Rest-API-server-using-a-repository-pattern

# Start the API server using node
npm start

# Test it using...

npm run unit-test
# ...to test server code

npm run e2e-test
# ...to test the collections API

Authors


License

This project is licensed under the MIT License


Acknowledgments

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].