An Application secured by Auth that allows the users to search through NFT's using OpenSea API, and save their favorite NFT or artist.
# Install NPM
npm install npm@latest -g
# Clone the repository
git clone git@github.com:follow-the-nft/follow-the-nft-api.git
# Dev Database setup
psql
CREATE DATABASE "follow-the-nft";
\q
# Install dependencies
npm install
# Running locally
npm run dev
# Running tests
npm run test
Request API Key from Opensea
API is free to use on lmited basis. To use the API in a production environment, request key from URL above. Enter email address, project name, project description, and a link to the project website. Approval takes 1-2 days.
Use API key in the header of request.
INSTALLATION
npm install axios --save
REQUEST
import axios from "axios";
const options = {
method: 'GET',
url: 'https://api.opensea.io/api/v1/asset/0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb/1/',
headers: {'X-API-KEY': 'apiKeyHere'}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
Our application is a backend application. We recommend using Postman to hit our routes.
http://localhost:3001/<address>/<token_id>
This will return back a NFT
http://localhost:3001/address/<address>
Will return back wallet address
http://localhost:3001/addresses/<addresses>
Will return back wallet addresses by how many address you add
http://localhost:3001/collection/<slug>
Will return back a collection based on the slug passed in
http://localhost:3001/register
Pass in your desired username, password
ex.
{
"username": "testUserName",
"password": "testPassword",
}
### Post: NFT you like
/This will save your liked NFT to the database in an array format
If you post the same address
and token_id
, it will remove the liked NFT from the database
### Get: Your NFT you have liked
This will return back your NFT assets in an array format
### Post: NFT you want to follow
http://localhost:3001/follows/
This will save the wallet of the address to the database in an array format
If you post the same address
, it will remove the followed NFT from the database
### Get: Your NFT you have followed
This will return back your NFT wallet in an array format
<!-- ROADMAP
## Roadmap
- [] Feature 1
- [] Feature 2
- [] Feature 3
- [] Nested Feature
-->
See the [open issues](https://github.com/follow-the-nft/follow-the-nft-api/issues) for a full list of proposed features (and known issues).
## Testing
This repository is tested using [jest](https://jestjs.io/). An example test can be seen below.
```JavaScript
'use strict'
const supertest = require('supertest')
const server = require('./server')
const request = supertest(server.server)
describe('Given /', () => {
describe('When GET', () => {
it('Then returns 200 status', async () => {
const response = await request.get('/')
expect(response.status).toEqual(200)
})
it('Then returns correct response body', async () => {
const response = await request.get('/')
expect(response.text).toEqual('@FollowTheNFT')
})
})
})
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)Distributed under the MIT License. See LICENSE.txt
for more information.
Heather Bisgaard - @vbchomp - vbchomp@gmail.com
Charlie Fadness - @fadnesscharlie - fadness.charlie@hotmail.com
Tom McGuire - @MuckT - mcgtom10@gmail.com
Jeremy Brazell - @Jeremywbrazell - jwbrazell@gmail.com
Project Link: https://github.com/follow-the-nft/follow-the-nft-api