All Projects → neo4j-examples → Neo4j Movies Template

neo4j-examples / Neo4j Movies Template

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

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Neo4j Movies Template

Generator Expressjs Rest
Project template for an ExpressJS application
Stars: ✭ 41 (-82.02%)
Mutual labels:  swagger, express
Jianshu
仿简书nx+nodejs+nestjs6+express+mongodb+angular8+爬虫
Stars: ✭ 296 (+29.82%)
Mutual labels:  swagger, express
Generator Express No Stress
🚂 A Yeoman generator for Express.js based 12-factor apps and apis
Stars: ✭ 534 (+134.21%)
Mutual labels:  swagger, express
Typerx
A lightweight typescript annotation rest based extra (express、 mongoose、 angular、zorro、ng-alain ...).
Stars: ✭ 76 (-66.67%)
Mutual labels:  swagger, express
Openapi Backend
Build, Validate, Route, Authenticate and Mock using OpenAPI
Stars: ✭ 216 (-5.26%)
Mutual labels:  swagger, express
Nxplorerjs Microservice Starter
Node JS , Typescript , Express based reactive microservice starter project for REST and GraphQL APIs
Stars: ✭ 193 (-15.35%)
Mutual labels:  swagger, express
Swagger Express Ts
Generate and serve swagger.json
Stars: ✭ 102 (-55.26%)
Mutual labels:  swagger, express
Openapi Comment Parser
⚓️ JSDoc Comments for the OpenAPI Specification
Stars: ✭ 221 (-3.07%)
Mutual labels:  swagger, express
Express Starter
It's a hackathon-starter fork, but designed to use PostgreSQL by default (or MySQL)
Stars: ✭ 215 (-5.7%)
Mutual labels:  express
Hexo Theme Doc
A documentation theme for the Hexo blog framework
Stars: ✭ 222 (-2.63%)
Mutual labels:  swagger
Fullstackopen
Exercises for the Full Stack Open course.
Stars: ✭ 214 (-6.14%)
Mutual labels:  express
Swagger Bootstrap Ui
Swagger-bootstrap-ui is the Swagger front-end UI implementation, the purpose is to replace the Swagger default UI implementation Swagger-UI, make the document more friendly....
Stars: ✭ 2,816 (+1135.09%)
Mutual labels:  swagger
Userline
Query and report user logons relations from MS Windows Security Events
Stars: ✭ 221 (-3.07%)
Mutual labels:  neo4j
Imitate One
用vue+webpack + node仿制的One[一个 ]app
Stars: ✭ 216 (-5.26%)
Mutual labels:  express
Ssr
React Server-Side Rendering Example
Stars: ✭ 226 (-0.88%)
Mutual labels:  express
Helicalinsight
Helical Insight software is world’s first Open Source Business Intelligence framework which helps you to make sense out of your data and make well informed decisions.
Stars: ✭ 214 (-6.14%)
Mutual labels:  neo4j
Express Es6 Rest Api
🔋 Starter project for an ES6 RESTful Express API.
Stars: ✭ 2,401 (+953.07%)
Mutual labels:  express
Flasgger
Easy OpenAPI specs and Swagger UI for your Flask API
Stars: ✭ 2,825 (+1139.04%)
Mutual labels:  swagger
Node Mock Server
File based Node REST API mock server
Stars: ✭ 225 (-1.32%)
Mutual labels:  swagger
Tensei
🚀 Content management and distribution with a touch of elegance.
Stars: ✭ 217 (-4.82%)
Mutual labels:  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.
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].