https://github.com/4lessandrodev/graph-nestjs-typescript
Projeto usando banco de dados em grafos NEO4J typescript e NESTJS
https://github.com/4lessandrodev/graph-nestjs-typescript
Last synced: 10 months ago
JSON representation
Projeto usando banco de dados em grafos NEO4J typescript e NESTJS
- Host: GitHub
- URL: https://github.com/4lessandrodev/graph-nestjs-typescript
- Owner: 4lessandrodev
- License: apache-2.0
- Created: 2021-03-24T22:43:27.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-03-24T22:45:35.000Z (almost 5 years ago)
- Last Synced: 2025-01-07T14:24:25.381Z (12 months ago)
- Language: TypeScript
- Size: 469 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Running the App
- Follow the instruction in Database setup (Neo4j) section below.
- Clone the repo
```
git clone git@github.com:benjoox/instagram-graph-db-endpoints.git
```
- Install the dependencies
```
npm install
```
- Copy the `.env.example` to `.env`. Uncomment the Neo4j. Edit if necessary.
- Start the app with `npm start`.
- Go to `localhost:3000` in your browser and try one of the endpoints in 'Endpoints' section below.
#### Database setup (Neo4j)
> :warning: Please load the seed files before running the tests or the app.
Make sure you have dockers installed
- run
```
docker-compose up -d
```
With this you will have an instance of neo4j available at `localhost:7474`.
For each enitity there is a seed.cypher file. Open `localhost:7474` and paste the queries in the seed file in the browser console.
### Endpoints
#### User endpoints
`GET /users`
Lists all the users
`GET /users?id=`
Get the user with the provided id
`GET /users?username=`
Get the user with the provided username
`GET /users//photos-liked`
Get the photos liked by the given username
`PUT /users/`
Update the users property
`DELETE /users/`
Delete a user node and its relations
#### Photos endpoints
`GET /photos`
Lists all the photos
`GET /photos?id=`
Get the photo with the provided id
`GET /photos//user-liked`
Get the users who liked the given photo