• Stars
    star
    301
  • Rank 138,451 (Top 3 %)
  • Language
    JavaScript
  • Created over 10 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Neo4j movies React application with backends in Python/Flask and Node/Express.

README

This Neo4j-based example app displays movie and person data in a manner similar to IMDB. It is designed to serve as a template for further development projects. There are two versions of the backend - a Python/Flask backend at /flask-api, and a JavaScript/Express backend at /api. The web frontend can be found at /web. Feel encouraged to fork and update this repo!

The Model

image of movie model

Nodes

  • Movie
  • Person
  • Genre

Relationships

  • (:Person)-[:ACTED_IN {role:"some role"}]->(:Movie)
  • (:Person)-[:DIRECTED]->(:Movie)
  • (:Person)-[:WRITER_OF]->(:Movie)
  • (:Person)-[:PRODUCED]->(:Movie)
  • (:MOVIE)-[:HAS_GENRE]->(:Genre)

Database Setup: Sandbox

Go to https://sandbox.neo4j.com/?usecase=recommendations&ref=movie-app-tutorial, pick "Recommendations", and press play to start the database.

Make sure to edit the file flask-api/.env or api/.env and update the MOVIE_DATABASE_USERNAME, MOVIE_DATABASE_PASSWORD, and MOVIE_DATABASE_URL of your chosen backend to connect to your instance.

Node API

First, configure your api/.env file to point to your database.

Then, from the root directory of this project:

Alternative: Flask API

First, configure your flask-api/.env file to point to your database.

Then, from the root directory of this project:

cd flask-api
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
export FLASK_APP=app.py
flask run

Frontend

From the root directory of this project, set up and start the frontend with:

  • cd web
  • nvm use
  • npm install
  • update web/.env file

If you are using the Node API set REACT_APP_API_BASE_URL to http://localhost:3000/api/v0

If you are using the Flask api then set it to http://localhost:5000/api/v0

image of PATH settings for NPM

voilΓ ! IMDB, eat your heart out ;-)

Ratings and Recommendations

User-Centric, User-Based Recommendations

Based on my similarity to other users, user Omar Huffman might be interested in movies rated highly by users with similar ratings as himself.

MATCH (me:User {name:"Omar Huffman"})-[my:RATED]->(m:Movie)
MATCH (other:User)-[their:RATED]->(m)
WHERE me <> other
AND abs(my.rating - their.rating) < 2
WITH other,m
MATCH (other)-[otherRating:RATED]->(movie:Movie)
WHERE movie <> m
WITH avg(otherRating.rating) AS avgRating, movie
RETURN movie
ORDER BY avgRating desc
LIMIT 25

Contributing

Node.js/Express API

The Express API is located in the /api folder.

Create Endpoint

The API itself is created using the Express web framework for Node.js. The API endpoints are documented using Swagger.

To add a new API endpoint there are 3 steps:

  1. Create a new route method in /api/routes directory
  2. Describe the method with swagger specification inside a JSDoc comment to make it visible in swagger
  3. Add the new route method to the list of route methods in /api/app.js.

Flask API

The Flask API is located in the /flask-api folder. The application code is in the app.py file.

Create Endpoint

The API itself is created using the Flask-RESTful library. The API endpoints are documented using Swagger.

To add a new API endpoint there are 3 steps:

  1. Create a new Flask-RESTful resource class
  2. Create an endpoint method including the swagger docs decorator.
  3. Add the new resource to the API at the bottom of the file.

More Repositories

1

movies-java-spring-data-neo4j

Neo4j Movies Example with Spring Data Neo4j
Java
537
star
2

movies-python-bolt

Neo4j Movies Example application with Flask backend using the neo4j-python-driver
Python
368
star
3

movies-javascript-bolt

Neo4j Movies Example with webpack-in-browser app using the neo4j-javascript-driver
JavaScript
175
star
4

movies-java-bolt

Neo4j Movies Example application with SparkJava backend using the neo4j-java-driver
Java
89
star
5

paradise-papers-django

A simple Django web app for searching the Paradise Papers dataset backed by Neo4j
Python
74
star
6

rag-demo

Python
71
star
7

sdn-university

HTML
67
star
8

discoveraurafree

A repo with examples from the Discover Neo4j AuraDB Free Live Stream
Cypher
56
star
9

neo4j-ogm-university

Example Project for Neo4j OGM
JavaScript
52
star
10

movies-dotnet-neo4jclient

Neo4j Movies Demo App in dotnet with neo4jclient
C#
51
star
11

movies-python-py2neo

Neo4j Example Application with backend in py2neo
Python
48
star
12

game-of-thrones

Neo4j Database of A Song of Ice and Fire - Game of Thrones
47
star
13

twitter-graph-viz

OSCON Twitter Graph. Loads tweets from Twitter API mentioning OSCON or Neo4j into a Neo4j Graph Database for analysis.
JavaScript
45
star
14

movies-python-py2neo-2.0

Py2Neo 2 Implementation of the Movies Example Demo Application
Python
44
star
15

nestjs-neo4j-realworld-example

A Neo4j, Typescript and Nest.js clone of the Realworld.io App
TypeScript
44
star
16

graphgists

Reference Graph Gists
Shell
43
star
17

movies-dotnetcore-bolt

C#
40
star
18

sdn-cineasts

Java
37
star
19

movies-dotnet-bolt

C#
35
star
20

health-graph

Graph of health and pharm data.
Python
32
star
21

supply-chain-demo

Neo4j Supply Chain Demo
C#
31
star
22

movies-java-spring-boot-jdbc

Neo4j Movies Demo App in java with spring-boot-jdbc
HTML
27
star
23

