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

any open source website & demo power by sanic? #292

Closed
decemer opened this issue Jan 13, 2017 · 14 comments
Closed

any open source website & demo power by sanic? #292

decemer opened this issue Jan 13, 2017 · 14 comments
Labels

Comments

@decemer
Copy link

decemer commented Jan 13, 2017

any open source website & demo power by sanic?

@pahaz
Copy link
Contributor

pahaz commented Jan 15, 2017

it would be nice to have examples project in README.md

@pahaz
Copy link
Contributor

pahaz commented Jan 15, 2017

https://github.com/HackerDom/ructfe-2016/tree/master/services/atlablog -- It is web-service based on sonic. It was developed for hacker competitions. It my be helpful for education purposes.

@foodaemon
Copy link
Contributor

foodaemon commented Jan 22, 2017

http://securitynode.com Internal APIs are powered by sanic. Public API will be released soon as this site is currently under development. DISCLAIMER: I am the developer/owner of the site.

@decemer
Copy link
Author

decemer commented Jan 23, 2017

it seen like flask, can it use flask plugin add on?

@seemethere
Copy link
Member

@decemer No unfortunately while sanic may seem similar to flask in it's outward facing api, it's internals are very different, leading to incompatibility with flask plugin add ons.

@zkanda
Copy link
Contributor

zkanda commented Jan 24, 2017

We use sanic in our event push notification because of it's speed. And there's no UI so I can't showcase it.

@luizberti
Copy link

luizberti commented Jan 25, 2017

I wrote a PasteBin clone a while ago, as a Flask demo project. I might make a Sanic fork of it if there is interest, but I could use some seasoned feedback in it, given that I have not used Sanic and asyncio extensively and will probably result in some bad usage practices.

Edit: I just finished the bulk of the refactoring, you can see it here. It's currently broken for reasons I am currently too sleep deprived to figure out why (for some reason Sanic is not reading the contents of the form and says it didn't receive any).

If this turns out better than it's Flask counterpart I might just host it under http://api.cbeam.io/ where the flask version currently lies (or have them running side by side), thus fulfilling the motif of having an open-source website operating with Sanic.

Sidenote: There is still no front end in that domain, so you'll have to do requests from the command line.

@vovs03
Copy link

vovs03 commented Jan 26, 2017

Luizberti, the link http://api.cbeam.io/ is wrong or broken and browser get 404.

@luizberti
Copy link

luizberti commented Jan 27, 2017

@keyjoo as I mentioned in the sidenote, there is no front end on it (yet).

You can go to http://api.cbeam.io/ping to see that the Flask app is really running.

And if you have httpie installed you can use it like:

http --form POST api.cbeam.io/submit Accept:text/plain content='something'

http GET cpi.cbeam.io/<pasteid> Accept:text/plain

@luizberti
Copy link

Update on the Demo Project

I just finished rewriting the Flask demo in Sanic's lingo. The benchmarks against the old version are insane, beat Flask+Gunicorn by a whopping margin (did 760k requests in the same amount of time Flask took to do 16k on a single core). I have a feeling that if I switched to aioredis too performance would go bonkers, but this is good enough for now.

The whole thing is done in roughly 80 tidy lines of code and it reads nicely. Right now it's up and running at http://api.cbeam.io/ and it has replaced the Flask version entirely. I would like some feedback on it if anyone would care to take a look, if you can think of any other use cases I could add that exemplify other features of Sanic feel free to open an issue in the tracker.

Hopefully this can help newcomers get goin' faster faster 😄

link: https://github.com/luizberti/codebeam-api

@jasonab
Copy link

jasonab commented Jan 29, 2017

FYI, I've tried this as well, and aioredis murders my performance. I have one system that does event logging to disk that runs Sanic, and it has insane performance. I tried porting my API gateway to Sanic, and it's terrible - almost all because of aioredis.

I posted a question about this to the uvloop GitHub (MagicStack/uvloop#73), and they basically said the structure of aioredis will kill performance. I also considered aredis (https://github.com/NoneGG/aredis), but their benchmarks show the same thing.

Having said all of that, if you can make this work at a level above Flask, that would be awesome. Just letting you know that it might be out of your control without rewriting aioredis.

@stopspazzing
Copy link
Contributor

Another example:
https://github.com/stopspazzing/Sanic-Server-with-MDL-Blog-Template

@stopspazzing
Copy link
Contributor

can we close this or: #396 ?
No need for both

@seemethere
Copy link
Member

Closed in favor of #396

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants