Git Product home page Git Product logo

tipping-community-backend's Introduction

Superhero tipping-community-backend

Docs

The deployed version of the swagger documentation can be found here: https://raendom-backend.z52da5wt.xyz/docs/ or if you are running it locally here: http://localhost:3000/docs/

Docker Image

The automatically updated docker images can be found here: https://hub.docker.com/r/aeternity/superhero-backend

How to build and run on mainnet

Hosted setup

Build the setup

docker-compose up -d

Local Setup

Note: Node v14 is recommended.

Install dependencies

npm i

Create Database

npm run db:create

Start server

In order to run the server, an ipfs, redis & the above mentioned env are required

node bin/www.js

tipping-community-backend's People

Contributors

atanaskrondev avatar davidyuk avatar dependabot[bot] avatar github-actions[bot] avatar kenodressel avatar mmpetarpeshev avatar mradkov avatar thepiwo avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tipping-community-backend's Issues

Verified URL

The /verified endpoint should return the full verified URLs rather the current implementation with domain/hostname.

Example:

d2ab58f7-24ef-4c20-bdb2-21801ea770e0

blacklisted websites

Initial list

https://facebook.com
https://weibo.com
https://www.pinterest.com
https://vk.com
https://quora.com
https://www.spotify.com
https://linkedin.com

Add profile endpoints

Story: As a user I would like to add additional information about myself to my profile.
Required Endpoints:
GET /profile/:address --> Returns single profile information
POST /profile/:address --> Signature Auth --> Creates single profile
PUT /profile/:address --> Signature Auth --> Updates single profile
DELETE /profile/:address --> Signature Auth --> Deletes single profile

Profile Model:

{
  publicKey: String(address),
  avatar: Blob(image), // Could be base64 encoded and stored in db?
  biography: String,
  signature: String,
  username: String // We could not offer this and use .chain names
}

retips to update unique tippers counter

Retips are not updating the unique tipper's counter. E.g. if you havent created a tip, but rather only retipped others - this is not shown anywhere in the stats

crawl, save and return favicon

Currently when a website is crawled, only the meta information & potentially a screenshot is saved. This should be extended to include the favicon. It should be, when available:

  1. downloaded
  2. checked if it has a suitable size (should be at least 32x32 px but at most 256x256px) (excluding svgs.)
  3. converted to a usable format (jpg / png / svg)
  4. saved in the database along with the other infos
  5. saved in IPFS as backup

This can be tricky because websites might present different logos / favicons on their page. It would be necessary to get the best resolution available for the optimal result. These might be presented as app-icons or similar.

Additionally test cases would need to be written to cover the added changes.

Starting points:

Stats endpoint

Endpoint for getting statistical data for usage:

  • total comments
  • total profiles etc

Crawler sometimes errors

TypeError: Cannot read property 'parent' of null
at Function.exports.update (/app/node_modules/cheerio/lib/parse.js:69:26)
at module.exports (/app/node_modules/cheerio/lib/parse.js:19:11)
at Function.exports.load (/app/node_modules/cheerio/lib/static.js:27:14)
at Function.CheerioAdv.load (/app/node_modules/cheerio-advanced-selectors/index.js:23:26)
at module.exports (/app/node_modules/metascraper/src/load-html.js:6:11)
at /app/node_modules/metascraper/src/index.js:24:16
at Function.createPreviewForUrl (/app/logic/linkPreviewLogic.js:38:28)
at async Promise.all (index 0)
at async Function.updateTipsInDatabase (/app/logic/cacheLogic.js:62:9)
at async CacheLogic.init (/app/logic/cacheLogic.js:15:5)

Do not serve default fallback avatar

Provide meaningful error code or response to be handled in the UI and extension when user did not upload custom avatar, as we are going to use jdenticon generated avatars on UI side.

Aggregate tips value for URL

Aggregate tips + retips as a summed up value for URL.

This is probably dependent on the new contract which has the concept of retiping.

Profile creation buggy

(node:1) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'filename' of undefined
at updateImage (/app/logic/profileLogic.js:56:26)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 45)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.