Giter VIP home page Giter VIP logo

nestjs-neo4j-realworld-example's Introduction

RealWorld Example App

Neo4j & Typescript (using Nest.js) codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.

This codebase was created to demonstrate a fully fledged fullstack application built with a Neo4j database backed Nest.js application including CRUD operations, authentication, routing, pagination, and more.

We've gone to great lengths to adhere to the Neo4j and Nest.js community styleguides & best practices.

For more information on how to this works with other frontends/backends, head over to the RealWorld repo.

How it works

Neo4j is a Graph Database, a database designed to hold the connections between data (known as relationships) as important as the data itself. A Neo4j database consists of Nodes connected together with Relationships. Both nodes and relationships can contain one or more properties, which are key/value pairs.

For more information on how Neo4j compares to other databases, you can check the following links:

Data Model

Data Model

The data model diagram has been created with Arrows. You can edit the model by clicking the Export Markup button in Arrows, copying the contents of arrows.html into the text box and clicking Save at the bottom of the modal.

Dependencies

Modules, Controllers, Services

The application contains two modules. Modules are a way to group functionality (think domains and subdomains in DDD) and a convenient way to register functionality with the main app. These modules are registered in the AppModule.

  • user - This module provides functionality based around User nodes. This includes user profiles, follow/unfollow functionality and all authentication functionality.
  • article - All functionality based around Article and Tag nodes

Validation Errors

Validation errors are returned with the HTTP 400 Bad Request. The UnprocessibleEntityValidationPipe extends Nest.js's out-of-the-box ValidationPipe, providing an exceptionFactory function that instead returns an UnprocessableEntityException error containing the error messages required by the UI.

Further Reading

This example was built as part of a series of Live Streams on the Neo4j Twitch Channel. You can watch the videos back on the Building Applications with Neo4j and Typescript playlist on the [Neo4j Youtube Channel].

Getting started

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Questions, Comments, Support

If you have any questions or comments, please feel free to reach out on the Neo4j Community Forum or create an Issue. If you spot any bugs or missing features, feel free to submit a Pull Request.

nestjs-neo4j-realworld-example's People

Contributors

adam-cowley avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.