Building an IMDB clone with Python (Flask) and Neo4j
- Description
- Curriculum
- FAQ
- Reviews
You’re a Python developer interested in Neo4j and want to build a web app, microservice, or mobile app. You’ve already read up on Neo4j, played around with some datasets, and learned enough Cypher to get started.
Now you’re looking for a demo app or template to start putting those skills into practice.
This course provides an overview on everything that you need to build a Neo4j application. The Flask framework is used as the back-end, and React as front-end. To keep concepts simple, the application is an IMDB clone with basic account authentication and movie recommendation functionality.
-
1IntroductionVideo lesson
This course provides an overview on everything that you need to build a Neo4j application with the Python programming language. The Flask framework is used as the back-end, and React as front-end.
To keep concepts simple, the application is an IMDB clone with basic account authentication and movie recommendation functionality.
In order to get started, you should have Python 3 installed on your system and have cloned the Neo4j Movie Template.
-
2Python App WalkthroughVideo lesson
So you’re a Python developer interested in Neo4j and want to build a web app, microservice, or mobile app.
You’ve already read up on Neo4j, played around with some datasets, and learned enough Cypher to get started.
Now you’re looking for a demo app or template to start putting those skills into practice.
If you haven't already, clone the Neo4j Movie Template onto your machine.
This tutorial post will walk you through rating a movie on a sample movie rating application, from the initial setup to viewing the list of movies you’ve rated.
This lecture video will walk briefly walk you through the various features of the movie app.
This project uses a classic Neo4j dataset: the movie database. It includes Movie, Actor, Director, and Genre nodes, connected by relationships.
Additionally, users can create accounts, log in, and add their ratings to movies.
The Flask portion of the application interfaces with the database and presents data to the React.js front-end via a RESTful API. You can find the flask API in the /flask-api directory in the repo.
The front-end, built in React.js, consumes the data provided by the Flask API and presents it through some views to the end user, including:
Home page
Movie detail page
Actor and Director detail page
User detail page
Sign-up and Login pages
You can find the front-end code in the web directory.
-
3Connecting the Database and FlaskVideo lesson
To get the project running, clone the repo and follow along with the instructions in the video.
First, Start the Database!
Your app will need a database, and the easiest way to access a database that's already full of data is by connecting directly to the “Recommendations” database in Neo4j Sandbox.
Log in to Neo4j Sandbox by visiting https://sandbox.neo4j.com/, either using social authentication or your email and password.
After logging in to Neo4j Sandbox, tap “New Project” and select “Recommendations,” then tap the blue “Launch Project” button to start the database you will be connecting to.
In order to connect to the database from the environment from which you’ll be running the app (presumably your local machine), you’ll need credentials. You can find those under the “Connection details” and/or the “Connect via drivers” tab:
Note the section that looks like this - you’ll need to copy+paste the credentials in the driver section to connect to the database from your local machine.
Then, in your text editor, open and/or create flask-api/.env and enter the appropriate information into the variables: DATABASE_USERNAME, DATABASE_PASSWORD, and DATABASE_URL. Then save the file.
To start the Flask API, run:
cd flask-api
pip3 install -r requirements.txt
export FLASK_APP=app.py
flask run
Verify that the endpoints are running as expected by taking a look at the docs at: http://localhost:5000/docs
-
4Endpoint by EndpointVideo lesson
External Links May Contain Affiliate Links read more