nlp-knowledge-graph

This repository contains queries and data from creating a dev.to/Wikidata Software Knowledge Graph using neosemantics and APOC NLP.
Shell
24
star
24

movies-kotlin-spring-data-neo4j

Neo4j Movies Example with Kotlin, Spring Boot & Spring Data Neo4j
Kotlin
24
star
25

neo4j-movies-python-neomodel

Example Movie app for Neo4j and Django
Python
22
star
26

golang-neo4j-realworld-example

Go
22
star
27

movies-golang-bolt

Neo4j Movies Example application with built-in HTTP server using the neo4j-go-driver
Go
22
star
28

nodejs-neo4j-realworld-example

A Neo4j and Node.js clone of the Realworld.io App
JavaScript
22
star
29

movies-java-jdbc

Neo4j Movies Demo App in java with jdbc
HTML
21
star
30

movies-java-spring-data-neo4j-3

Neo4j Movies Demo App in java with spring-data-neo4j
HTML
21
star
31

movies-go-cq

Neo4j Movies Demo App in go with cq
HTML
21
star
32

spring-data-neo4j-intro-app

Java
18
star
33

movies-python-neo4jrestclient

Neo4j Movies Demo App with neo4jrestclient
HTML
18
star
34

sec-edgar-notebooks

Active WIP for experimenting with GraphRAG and Knowledge Graphs
Jupyter Notebook
17
star
35

cybersecurity-demo

Neo4j Cybersecurity Demo
16
star
36

neo4j-stackoverflow-import

Utilities for Importing Stack-Exchange Dumps into Neo4j
Java
15
star
37

movies-clojure-neocons

Neo4j Movies Demo App in clojure with neocons
HTML
14
star
38

link-prediction

This repository contains both Jupyter notebooks for solving a link prediction problem using Neo4j’s Graph Data Science Library and scikit-learn.
Jupyter Notebook
14
star
39

kettle-plugin-examples

Simple examples for the Neo4j Kettle (Pentaho Data Integration) steps.
Roff
14
star
40

neo4j-grouping

Graph Grouping using APOC based on Gradoop Demo
JavaScript
14
star
41

slack-neo4j

Neo4j Slack Integration Demo
Python
13
star
42

movies-graphql-javascript

Neo4j example movie search application with GraphQL backend
JavaScript
13
star
43

asset_portal

Asset management portal written with Ruby on Rails and Neo4j
JavaScript
13
star
44

movies-symfony-php-bolt

Neo4j Movies Example Project in Symfony
PHP
12
star
45

cineasts-spring-data-neo4j-3

Spring Data Neo4j 3 Cineasts Tutorial Example
Java
12
star
46

neo4j-twitter-stream

Example Application to consume a twitter stream with Neo4j
Java
12
star
47

graph-embeddings

Jupyter Notebook
11
star
48

movies-php-client

Cypher
9
star
49

movies-ruby-neo4jrb

Neo4j Movies Demo App in ruby with neo4jrb
HTML
9
star
50

movies-java-server-extension

Neo4j Movies Demo App in java with server-extension
HTML
9
star
51

atomist-spring-neo4j

Example Project demonstrating Atomist Editors for Spring Boot with Neo4j
Java
8
star
52

movies-php-neoclient

Neo4j Movies Demo App in php with neoclient
HTML
8
star
53

cytoscape-graph-viz-lotr

Cytoscape Graph Visualization Demo Lord of the Rings (LOTR)
JavaScript
7
star
54

neo4j-fabric-examples

Set of resources for the real time detection of fraud with Neo4j Fabric across shards, use case transaction structuring aka smurfing
Jupyter Notebook
6
star
55

neo4j-spatial-template

Simple Maven Setup for Neo4j Spatial
Java
6
star
56

movies-javascript-node-neo4j

Neo4j Movies Demo App in javascript with node-neo4j
6
star
57

neo4j-foodmart-dataset

Neo4j Food Mart dataset
5
star
58

neo4j-graph-datasets

Imports and visualizations of different public datasets into Neo4j
HTML
5
star
59

movies-php-neo4jphp

Neo4j Movies Demo App in php with neo4jphp
HTML
5
star
60

ruby_code_analytics

A Rails application for browsing Ruby code's execution, AST, and object space
Ruby
5
star
61

movies-ruby-neo4j-core

Neo4j Movies Demo App in ruby with neo4j-core
HTML
5
star
62

graph_starter

Ruby Rails engine gem to provide automatic UI for an asset portal
JavaScript
4
star
63

sdn-migration

Java
3
star
64

movies-python-py2neo-1.6

Neo4j Movies Demo App in python with py2neo-1.6
Python
3
star
65

conf-graph

The conference graph!
Jupyter Notebook
3
star
66

neo4j-example-graph-datasets

Useful Datasets to import/use in Neo4j with Load and Use instructions
2
star
67

oscon-graph

DIY Neo4j Graph from the OSCON 2014 event data feed
Shell
2
star
68

friends-php-client

PHP
2
star
69

graphgist_portal

New GraphGist portal written in Rails and using GraphStarter
CSS
2
star
70

aws-lambda-java-neo4j

Connect to Neo4j using AWS Lambda with Java
Java
2
star
71

movies-rstats-neo4r

Example Project for R using neo4r
HTML
2
star
72

php-laravel-neo4j-realworld-example

PHP
1
star
73

movies-perl-neo4p

Neo4j Movies Demo App in perl with neo4p
Perl
1
star
74

elastic-example

1
star
75

neo4jXtestcontainers

Example repository for the Neo4j X Testcontainers livestream on Thursday, 2023-11-02.
Java
1
star