User API implementation into the PHP Client for Makerlog

in #utopian-io6 years ago

User API implementation into the PHP Client for Makerlog



The Makerlog client can now go slowly to version 1. :-)

As already mentioned in the last posts, I develop the PHP client for Makerlog in my spare time. Makerlog is the dead-simple task log that helps you stay productive and ship faster. There you can meet other makers and share your progress.

The last days I finished the User API, the last puzzle piece to fully utilize the API of Makerlog. In the next days I will bring the documentation up to date but the implementation of the users is now finished.

Repository

New Features

What feature(s) did you add?

  • I implemented the complete user API.
  • /users/ GET POST
  • /users/{username}/ GET POST PATCH DELETE
  • /users/{username}/activity_graph/
  • /users/{username}/embed/
  • /users/{username}/follow/
  • /users/{username}/is_following/
  • /users/{username}/products/
  • /users/{username}/recent_tasks/
  • /users/{username}/stats/
  • /users/{username}/stats_embed/
  • /users/{username}/unfollow/
  • /users/{username}/wrapped/
  • /users/{username}/wrapped_image/

How did you implement it/them?

The implementation is done with the following commits:

Like in the last posts, I will go into the API a little bit. The complete API documentation is available under:

The users are the core of the API. Therefore the implementation has become a bit more. Basically I have implemented some optimizations so that the same requests are not executed multiple times unnecessarily.

If a user is now instantiated, there is no performance problem if the products are fetched from this user.

user-1.png

In this way you can now work with users as easily as possible. Because each user object has different methods for accessing the user data, it is easy to read and work with them.

user-2.png

Besides the individual user, the tasks are the heart of Makerlog. For example, you want to automatically vote for some tasks of a user, you are now able to this via the user's Task API.

user-3.png

With the latest update it is now completely possible to change users, access user data and respond to user tasks.

As a little delicacy I also implemented the latest API changes directly. Makerlog has introduced some new features today that address the Streak. Makerlog has set itself the goal to support the productity, but since the streak forces you to do things seven days a week, the streak went against the goal of makerlog.

Today in Makerlog a new functionality were introduced because of this misconception. It is something like rest time and this functionality allows you to set the weekend in such a way, that it is not calculated to the streak.

user-4.png

This was just a small overview of the new User API. Be curious about the documentation, which I will extend more and more in the next days.

GitHub Account

Future

For version 1 a complete documentation of the users is missing now. I did about 50%, so I will write the rest in the next days and will publish the client in version 1.

That was it for today already, I hope I could give a little insight into the PHP client of Makerlog.

Have fun in Makerlog and thanks for reading,
Hen

Sort:  

Thank you for your contribution.

  1. I think this is a bit verbose $Makerlog->getUsers()->getUserObject('dehenne'); instead, you can do $Makerlog->getUserObject('dehenne');
  2. Your APIs contains a few duplicate pattern, which could be refactored. For example, getRequests(), json_decode, try .. throw
  3. As I have always pointed out in your previous contributions, I'd like to see unit tests, which could be perfectly suitable to serve this purpose e.g. API design.

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

Thank you for your review, @justyy! Keep up the good work!

to the utopian mod. Sorry, i posted this post accidentally with the company account. I hope this doesn't create a problem.

cheers
Hen

Congratulations! Your post has been selected as a daily Steemit truffle! It is listed on rank 8 of all contributions awarded today. You can find the TOP DAILY TRUFFLE PICKS HERE.

I upvoted your contribution because to my mind your post is at least 9 SBD worth and should receive 111 votes. It's now up to the lovely Steemit community to make this come true.

I am TrufflePig, an Artificial Intelligence Bot that helps minnows and content curators using Machine Learning. If you are curious how I select content, you can find an explanation here!

Have a nice day and sincerely yours,
trufflepig
TrufflePig

Congratulations @pcsg-dev! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You received more than 5000 upvotes. Your next target is to reach 6000 upvotes.

You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:

Happy Birthday! In a few hours, the Steem blockchain will be running for 3 years.
Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Hi @pcsg-dev!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Hey, @pcsg-dev!

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

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

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

Vote for Utopian Witness!