Git Product home page Git Product logo

backend-api-copy's Introduction

Boilerplate

This project is a boilerplate for rapid development on top of the steem network. This project is a starting point and is not intended to be feature complete or na off-the-self app.

What does it include

This boilerplate includes.

  • Authenticate with SteemConnect/Logout
  • Trending + Latest post feeds
  • @username profile Page
  • @username Transfers Page
  • Logged-In user 'my blog' feed
  • Create Top Level Post
  • Upvote Top Level Post
  • Single Page for posts + Comments Thread

Setup & Install

  • install node.js & NPM - https://nodejs.org/en/
  • clone repo
  • Go to https://v2.steemconnect.com/dashboard and create a new app, it currently costs 3 STEEM.
  • add the Redirect URI - http://localhost:3000/auth/
  • open config.example.js and rename to config.js enter your client_id from steemconnect and redirect uri to 'http://localhost:3000/auth/', update the session secret to a new secure random string
  • npm install // to download dependencies
  • npm start // run the project on default port 3000
  • navigate to localhost:3000 in your browser
  • click on the blue 'login with steemconnect to authenticate your app'

Screenshots 💻

single-post

transfers

create-post

user

feed

index

Dependencies

I recommend incorporating your package manager of choice and bundling these together for production.

Frequently asked Questions

why no css framework or SCSS

The included css and use of bootstrap is intended to be as minimal as possible and only to help demonstrate the completed features. You should restructure the examples using your framework or styling methodology of choice. Refraining from building completely on-top of a framework keeps this project open to as many users as possible.

Can the STEEM API calls be moved to the backend?

Yes. You'll notice many of the API calls are fired from a page specific tag on the <main> element. This is to demonstrate which views need which information from the STEEM api and not necessarily the design pattern you have to follow.

How do I specify a specific tag for my app e.g ‘book-review’, ‘meme’, ‘photography’

When making calls to the STEEM API you will need to additional filter by your specific tag. e.g

function getTrending(query, initial){
  steem.api.getDiscussionsByTrending(query, (err, result) => {
    if (err) return console.log(err);
    result = result.filter(post => post.parent_permlink === 'review')
    displayContent(result,initial)
    getaccounts(result.map(post => post.author))
  });
}

Note you will need to query the steem API for many more posts depending on the frequency of your tags appearance.

How do I make sure only posts from my app show up?

Many apps opt to maintain their own database for a reference to posts created on their platforms specifically. Alternatively you can check the custom JSON data associated with posts. (/routes/post.js) You'll notice we are specifying the custom data 'boilerplate.app' this can be checked when querying STEEM API as with the Tag example above. This second option is not bulletproof and people could submit posts via tools like steem.js with your app name easily.

backend-api-copy's People

Contributors

stinkymonkeyph avatar

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.