Share My Creation [web] Shao - micro blog API server and web client


Shao - ( 少 in Chinese ) means less
is a micro blogging app like twitter, threads or weibo, but less...

Currently it is in beta version.

The mascot is a sloth (I wish I can draw better), represents a relax and slow life...
It is showing a smiling facial expression similar to the Chinese word less.

It is powered by EndsMeet framework (written in B4X, Web API Template 2, MinimaList, Velocity Template Engine, JWT, Bootstrap CSS, jQuery)
The data just stored using KeyValueStore. Meaning no SQL table or query used. All data handled by MinimaList class as Lists and Maps. The file I am testing now only 3KB in size.

Even though it is small but there are some security features.

JSON Web Token (JWT) is used to generate access token and refresh token.
For first time login, these tokens are returned to the client. Access token is a short live token which will be expired in 30 minutes. Meanwhile, the refresh token has expiry of 24 hours. The duration can be set to longer period, depending on developer's consideration such as for mobile app use.

When an access token expired, to get a new access token, a Post request need to be made using the refresh token together with Client ID and Secret. The latter will be added to the request header as Basic Authentication. To facilitate API testing, these values can be store and remove inside web browser localStorage.

Each API or Route can be protected using a server filter (JWTAuthFilter). When an API path is added into this filter, an access token is required to send in the Authentication header as Bearer.

The build-in API documentation can automatically checks the access token expiry before this API call is made. If the expiry date is valid, the request is proceed. Otherwise, a token refresh call will be made first and then the actual request proceeds after the access token is renewed. The refresh token id is stored in the database and can be revoked by Administrator.

Shao's concept:
Life is short, don't write so long and let people take so much time to read.
Life is sweet, a little emoji can brightens up one's day.
Life is simple, don't complicate an app (social blogging platform) with advanced features.
Life is stupid, it is funny when we recall the past.
Life is selfish, don't care so much what others say about you or not respond to you.
Life is a story, it begins and ends then a new one will start.
Life is having a secret, sometimes you just want to keep it only with some of your mates.
 

Attachments

  • shao-respond.png
    shao-respond.png
    471 KB · Views: 960
  • shao-upload.png
    shao-upload.png
    244 KB · Views: 94
Last edited:
Top