Skip to content

Ryntak94/marvel-comics-app-backend

Repository files navigation

Table of Contents

Background

This is the backend to be used to build out the marvel comics graph database.

The project currently utilizes:

  • Node.js
  • Neo4j
  • Cypher

Install

It is recommended that before cloning this repo, which is to be only one half of the project, you should create a folder to hold both the backend and frontend
mkdir marvel-comics-app
cd marvel-comics-app
mkdir frontend
mkdir backend

To get the project up and running first clone the repository
git clone https://github.com/Ryntak94/marvel-comics-app-backend

If you have created a backend repo you can instead from the parent folder use
git clone https://github.com/Ryntak94/marvel-comics-app-backend backend

Next, cd into the project directory (no backend folder)
cd marvel-comics-app-backend

Or (backendfolder)
cd backend

Then install the dependencies
npm install

Next, we will need to install neo4j
neo4j

After you install the desktop client, you will need to create a new database

First, click the New button in the top left of the window next to Project.

Then, rename the project to something you like.

After you rename the project, you should click on it and then click the Add button and add a Local DBMS

Once you do this, we need to get an API key from the Marvel Comics API When you click on the link it will likely prompt you to login. Once you do this, you should be able to see your public and private keys
Marvel Comics API

Now, create a .env file. Inside the file set the following keys Do not use password for password in a production setting. Click Start on the DBMS In the neo4j desktop application, click on DBMS you created in your project. A sidebar will open that says:
Details | Plugins | Upgrade
Your port for the URI is the Bolt port

PUBLICKEY=################################
PRIVATEKEY=########################################
URI=neo4j://localhost:[PORT]
USER=neo4j
PASSWORD=password

Usage

Please note that this will attempt to copy the entirety of the Marvel Comics API.
Run to copy all of the API
node ./request.js
If you do not want to copy the entire API, you can pass in an optional argument as an integer to the command as such
node ./request.js 800
This will copy the number you set, or all, of the comics from the Marvel API

Run
node ./index.js

Upon succesful execution of the above commands you can click open on the DBMS and run queries.
Sample query
MATCH (n) RETURN n limit 200

If you would like to play around with the Request you can modify the options block in index.js and learn from the Marvel Comics API

Maintainers

@Ryan Matthews.

Contributing

Feel free to dive in! Open an issue or submit PRs.

License

MIT © Ryan Matthews

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published