As mentioned in #459, I'm building a website where people can create, edit, browse, share, fork, run, embed, like, dislike, etc., user-created snippets in wenyan language.
Currently I have a proof-of-concept that is running on free server from gltich.com. It uses sqlite to store user snippets. It is rough and susceptible to hacks, but is usable. If people are liking it we can build a bigger better, more secure version.
Please check it out and give feedback! If you have experience building sites like this, your help will be very much appreciated!


+ buttontoken field on the top bar, this is like a secret password. Leave it as public to allow anyone to edit the code. Press the shuffle icon to generate a random token. You'll need to remember the token so you can edit the snippet later. +1 button on the lower left corner of a snippet to upvote it (or -1 to downvote it)by:AuthorNameHere to search code by a particular author#id to find snippet by its unique ID. (ID is shown on upper left corner of every snippet)GET a snippet with this url: https://wenyan-snippets.glitch.me/api?id=666.You can view the source code of the site with this URL:
The site is still in its early stage, I'm sure there's a million ways to break it. Before you do that, please report it intead. Also, don't rely on the storage just yet, I'll try my best not to lose the programs, but can't guarentee that someday I won't accidentally nuke the SQL, so save your work elsewhere too :)
Again, feedback and help are most welcome! Thanks!
You are on fire! Very cool!
For the storage, I think we can consider Firebase
Pros:
Cons:
I have some experience with Firebase. If you find it useful, I can help to integrate it.
Can gltich linked to Github repo? If so, it allows people to better improve it by making PRs.
I'm happy to try out Firebase, people recommended it to me couple times, it sounds great but I haven't got the chance to use it. If you could help it would be very much appreciated!
Glitch can be hooked to Github repo, but I've only used it to merge from Glitch->Github. I don't know what happens if we do it other way around. Will be simple enough to find out.
Since you mentioned using Firebase does not require backend, does that mean we can simply host it on Github pages? That would save a lot of trouble :) I think 1GB is quite enough for text files
Thanks!
Since you mentioned using Firebase does not require backend, does that mean we can simply host it on Github pages?
Yes. Definitely. And for the static site hosting, I would recommend Netlify. It's basic works the same as Github pages but with CI/CD toolings. It can build and publish sites along with commits. You don't need to build them manually anymore.
Glitch can be hooked to Github repo, but I've only used it to merge from Glitch->Github. I don't know what happens if we do it other way around. Will be simple enough to find out.
If we do use Netlify or Github Pages, then the problem won't bother anymore 😄
I'm happy to try out Firebase, people recommended it to me couple times, it sounds great but I haven't got the chance to use it.
Maybe I could start a repo for this and made a POC. If it works perfect, then we can merge into this repo. What do you think?
Sounds good, Firebase+Netlify it is!
Many I could start a repo for this and made a POC. If it works perfect, then we can merge into this repo.
👍, Thanks so much!
I want to say MogoDB , as document based database, seems also suitable for saving code snippet. And the document is just appeared as JSON, so familiar...
@LingDong- Ah, I just realize that Firebase is not accessible in China. Maybe we should reconsider that. (although I think I made some good progress) 😢
This is very unfortunate. I was going to suggest Heroku as an alternative, but apparently that is blocked too according to http://www.chinafirewalltest.com/.
Apparently we might get around with proxy or doing some trick with DNS record. If we want to do that, I already own a couple of domains that we can use, (including wy-lang.org btw, which I'm thinking about migrating to when we have more pages).
Otherwise I think DigitalOcean or AWS might be alternatives, though I'm not sure if they're as convenient or if we have to manage our own database.
The firebase proxy looks promising! Will be back in China next week, and I gonna try it out if I got some time.
Otherwise I think DigitalOcean or AWS might be alternatives, though I'm not sure if they're as convenient or if we have to manage our own database.
For me, I would not recommend this approach. Managing a VPS brings too much complexity for this use case and a paid service won't be a good choice as an open-source project in the long term.
Hope the hacks work.
I prefer to use github to make a snippet site.
I can’t see the snippets (but not the searching bar) when I view on my iPad.
I can’t see the snippets (but not the searching bar) when I view on my iPad.
Just test out, glitch.me seems to be blocked for some reason. Can you try it out thought VPN?
Just for reference, greatfire.org and viewdns.info seem to think glitch.me is accessible in China. Not sure how accurate they are though.


@LingDong- Yes, it's accessible. But somehow /all return 200 with empty data in my region. With VPN everything works fine. 🤯

In order to track down the problem, I added a couple of lines give api to download the sqlite database directly:
http://wenyan-snippets.glitch.me/db
Wonder if this works?
Code:
app.get("/db", (request, response) => {
response.sendFile(`${__dirname}/data/wy-snippets.db`)
})

Not sure if it's due to my poor network. It takes forever to download. But with VPN it takes about 45s.
Hmm.. then perhaps /all is timing out, because of the amount of data that needs to be transferred (at slow speed). Perhaps we first ask for 0-5, after we get it, ask for 5-10, then 10-15, etc. When there are more snippets this is probably a better way in general too.
Indeed. And maybe paginations?
Or perhaps when you scroll down, more loads? So internally there is some kind of pagination, but for users it feels like a continuous scroll?
Also, I'm wondering, if /all is timing out, shouldn't we get a different response header/status code or whatever? Getting empty data is indeed strange.
Or perhaps when you scroll down, more loads? So internally there is some kind of pagination, but for users it feels like a continuous scroll?
Sounds good to me
shouldn't we get a different response header/status code or whatever? Getting empty data is indeed strange.
Yes that's the wired part. And technically requesting thought VPN will be a little bit slower than bare request, but not in this case. So I assumed there was something blocked. Wonder if this is only me. Would like to see more feedbacks from other users.
I mean, I can’t see any snippets.------------------ 原始邮件 ------------------
发件人: "Anthony Fu"notifications@github.com
发送时间: 2020年2月8日(星期六) 晚上11:06
收件人: "wenyan-lang/wenyan"wenyan@noreply.github.com;
抄送: "XingZiLong"2628655535@qq.com;"Comment"comment@noreply.github.com;
主题: Re: [wenyan-lang/wenyan] [ANNOUNCEMENT] wenyan Snippet Site (#472)
I can’t see the snippets (but not the searching bar) when I view on my iPad.
Just test out, glitch.me seems to be blocked for some reason. Can you try it out thought VPN?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
@XingZiLong Just refresh the page (for several times). It works for me.
Most helpful comment
I prefer to use github to make a snippet site.