Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsure Idea: API for xLog #615

Open
Songkeys opened this issue Jun 9, 2023 · 8 comments
Open

Unsure Idea: API for xLog #615

Songkeys opened this issue Jun 9, 2023 · 8 comments
Assignees

Comments

@Songkeys
Copy link
Member

Songkeys commented Jun 9, 2023

Note
This is an immature idea. Let's consider and discuss if developers or users would truly benefit from this idea. We want to ensure we don't waste time implementing useless things.

Background

I'm aware of the crossbell.js indexer API that can query anything on the blockchain. But what if we had specific APIs for xLog?

Benefits

  • Easier integration of xLog onto other platforms for better developer experience
    • By "easier", I mean xLog has its own sub-standard for fields, like in metadata. Interacting with the underlying crossbell.js-like API would require extra work.
    • Examples: integration with third-party apps like Obsidian; simpler xLog mobile development(?); migrating blogs from/into xLog with API
  • Improved "decentralized" branding
    • "Yes, we are so decentralized that everyone can use the xLog API for free"

Drawbacks

  • Additional investment!!! (low ROI)
    • This requires additional effort in design and implementation, but it doesn't actually add more features to xLog.

Examples

Reads:

  • /api/sites/:handle/posts: fetch all xLog posts from a user
  • /api/sites/:handle/posts/:slug: get one post
  • /api/sites/:handle/posts/:slug/comments: get comments on a post
  • /api/sites/:handle/posts/:slug/stats: get "reads", "likes", "mints", etc. stats for one post
  • ...

Writes:

I'm not sure if this would make things more complex - If the user has authorized siwe + operator, they can use the token to write with API (just another wrapper of the /op APIs on the current indexer)

  • POST /api/sites/:handle/posts: post a new article
  • PUT /api/sites/:handle/posts/:slug/likes: like a new article
  • ...
@enpitsuLin
Copy link
Member

enpitsuLin commented Jun 9, 2023

IMO, providing a series of APIs, can make xLog more of a platform than just an app

I tried using crossbell.js to build a simple blog for using xLog's data as CMS just for study

as a universal lib, crossbel.js really can do this, but I had to wrap a lot of stuff for querying specific things in xLog


I think we should turn this into a discussion where is the discussions tab or discuss this topic in Discord?

@DIYgod
Copy link
Member

DIYgod commented Jun 9, 2023

In addition, I really want to expand Crossbell's notes API for more convenient content classification and recommendation, but it seems difficult to achieve.

@Songkeys
Copy link
Member Author

Songkeys commented Jun 9, 2023

I think we should turn this into a discussion where is the discussions tab or discuss this topic in Discord?

@enpitsuLin We don't have the discussions tab so far. We could have one but I think there would be too many places for "discussions" (issues tab, discussions tab, discord channels).

In addition, I really want to expand Crossbell's notes API for more convenient content classification and recommendation, but it seems difficult to achieve.

@DIYgod Could you elaborate more on this?

@Innei
Copy link
Member

Innei commented Jun 9, 2023

IMO, providing a series of APIs, can make xLog more of a platform than just an app

I tried using crossbell.js to build a simple blog for using xLog's data as CMS just for study

as a universal lib, crossbel.js really can do this, but I had to wrap a lot of stuff for querying specific things in xLog

I think we should turn this into a discussion where is the discussions tab or discuss this topic in Discord?

I am also like you, now publishing to xlog in mx-space/admin is also implemented through crossbell.js and unidata.

@Gianthard-cyh
Copy link

Any progress on this?

@hyoban
Copy link
Member

hyoban commented Mar 1, 2024

Hi @Songkeys, this sounds like an interesting thing for me.

In sakuin, I must find xLog-related attributes in metadata.content.attributes. There is no type safety, I need to make sure there is this attribute or not.

I'd love to work on this in my free time, maybe start with a sdk for xLog.

@Songkeys
Copy link
Member Author

Songkeys commented Mar 1, 2024

@hyoban I appreciate that you could pick this up. You could start with an API proposal. Let me know if we could help with anything here or in the Discord server.

@hyoban
Copy link
Member

hyoban commented Mar 1, 2024

@Songkeys Because it should be a long task, maybe it will be more convenient to discuss on discord. I will get in touch with you there.

@hyoban hyoban self-assigned this Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants