DBlog.io - Decentralized Blogging Platform - Backend improvement

in utopian-io •  6 years ago 

blogging-428955_640.jpg
source: pixabay.com

GitHub repo: https://github.com/mahdiyari/dblog-backend
Commit1: https://github.com/mahdiyari/dblog-backend/commit/b5b525e3932f33509fd9e4b169a8b548b35b1df6
Commit2: https://github.com/mahdiyari/dblog-backend/commit/deaffc5ede6d57cf76614c956fbbe86aad92ba5f
Commit3: https://github.com/mahdiyari/dblog-backend/commit/b09b556dcc0da54c3bdbec8c3c456ddb7b30e4cd

Recently I announced a new opensource project: https://steemit.com/onsteem/@mahdiyari/announcement-onsteem-a-better-interface-on-the-steem-blockchain

I started developing back-end for this project called Dblog.io (new name)!
We will have a back-end here and a front-end here

A demo will be available here: https://dev.onsteem.com (back-end and front-end connected)


Codes

Note: if you are not a developer, you can skip this part!

Explaining the structure of dblog-backend:
Main server file is api.js which will be started with npm start
The config file is config.js which includes all needed variables!
Under the /conf/ folder, needed configurations will be added. Currently, we have steemconnect/index.js for initializing steemconnect and /mysql/index.js for creating a MySql connection.
Under the /blockchain_apis/ needed RPC calls will be added. Currently, there is a database API get_dynamic_global_properties.js
Under the /login_apis/ needed functions for the login process will be added. Currently, we added a confirm_process.js for assigning a unique hex string (called hashKey) to the logged in users.
We will keep that unique hashKey instead of access_token (access_token provided by steemconnect and used to upvote, comment, and etc) in the database for validating other operations which will help to reduce security concerns.
confirm_process will check to see there is any hashKey in the request, then it will check that hashKey against the database. if there was not a hashKey in the request, confirm_process will assign a new hashKey for that user after checking login credentials.
We will use dynamic_global_properties in the front-end for some calculations. Like converting VESTS to the STEEM


Improvements:

All semicolons removed (semicolons are optional at the end of lines)
Functions divided
Variable names modified
More comments added
All functions converted to arrow functions
StandardJS applied
Callbacks removed
Readme updated
HTTP status codes updated
Better error handlings added


Coming update:

In the next update, Dblog will sync the user's data after the first login!
These data will be used in the blog page to categorize contents, provide similar contents, enable better searching in the contents, and managing blog page.


This contribution submitted to the https://utopian.io
Support this new project by your upvotes. Thanks for your great support.

Regards,
2018-07-08

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  
Loading...

this is going to be BIG, HUGE success!

Thanks for sharing friend @mahdiyari

Post is nicely written on Blogging. Thanks for sharing your ideas.

thanks for giving this information https://old.steemfollower.com/?r=17752

How you are getting content to put daily on steem
Really need to learn from you sir @mahdiyari
This is actually my first blog pls upvote if u can sir

https://steemit.com/pilot/@ashwin2001/how-to-commercial-become-a-pilot-in-india

I HAVE A SUGGESTION AGAIN FOR THE UI/Users Interface OF THE Steemauto.

Please if you have a time or if you also have the budget, Please Include the number of the Users of Steemauto displayed in a graph or just a Number on the HOME PAGE.

Please include also the number of our following authors.
and our following curation Trail. And if there's someone who is following us.

So 4 group of numbers will be shown on the Homepage.

steemauto.png

Voted and Resteemed your blog.

wow nice blog.

thats good post .. keep it up .. i like U

This is going to large

Hey @mahdiyari
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

thats going to large and huge success

Where to share our referral link?

Very well, I will learn much more from this reviews. Thank you

the article is very good very nice idea good working thanks for share the information

nice bloger ..