542 points · by westoncb · 8y ago · 558 comments
What services and technologies do you use when you'd like to quickly build a web app which may never be more than a prototype, but may also turn into something real? A big aspect of what I'm wondering is about automatically setting something up for keeping local/production environments in sync, quickly deploying to production, and not having to mess with a bunch of server configuration things, user accounts, security, etc.
Everyone else here is trying to be stylish and fancy.
Your customers don't care what language it's in or whether the code is beautiful.
No cutting edge incomplete frameworks, convoluted tooling, piles of inaccurate documentation to read, inexplicable cryptic error messages with a bunch of incorrect solutions on stack overflow, or other incompetently over engineered bullshit.
Just go as vanilla, basic, and standard as possible.
True speed comes when you don't have to deal with other people's bugs and poorly designed mistakes.
Don't rely on code written by flocks of people you'd never hire in a million years.
So what, you rewrite a templating engine every time you want to make an application that outputs user data? Or are you reliant on making damn sure you always call htmlentities every time you echo something to prevent XSS? Are you sure you've not slipped up anywhere?
What about CSRF? Do you write your own filtering mechanism every time you make a web app to check for the existence of a CSRF token in all state-altering (e.g. POST) requests?
There are reasons people use frameworks. Security is one of them - I _love_ assessing apps which are written in plain PHP because they're almost always a trainwreck. You don't tend to see SQLi from devs who tend to use ORMs, nor do normally you see stuff like LFI if they're using a well-known templating engine.
Can you write secure code in PHP? Absolutely. But it's more effort and easier to get wrong.
Your client may not care about the technical details, but when the security assessment report says your PHP app has a stored XSS and an equivalent ASP.NET MVC app is safe..
Frameworks are much better at handling most security needs.
I'm constantly shocked and amazed at the beginner mistakes riddled throughout these hip cool kid frameworks. And the dependencies of that code, and their dependencies, and the build system, and the management of the build system. It's a 5,000 hour a week job fixing all that and someone else will just go in and break it again.
So no, don't tell me to stop my life and fix everyone's mistakes. This is why there's 10 person teams to build an ecommerce site these days. This used to be a weekend project before all these slick stylish tools took up everyone's time.
Most people are incompetent and the more complexity you have, the greater your chances of getting crap code tearing your system apart
Why would I use something as a core piece of infrastructure written by people I'd never even consider hiring in a million years?
All too often you're standing on the shoulders of people tripping over their own shoelaces.
No thank you.
It’s totally OK for a prototype to be a trainwreck because its purpose is to give you the ability to launch it in front of potential users, show them a few features and get their feedback.
> True speed comes when you don't have to deal with other people's bugs and poorly designed mistakes.
PHP is often, in practice, a language where bugs are more likely compared to these "stylish" other languages you mention. [0]
[0] http://delivery.acm.org/10.1145/3130000/3126905/p91-ray.pdf?...
" For [languages] with positive coefficients we can expect that the language is associated with a greater number of defect fixes. These languages include C, C++, Objective-C, Php, and Python. The languages Clojure, Haskell, Ruby, and Scala, all have negative coefficients implying that these languages are less likely than average to result in defect fixing commits."
There's nothing less "vanilla" or "standard" with python/go/RoR/whatever vs. PHP. It just so happens that you know PHP well, so, by all means, YOU should use that.
you've understated it.
And while I'm not a huge fan of working in PHP, it has its place— my remark is unrelated to that.
I guarantee someone who knows how to work a framework can turn out the same work much more quickly and more maintainable than someone who is working from Vanilla PHP and having to implement basic logins and email templates on their own. And a "throwaway project" can also be turned into something customer facing much more quickly as well.
I agree, you don't need to pick bleeding edge tech, but you should pick something stable and well documented and run with it rather than basically having to rewrite the same project in the framework once you've got it up and running in vanilla PHP.
Don't get me wrong, I am very fond of sqlite, but to use it efficiently you have to manage the connections to the database and from what I have heard, that doesn't work particularly well with PHP.
This doesn't mean that the above recommendation is wrong (in fact, I used similar approaches in the past), I just thought that it should be mentioned and if someone wants to build something that has a lot of concurrent users by design, he knows which part will be the first bottle neck.
However, I'd personally always use postgres in this case, myself.
Yes, but the person who has to code it cares. No reason to choose the worst of widely used programming languages and the worst possible database for asynchronous read/write patterns inherent to web apps, except as an exercise in masochism.
Oh, you mean javascript?
...it is also why php is not really any significantly better choice than any other framework/language combination.
The benefits of ‘plain php’ (simplicity) disappear quite quickly when you’re doing anything non trivial.
I would never choose php without one of those framework stacks; it doesn’t scale, its prone to hideous security issues and its a fugly mess of reinventing the wheel.
Frankly, anyone doing this these days has no idea what they’re doing.
So there is never any scrutiny, no experienced person is going to expose themselves to ridicule so all the problems are discovered years later only for a new one to take its place.
Ruby for instance has huge deployment problems, why the hell do you need a build environment on deployment and expose end users to installing hundreds of gems that may need to be compiled and can fail anytime? Same with the wild lands of NPM. It's as if people have endless time to go down all the rabbit holes.
On the other hand Facebook, Wikipedia, Wordpress, Slack and some of the most scalable sites online today use PHP. Yet according to the the hivemind PHP is somehow a disaster, and the next over-engineered complexity is the panacea. This is just not credible.
Unless there can be a way to apply scrutiny during the hype phase the cycle of over-engineering, needless complexity and offloading bad engineering on end users is going to continue.
Like Rails, you can get a a site/app up in minutes. .
Throw in the utterly fantastic documentation (that is both more detailed, thorough and better organised) and I'm not sure why Laravel took off the way it did.
I used Laravel for 3 years at a previous job (from 3 to 4 to 5) and I still think Symfony is the better basis for anything that isn't a relatively small application.
Also Symfony components are genuinely de-coupled, documented on how to use them stand alone and useful for that (I gradually brought them in on an inherited project with few issues).
I hadn't upgraded sooner because it had worked, but then due to issues with my stack. I decided recently to start from scratch and upgrade my toolset as well.
So I was deciding to either go symfony or laravel. Laravel won by a huge margin. From the perspective of a newbie. Even though I have 10+ years developing in PHP, I like to debase myself and approach with no baggage.
Laravel has so many more tutorials than Symfony 4 on Youtube. I wanted to learn and very very fast. So going through videos in 2x speed and getting the gist of how things worked was great.
Continuing on, there were many tutorials which had actually built apps using Laravel 5.5/5.6. So I was able to quickly get up to speed using Validation, Eloquent, Passport, Middlewares, Query Builder, etc.
On the documentation side. It's very easy to use and describes simply how to get things done.
Next was that Laravel had VueJS integration. So out of the box, I could have an SPA and use Laravel effectively as an API. Of course, right now I am one developer so 1 codebase is fine. But later on, if I need to split and have two codebases (VueJS front-end, Laravel API), then I can do that.
With Laravel I've gone from writing straight SQL to using the ORM. Which surprisingly for me, reduced my codebase by a significant margin and surface area for bugs.
I have found that there are a lot of Laravel composer packages compared to what I was using before and again makes my life so much easier.
Finally, there is a bit of synergy between Vue and Laravel. For example, I'm able to post a form with Vue using Vee-Validate for the validation. Then get laravel to post back any errors for Vee-Validate to consume. In jQuery and using my old codebase. I had to jump through hoops to get it done and much more code.
I will also say, that I had actually decided to go with Symfony in the beginning. The main reason was that Symfony was more pure and I have developer friends who recommended it as the way forward.
> and I'm not sure why Laravel took off the way it did.
It took off because with Symfony, try as I might. I just couldnt get on with it. It wasn't as pleasant experience with Laravel and honestly. Even if I persisted. The time that I took to go from zero, to duplicating my own stack was a few weeks.
I don't think I could have done that with Symfony. Yes, I could probably achieve the same result with Symfony. But not in the same amount of time.
As still a new laravel developer. I want to be able to deploy new features very fast. I can do this now.
Also it is super flexible too (much like JavaScript and babel) as in you can write strict OOP code or you can write plain php code inside Html in static files.
The second paragraph is correct, but it's just equally correct for Python, Ruby, Perl, Lisp, Shell languages etc., as they all support multiline strings and string interpolation too. The only difference is that you'll have to wrap strings in delimiting markers, instead of code with <? ?>.
Is the 10-15 minutes you might save looking up a quick setup tutorial for the system provided packages really worth the later problems? Postgres is slightly more complex (but pays for itself with additional capabilities), so I can see avoiding that unless your are already familiar with it.
As for PHP, at this point it's not really any easier or harder to get up initially then Python, Ruby or Perl, so it really comes down to personal experience. Whichever one you know best, use it. Whichever framework you know best that has some solutions for what you want to do, use it. That will be quickest.
1. You don't necessarily want to develop in the same environment you deploy to.
2. You don't want to install some things on your development machine.
Together, those are dictating some development directions for you. That's fine. Those are perfectly valid choices. But I think it's easily summed up in your case as "You use sqlite because it fits well with your current development pipeline."
On the flip side, I do development on remote servers using vim. For me, sqlite provides little-to-no additional benefits, since MySQL or Postgres are a package install away (if not already installed), and that's a small price to pay for their additional benefits (for example, a much richer set of data types). At the same time, this type of development pipeline makes certain types of development harder (there's lots of tools for vim/emacs, but some things graphical IDEs provide are harder to achieve).
There is a middle ground, which is emulating the target environment through a VM on the development machine. It should provide the best of both worlds, for a cost of a little most complexity. I've never really gone for that, as I'm happy with the remote dev setup I have, and it's easier not to have to devote local resources to that for me. It's a popular choice as I understand it though.
I'll just let you read this: https://www.sqlite.org/whentouse.html
Why not Python?
I don't get the logic here.
Another thing is that, if it it worse for you, it is automatically worse for the client. I am not sure why it is so hard to see. if your tool is bad, then your work ll suffer, and thus the client. So it is worse for them also..
If you don't like PHP that's one thing but what you said is just wrong.
It's not all bad once you're on the ass-end of history. I'm sure you can easily identify a few negatives being the language de jour bring (such as lots of shitty programmers joining the community all the time). Welcome to middle-age. ;)
No start up became a unicorn because of the programming language they used.
I completely get that other languages have huge benefits over Ruby. Golang being compiled or Java running anywhere, etc... And ruby is slow, totally understood.
But if youre talking about getting a functioning webapp up and running quickly... no way anyone is beating a Rails dev in setting one up. The piping and scaffolding are all built in and the gem ecosystem (for web apps specifically) is so well maintained and robust that you can drop it in to your app and get a functioning product with ease.
I know that's a loaded statement bc Rails becomes not so great in other cases like building speedy backend jobs. But for a small user-facing web app it's hands down the best.
You can always replace the endpoints that are slow with something written in a more performant language like Golang or Erlang later.
I’ve worked on all sorts of applications from corporate CRUD to mobile billing gateways written in Ruby (usually Rails), and in very few cases has Ruby itself been the bottleneck.
Nonetheless, as a junior Rails developer coming into a 5 people team on a mid-sized project, I saw a diverse set of performance problems during the development phase. E.g. asset pipelines that take ages to compile so that rapid development cycles become impossible or a test suite that took heroic efforts to get down to 15 minutes despite not really doing much computationally-wise. I'm open to alternative interpretations, but I've got the impression that in more performance oriented frameworks the best practice would not turn out to be setting up and tearing down half your server stack before and after each controller test, but instead we would have chosen abstractions that can be plugged together more efficiently.
I get that it won't hit Twitter scale but that matches the majority of "how do I build a prototype" use cases.
One really insipid blog post and thousands of mindless followers later and the damage to Rails has been done.
That's not to say Rails doesn't/didn't have other issues -- it did. It's just telling that Twitter is the first example people reach for instead of anything else.
even if it's slow today; the runtime is being improved regularly and making a lot of code just faster with a version bump.
Maybe in an API server. But this is nontrivial in a monolithic application where you end up yakshaving the whole middleware stack to parity just to replace an endpoint.
> Rails becomes not so great in other cases like building speedy backend jobs
Rails is still pretttty good for this. I mean, gosh; maybe not a game engine or something like THAT - but for much of what is done on the web rails can be optimized to complete requests in ~25ms.
> But for a small user-facing web app
"small" as in 95% of websites out there that aren't facebook/google. I mean, shopify handles 80,000/req/sec on a rails stack and they are the backbone of a lot of small (and not so small) e-commerce stores.
Are you sure the complexity needed for it warrants this?
I disagree. Elixir/Phoenix is as simple as Ruby/Rails and an order of magnitude more performant out of the box. Especially if you already know Ruby and the basics of functional programming. Plus, unlike Rails, you probably won't need separate servers for background jobs, websockets and caching.
http://www.akitaonrails.com/2015/10/27/how-fast-is-elixir-ph...
Plus, except for unoptimized database actions (which would equally affect Crystal), Phoenix responses are usually sub 200ms. Some are sub 1ms. So it really isn't in need of performance increase.
Ecto, however, is really not pleasant imo.
Rails has a bit of a learning curve, but that learning curve is well rationalized. To borrow a Steve Jobs-ism: you're starting on the 10th floor, when everyone else is starting on the 2nd floor. Out of the box, you get a killer asset pipeline and complete MVC system that's standardized and conventional.
You can throw together a well built webapp without cutting corners in a fraction of the time doing it by hand. Things like a solid REST API practically come free with Rails. That's really valuable.
The downside is that it's easy to build something while barely having any idea how it works, but if you want something up quickly (or if you already know how things work) then it's perfect.
Or maybe I’m dumb.
Rails makes a lot of decisions for you, but the decisions it makes are the _right_ ones. It's like having a "best practices" box that you can just shove your custom system into, rather than trying to build them in yourself. It's really quite something.
For context: I basically learned Rails by way of building a proof of concept election management system in Rails in about three weeks (more like 1.5 in actual programming time). It also stored votes on a blockchain (ethereum). Even with a relatively complex storage system and interaction model, the Rails best practices left me with a really satisfactory application in no time flat. Perfect for a fast PoC.
My memories of trying to install Linux circa 2000? Not favorable. Though to be fair I was a lot younger then too.
I'm not taking any chips from Rails. Rails was the first and is still one of the best. Just pointing out that there are other frameworks that are designed to move to production fast.
Unless that's changed since I last tried Phoenix, I'd be hesitant to use it in the same niche as Rails.
But I do agree that losing the huge ecosystem of gems is a significant downside. Hopefully that'll change over time, because other than that, Phoenix really feels like the next iteration of Rails to me.
Not to say that Rails apps aren't serious! I'm just saying that the time saved in standing up a webapp with Rails vs., say, Java, is miniscule compared to the develooment life of that application, overall.
In short: you don't save any time at all, in the big picture, and now you have all the long-term disadvantages of Ruby.
> compared to the life of that webapp in all situations where that webapp is anything serious.
Actually there is a situation where the short term life of the webapp matters far more than the long term. That's when you are not sure if there is going to be a long term. This could be a startup, a spike to explore a new business model, or even just a prototype of an internal app.
In all those cases, delivering something that has value in a short time outweighs the value of something that might be more supportable/extensible in the long term.
We should all over engineer our applications by picking the most complicated stack possible because the long term goal may slightly benefit the short term goal of you know.. actually making money out of our business.
Why pick a simple Rails + Postgres stack when you can setup Oracle + Java because you will require enterprise level scaling for your first 1-100k users
Oh and just for the record, I am sure you are already aware but Rails gets you very..very far. Github, Gitlab, Shopify, AirBnb, Basecamp, Groupon,.. I could go on.
My vote goes to rails.
Shower me with downvotes. IDGAF; Ruby is rubbish.
Rails is optimised for fast development. That isn’t just about first bring-up, but about long-term velocity too. You will almost certainly save time over pretty much any other available solution, even over the long term.
Where Rails and Ruby fall down is going to be in performance and complexity. If your “simple” web app becomes a sprawling and complex mess, Rails won’t deal with that elegantly. And if you suddenly have to scale to millions of users, you might struggle.
I guess the orange website isn't for me anymore.
I'd describe my professional experience with Rails as: Rails optimizes for Day 1. Devise is a great example.
But I left Rails when I couldn't help but notice that it tends to break down over time without eternal vigilance. And even simple tasks required me to hold quite a bit of Rails trivia in my head.
These days I'm far less likely to give up simplicity so easily.
IMO it would be almost as good even if the code execution were as slow as Python or Ruby.
There are Tornado and asyncio libraries for Python that give you asynchronous networking. But you have to totally rework how you write Python code within those request handlers to factor out blocking IO which makes using existing libraries for DB and such a pain.
Go is built from the ground up to handle IO like that asynchronously so all of your libraries and stuff will just work in that context.
NodeJS is similar to Go in that regard, but the JS language has baggage that gives you weird blends of callback asynchronicity mixed with async/await and it generally just doesn't feel as nature as Go.
Sometimes a simple request/response model isn't enough. Maybe you need a streamed (chunked encoding) API or WebSockets where the performance for massive numbers of connections using threaded servers is going to tank quickly compared to a language like Go that handles the IO and concurrency better from the ground up.
I usually rip a bunch of stuff out of their default app template and actually get the app doing something useful first before I deploy but it's really easy.
Later I've been enjoying
- a php microframework that slips my mind
- python/flask/sqlalchemy
- JavaEE (yup, except JSF)
Seriously, don’t overlook this combo. Auth just works. Hosting built in, no backend or database server to maintain. No API, just subscribe to a collection right from the view. It just works (and is easily swapped for the real deal if you need it).
I made a guide/boilerplate to show you how (includes auth, CRUD, full text search, stripe subscriptions):
Full pricing: https://firebase.google.com/pricing/
For me, time I’m writing unnecessary code or learning libraries I don’t already know is time I’m not spending thinking about the product. I’m a designer who just wants to ship.
I am open to suggestions though. What would you recommend for, say, auth instead? I’ve tried rails, Django, node/mongo, etc; even hosting a small db on compose.io comes with a chunky base fee, and I still have to do way too much work for user accounts/search/APIs/ORM. There’s a reason Firebase is popular with the yoof.
Change my mind though!
- huge community supporting a codebase initially private
- open source now so you can host it anywhere
- 3rd party online instances to quickly start [1][2]
[0][http://parseplatform.org/]
[1][https://sashido.io]
[2][https://back4app.com]
Sure, but which one? :)
Maybe I am biased because I develop most of my applications in React. But if you don't want to bother with any backend application and just want to get out quickly, build your React application with Firebase. That's how I do it and that's why I also covered my whole boilerplate process in a comprehensive tutorial [0].
- [0] https://www.robinwieruch.de/complete-firebase-authentication...
Now that React is supported, it's even easier for throwing together web apps.
.. what's going to be neat to see is how that "essentially the same thing" changes over time.
deepstreamhub.com is another neat SaaS that's worth looking into for some cases that Firebase might not handle as well ... there are probably yet other SaaS products that cover other specifics and will be still more in the future..
.. obvious mention re. SaaS products is that they could evaporate at any time. warranty void where prohibited. all states except ... idk, AK, for some reason.
>> " Now let's connect our databases to our app by adding their "keys" to our app's environment ("env") files. You should generally keep connection keys like this secret, so first we'll rename our environment files to keep them from getting committed into git (the new filenames are listed in .gitignore). "
https://github.com/sampl/firefly
Thanks for trying it out!
Came here to recommend this myself.
I built an SPA with React + Firebase (auth, db, hosting, and all) to help my wife and I track our kids allowance and spending in just over a day: https://parentbank.actridge.com/ (did I mention Firebase hosting allows HTTPS on custom domains?)
It's an awesome combo that is seriously under-utilized.
Highly recommend.
I should add that on both server and in browser your code base will usually be a lot smaller than most other languages, which greatly speeds workflow as well. As an example I once ported an Elm project to Clojurescript and it was a 4x reduction in lines.
Using Heroku to just git push the project works well too. Deploys in seconds.
If your project becomes more, it all scales well. Clojure is quite fast compared to Ruby or Python, and Heroku scales with the click of a button. You won’t have to port to a more performant language or host if you suddenly get popular.
There are some great choices for the server side too. Plus libraries for pretty much every DB. When something is missing, there's definitely a fallback option in Java.
Plus you get hot-reloading on both sides (e.g. boot-reload and ring-reload). And the ability to bundle everything into one neat jar file so the only dependency for deployment is Java.
Here's a getting started project that I found helpful: https://github.com/oakes/full-stack-boot-example
Because I've been interesting to get an excuse and try Clojure out and what you're saying is really interesting.
Clojurescript offered the first and still (in my opinion) best option for hot reloading via "figwheel" which nearly all Clojurescript developers use. It automatically updates the UI as you code it.
Clojure, on the server, being a proper lisp with a real REPL, lets you poke and inspect and reload parts of the running program with no recompile cycle. A typical workflow there is to reload individual expressions or functions in the context of the running program to alter behavior as you develop.
Can the REPL on the server be used to update production systems with no downtime?
https://github.com/bhauman/lein-figwheel
has that out of the box. As for an actor model implementation, there is pulsar:
http://docs.paralleluniverse.co/pulsar/
Which has erlang-like actors, though some might suggest that core.async and its channel implementation provides everything you might need an actor for, YMMV.
My main interest with actors is that these can be made to support hot code reloading on the server side. They also tend to be easily composable. Also also, they can be optimized by locality (eg. same-node, same-cluster, different-cluster)
I'm biased though, having not worked with CSP or other models.
I'm curious to hear more about this. I'm someone who's used Elm at work, and on the side is interested in Lisp.
If I need a database then I use Postgres, and the setup for that can be a pain, so I get it documented/scripted using Ansible.
If I need something more complex than plain HTML on the client side then I use a Makefile to synchronise Webpack + Babel + React (and the hot reload during development), and the compiled bundle.js becomes another file to copy over.
I realise it's not very 2018, but to be honest I've kinda lost the will to live over learning anything more meta at this point.
Backend: Go (optional embed db: ledisdb / boltdb / leveldb / rocksdb / etc...)
+
Frontend: create-react-app / create-react-native-app
sftp'ing a binary to your deploy target? That's more 2008 iyam...
1. Server side in Go 2. Cross-compiling it 3. sftp'ing and restarting the service everytime 4. postgres 5. ansible 6. Makefiles 7. Webpack 8. Babel 9. React
Cross-compiling with Go is done by setting two environment variables. That's it. This is not like the mess of C++ cross-compiling. In LiteIDE it is simply a matter of choosing Linux from a drop-down: https://www.wut.de/pics/screenshot/e-505ww-07-pide-000.png
SFTP is not exactly hard. Nor is `nohup ./server &`.
From 5 on I agree though - is that 4 build systems? Insanity. I would just make a static web page with normal HTML forms or whatever and Go templates. If you really need client-side Javascript, I'd just use jQuery, or something similar and lightweight like minifiedjs.
I talked about it just a couple of hours ago [1].
Every time I use node and look at his insanity and get depressed.
So, I dislike STRONGLY the use of Webpack and friends. Is a chore because JS is even more nuts now, and everything assume you want node nonsense everywhere.
So, I persist and do this:
I introduce:
> Non non-sense javascript front-end setup with vue
https://gist.github.com/mamcx/1d3aa692b0d34b0fae696c12292a1a...
Using local .js/.css files downloaded from a cdn, then using cat to concat in the correct order all the deps, and finally let to build your css/js as you please for your logic.
Build time is zero after the first try.
P.D: Maybe using unix pipes I could minimify and stuff like that, but I don't need that.
If the website you're building is simple you could even have vanilla html pages then attach vue to the divs that need that extra interactivity, then you won't any fancy loaders.
It can be as simple as a script tag at the bottom of your html and then writing ES5 React.
Also use sqlite to avoid the pain of setting up a SQL server, there is no need for it.
You can then easily get systemd to supervise your binary.
This is how I host all my web apps, the main difference is that I don't use Go but Nim. If you want a great framework match up then check out Jester + Karax, see how I developed the Nim Forum using this combination.
To be fair, cross-compilation in Go is as simple as setting and environment variable.
GOOS=linux GOARCH=amd64 go build
Nim can't beat that.Of course, I would say keeping the source on the VPS is just as easy.
How is docker going to make my life easier in this example?
The whole process of starting a new VM for every little project seems to me like overkill and developing components if you just want to get a prototype out the door can be difficult as the components will most likely have such a poor quality that you can't reuse them for anything else.
With that said, I am 100% pro Golang Server + Vue.js UI when it comes to building something which will be definitely more than a prototype (no shortcuts taken).
Your description would seem good for something management etc has down on paper / a design document.
Heroku has given us a ton of flexibility, and with that we’ve been able to become very opinionated and standardize on one stack. 12 factor design patterns (and the opinions of Django-cookiecutter) allowed us to stop arguing about how to do something and just get it done.
We use GitHub for source control and Heroku Pipelines for CI and testing. Every push runs functional tests, every PR spins up a “review app” with full dependencies and test data.
Heroku Postgres is our system of record database. Postgres is stable, fast, and full featured. With jsonb fields we’re able to store complex structured build log data and quickly aggregate on it. Heroku Data Clips are super useful for quick reviews of the data without building a report into an app.
Heroku Redis and S3 are the only other data stores. S3 stores build results and end user assets, and Redis handles anything in memory. We use Brandur’s transactionally drained job queue pattern (https://brandur.org/job-drain) to defer tasks.
The apps currently all render to plain ol HTML and for the most part take a document centric approach to front end. Additionally, our apps are all API first and we use CoreAPI to create CLI clients automatically. Those are usually our administration tools which help make sure we are API complete.
I just got done revamping my decade-old PHP experience to full OO, and really upped productivity with the Slim framework to build a REST API for our app. I'm using Salesforce platform as the database backend, which is slow but I encapsulate all the business logic there. That's all cool, but, it didn't seem like I was hitting the mainstream of productivity.
Long story short, I'm on the Google/TypeScript/Material/Node bandwagon now. The dev environment is easy, and there's a wide choice of Node deployment platforms. I believe we can get the kind of deployment productivity we want with using a CI pipeline based on Github or Bitbucket that squirts commits to Google App Engine.
For the stack, Ruby on Rails with React.
But my secret sauce is the DevOps:
+ GitLab
+ GitLab CI
+ Heroku
+ Git + Git tags
I also add some magic npm scripts to take care of semver tagging. And with my build:
+ All pushes are tested
+ All changes to master are tested and deployed to staging
+ All semver tagged commits are tested and deployed to production
+ Also, all database migrations happen automatically.
I documented my entire process by building and deploying a sample app here: https://www.toptal.com/devops/effective-ci-cd-deployment-pip...
I started by automating things that would take too long. At first it was taking code from my repository and deploying it to Heroku. Then I discovered that CI services literally gave you servers to run scripts on to interact with your code after a git push, so I started running tests in these servers.
Fast forward a few years and I automated everything except writing and maintaining the codebase.
I even run linting tests in CI so no badly written code can even make it to code review.
Django because that's what I know best. I can code a basic CRUD app (which is basically 90% of all apps I have ever needed to build) in a few hours.
Heroku because a simple procfile and push to a git remote is all that's needed to launch the application.
I think the best piece of advice I would give is to use whatever you're most comfortable with. If you use a new technology that saves you 50% on deployment time, but adds days to the time you need for actual development because you are unfamiliar with it, is not worth it in my opinion.
Deployment/setup takes maybe an hour or 2 for the kinds of basic app I think you're talking about. Development is easily days or weeks. Optimizing deployment over development is optimizing the wrong thing in my opinion.
To implement the server side I typically generate Java JAX-RS skeleton code that can run in Jetty using Swagger codegen. You fill out implementation code and the app is off and running.
On the client side I generate Angular client stubs using Swagger codegen, then fill build services and UI components on top. For CLIs or other tools you can take a similar approach or just write the REST calls directly.
Code generation from an OpenAPI spec makes this process a lot quicker as it takes care of most of the boilerplate code necessary to process REST requests. It's especially helpful for making quick changes and also helps you to get to a stable, easily understandable API which is necessary if you decide to turn the service(s) into a real product.
Docker is incidentally a godsend for systems with multiple services, especially if you work in polyglot environments.
Our company is called StdLib, we're focused on making API development, deployment and management effortless - we're backed by both Slack and Stripe [1].
Frontend will either be React or plain ol' JS depending on how complex the idea is.
Elixir is like if Erlang and Ruby had a child. It's a functional languages, so I guess there's a bit of a curve there. Plus you get stuff like macros, which are incredible, but I thought was some kind of voodoo magic the first time I encountered them.
There's a pretty decent tutorial on the elixir site, and the phoenix site if you want to learn.
As for the learning curve, I didn't struggle with it for very long at all, but your results may vary.
In general, you don't need to know any Erlang to start working with Elixir. In time, as you advance your knowledge and start looking at more advanced features, you'll need the ability to read Erlang at some point, but that's actually pretty trivial: Erlang syntax is one of the simplest/smallest out there. It's much better in this case than it's with Clojure and Java.
The functional nature of Elixir may be a little weird, but, if you're worried about this, it's not taken to the extreme like in Haskell. At the end of the day, you do have a process dictionary (don't use it), and normal IO. It's true for both Erlang and Elixir, but Elixir adds some improvements on top of that: in Elixir, you can re-bind a variable (Erlang has single assignment only), you get the familiar syntax for accessing elements of collections (`coll[:keyname]`), the `if` is "fixed" to be normal if-then-else (the usual Erlang construct is dubbed `cond` in Elixir) and so on. It's FP but in the spirit of OCaml rather than Haskell: pragmatic and striving to be convenient without pulling the users' minds through a monad.
Now, Phoenix is another thing altogether. As far as frameworks go, Phoenix is very well designed, with a couple of orthogonal concepts being composed into a highly functional whole. To be honest, I didn't use Phoenix yet, personally - I did some code review for colleagues, but my own projects are written with Plug for now. Plug is a library which is comparable to WSGI spec in Python plus some additional utils, like in Werkzeug. Phoenix is built on top of Plug, so I figured learning it first is not a bad idea.
Turns out you can get by with Plug (and eventually some "plugs" packages from other people) for quite a while; the experience is like with Flask or Sinatra. You have to know what you want, exactly, but if you do, it's trivial to build a basic framework out of the available plugs. It's actually a strong selling point of the whole tech: as I mentioned, Plug is as much a library as a specification (with the same motivation as WSGI) and it's great for interoperability of components. The whole stack is composable and extensible at the same time, which is not that easy to pull off as far as framework designs go.
Documentation is decent, although its searchability is less so, I had a good time with devdocs.io for the core language and with hexdocs for plugs. It's definitely grokkable, and I'd say worth a try.
Once deployed, the best material on running beam apps is for Erlang, as well as ops tools like recon, and so you'll start learning and using it more then.
The best tech stack is the one that gets the job done FOR YOU, in the least amount of time. If it takes me 4 weeks to learn some arbitrary <INSERT NOUN HERE>.js framework to then be able to do stuff "quickly" then it better cut down development time by atleast +4 weeks to be worth it. No doubt, some amount of Yak shaving is worth it for the future (when you already have acquired a skill and no longer need to spend time learning) but in a scenario where speed of dev is important, go for technologies that you know and are comfortable with (which differs from person to person)
Only general piece of advice I would give is to use SaaS tools to do heavy lifting. Tools like Auth0, Firebase Cloud Functions and authorization, etc can save you quite a bit of time compared to the learning curve they come with. Not to mention these products have teams behind them who work round the clock to make them developer friendly, so if you can't understand and get them running quick enough then IMO the tool is flawed not the user.
Backend in Go, hosted on Gitlab with CI to build it and create a docker image (also hosted at Gitlab).
Server is a plain Debian server hosted on Digital Ocean, with some light configuration with Ansible. A single docker-compose.yml brings up the application along with any service dependencies. Generally I use nginx-proxy with its letsencrypt companion so I can multiplex several docker web services and do SSL termination, all from within the docker-compose file.
Frontend in angular, react, or react native.
This is easy, automated, cheap, and not too exotic. I can host multiple things on a single server if I want, but easily splice them off to their own server later.
Chose them for a client due to built-in CI (as opposed to Github), but the HTTP response time on the web UI makes it painful to use - I'm routinely seeing ~1s response times on pull requests and CI pipelines, not to mention that the provided CI "runners" seem overloaded and your jobs often stay in a pending stage for several minutes (can be solved by running your own instance of gitlab-runner on an AWS box).
Personally I'm moving that project to Bitbucket - they now have CI pipelines too.
create-react-app and aws-amplify gets you really far in a hurry.
I then normally use react-redux, @redux-offline/redux-offline, react-router-dom, and flow-bin.
Examples: - https://gitlab.com/kabo/synchronize-swatches - https://gitlab.com/kabo/hydrant-map - https://gitlab.com/kabo/cryptodo
For more backendy stuff I use serverless to manage lambdas.
Easy as :)
I'm gonna go through your code, thanks for sharing, just wanted to ask in case you have a big picture insight about how serverless auth/security is best done. this stuff freaks me out because i know nothing about it.
The persistence layer is a bit problematic at very small scale (think hobby projects) but if you are willing to spin up a cloud SQL instance which wouldn't be an issue for paid projects, you get an excellent secure auto managed environment.
I work on an open source implementation of it, so I'm always curious to hear about use cases and opinions.
It sounds like deployment is what you want to simplify. While there is extra overhead in learning to use docker, deployment is one of the major issues it solves. I spent a day or two learning docker and docker compose, and now I have a local dev environment I can work in, and I'll be able to deploy to a host quite simply. Makefiles are an excellent, simple companion to docker, so it's also worth learning them.
The big benefit of this is that you abstract your code from how to run it. So today you might like django, tomorrow ruby/language du jour, but all of that would still be built as a docker container which you'd be able to deploy to the same host with minor modifications.
Also, to set up user accounts, create storage buckets, etc check out terraform. The language it uses, HCL, is a trainwreck if you need conditionals, but apart from that it works well and is simple (too simple, that's the trouble). So a combination of:
* whatever web framework you're productive with
* built into a docker container
* with makefiles to ease administrative tasks
* terraform to configure a cloud backend
is a very powerful combination. But yeah, more stuff to learn. At least this approach means you can swap out the web framework for any other language and nothing else really needs to change.
For the front end, I like Vue because it's just react with less boilerplate.
Of course you don't _need_ an ORM or at least you definitely don't need one as full-blown as Django ORM. But I didn't even feel comfortable using any of the solutions I saw that were supposedly the 'best.' And yet, when I went and evaluated the solutions, I do agree they were the best - I just never felt like they were mature enough to really use yet. As far as not using an ORM goes, certainly this is doable, but at the end of the day if you don't want to hardcode a bunch of SQL queries and statements you probably are going to need to write code that will begin to look awfully like ORM code for basic operations...
- JS-Data - https://github.com/js-data/js-data
SQL:
- Sequelize - https://github.com/sequelize/sequelize
- Bookshelf - https://github.com/bookshelf/bookshelf
- Objection - https://github.com/Vincit/objection.js
- TypeORM - https://github.com/typeorm/typeorm
NoSQL:
- Mongoose - https://github.com/Automattic/mongoose
- Thinky - https://github.com/neumino/thinky
Coming from Python world, it's probably for the best that nobody is using ORMs.
It strikes just the right balance between the data modeling approach and query building for me.
https://github.com/Qbix/Platform/blob/master/platform/classe...
https://github.com/Qbix/Platform/blob/master/platform/classe...
The only caveat I’d say is I prefer Roda over Rails for APIs and simple projects.
I suggest you sign up for a free account at https://apex.oracle.com/ to try out Application Express (APEX). It's a free, web-based development tool for building modern, responsive and secure web applications.
It's a mature product that has existed for around 18 years, and it has a long list of features, check out the list here: https://apex.oracle.com/en/platform/features/
Since all these features are built in, you don't need to go shopping for the usual mix of libraries, build tools, external services, etc. For 95% of what you want to build, it's all there already as part of the framework.
The best thing is that you can get started and be developing web applications within minutes on this platform, without writing a single line of code. Even though you start out with no code/low code, you can add as much code as you want and go to any complexity later. The framework doesn't stop you from going "full code".
There's also a great, friendly and vibrant APEX community that shares experiences, develop plugins and tools, etc. See https://apex.oracle.com/en/community/community-resources/
Also, if you are worried about vendor lockin (any more than AWS or Azure or Google or whatever "framework du jour" locks you in), it should be noted that you can download and use APEX for free on your own infrastructure (or a DigitalOcean droplet or whatever). Also, APEX can run on the Express Edition (XE) of Oracle, so you can build and deploy web apps without ever having to pay Oracle a single dollar.
Laravel is a solid framework, and Forge handles the deploys, even going so far as to be able to deploy automatically when you push to master. Plus, you can use Laravel Spark to build an application framework base, with user login, teams, payment, all that written for you.
If you're not able to pick your stack, well, Ansible is pretty easy to learn. You can use Vagrant for the local dev, and ansible-vault for production secrets management. Deploys become a single command line, and that includes when you want to push an environment update.
Laravel + Laravel Homestead (Pre-configured Vagrant VM) + Laravel Forge [2] (Server config + deployment processes) makes my life too easy.
It doesn't even have to be a PHP/Laravel project for this process to really make your life easy.
The Homestead VM has the same services installed and configured the same was as the forge server. Nginx (or Apache), mysql/mariadb, postgres, sqlite, node/bower/grunt/gulp, redis, memcached, beanstalkd, elasticsearch, go, etc
Homestead has pre-built commands to make it very easy to add new sites/projects, does the port forwarding for you, handles the shared folders easily. Forge's UI allows you to not have to ssh into the server for things like restarting nginx/mysql/postgres, 2 click let's encrypt SSL certs, configure/restart queue workers (via supervisord), configure cron scripts and schedules, deploy via git with custom deploy scripts. You can create databases, create database users and manager their permissions. Create firewall rules and manage daemons.
I spend all day in the PHP/Laravel ecosystem so it works for me - but I find myself pushing non-PHP products through the same pipeline most of the time because it's so easy and just works.
1. https://laravel.com/docs/5.6/homestead 2. https://forge.laravel.com/features
It can be deployed on any docker machine with docker-compose.
Absolutely worth the effort to learn how to build a Docker image and put together bash scripts to push the image and update an ECS service. We have a base project which includes nginx and uwsgi set up to simply serve the Django app and static files on port 80.
Having an ECS Docker cluster with spare capacity greatly assists getting new projects up and running quickly, especially if we can run the test site under an existing domain managed in AWS. Then we can just add new rules on an existing ELB and piggy back on the SSL certificate.
With this workflow we spend the time getting a good image running locally (with local environments vars/secrets) and we know the deployment side is taken care of, and can be scaled if and when is needed. This also has the benefit of forcing dependencies and environments to be fully documented from the start (in the Dockerfile).
The next step, if the project gains traction is to move the Docker build/push/service update into CI space. We've moved away from ansible now largely, there's a use case for more complex setups for sure but am interested in K8 capabilities to help there.
Our current setup deploys an env file which is sourced before starting the process. I’m less sure how this translates to a production docket deployment.
My understanding is the best practice for Docker/ECS production deployment is to create Docker images containing the full app build, rather than managing the app deployment separately from image deployment. As opposed to development Docker images that rely on docker-compose to mount the host filesystem in the Docker container, the production image Dockerfile includes COPY instructions for the production build files, to be included in the image.
I've been using this combo in production for https://www.cozycal.com for a year with no problems.
Likes: - More control than hosted environments - Dirt cheap
Dislikes: - More responsibility than hosted environments
I mean... I can start a new project, create some models/tables and relations between them, and deploy it to heroku with admin login and decent interface and file upload... in half an hour?
and... this little project I create in half an hour, can be scaled up to handle tens of thousands of requests a second. Or wrapped with a native navigation and served up to mobile/desktop users, or integrate with any number of apis and services. And I can put it down for 5 years, come back and (almost)instantly know how to continue working on it; development in rails often has a certain obviousness to it. You spend time solving the interesting problems instead of the boring ones.
But the real kicker, is doing it in rails is enjoyable and effective; one person can deliver similar software that takes multiple teams many months to do in megacorps.
I've also had a number of managers hiring for phoenix/python/java stacks tell me they have a hard time finding the sort of developers they like working with outside of rails. I found that surprising - but rails does have a culture of effectiveness and happiness that other stacks do not share.
Anyway, If you have an idea and want to get something working but that can also carry you beyond prototype; Rails is a great choice. A complete development framework, well documented, great community, strong history, designed for enjoyment and effectiveness; that checks all the boxes for me.
static site or React on frontend
Pretty quick to roll out and free to run if the app never takes off. If you need to scale later, you can build your own serverless versions of some cloud services to save money.
Take a look: https://projects.spring.io/spring-roo/
2) Managed Postgres on GCP/AWS
3) Frontend framework of the day, like React or Vue.
4) Take 1-2 hours in the beginning to set up ci/cd (like Circle) to make things 10x more convenient.
Can you expand more on what you do here?
https://github.com/klenwell/hip-flask
For a more full-featured boilerplate kit, see:
Automation requires infrastructure and infrastructure is cheap only if you know how to set it up.
I run ~3 side projects using Heroku to host a Django project with a GraphQL API talking to Heroku Postgres and Netlify the host the ReactJS frontend. I serve the API on heroku's free domain and put the react project under app.projectname.com and use token auth to talk to the API.
Deployments are super simple. Including updates to and managing the database.
However I am making a shift to using D so I am learning DiamondMVC which is inspired by ASP .NET MVC and takes full advantage of Vibe.d and all the rest of the D ecosystem is available to me as a result. If I need something done in a weekend CherryPy and Mako with any DB.
If I wanna get something quick that I wont have to worry too much about scaling then D with Vibe.d or D with DiamondMVC is great. The best part about D is there is no crazy learning curve like Rust and it is very highly performant. Also the VS Code plugin is nice enough to make me productive enough.
Every hour a developer spends learning a new language/stack/framework hotness is an hour that could be better spent studying something real, like mathematics, CS fundamentals, or UI design.
Now I’ve firmly put myself into focusing on one or two languages and learning them well, even as the “newest kid on the block” comes around that claims to want to replace every back-end language under the sun. It’s allowed me to focus on things like design patterns, integration development, and learning about infrastructure and good architecture principles, which I feel have added a lot more value than listing fifteen different “hot” skills on my resumé or whatever. I’m also a lot happier not having constant development information overload.
I get that keeping up with trends is a good thing to do, but sometimes you need to just ignore the chaos going on and plant yourself in one ecosystem for awhile just to take a breather.
frontend hosting: surge.sh (free)
backend: node + socket.io (usually on a separate domain with CORS)
backend hosting: heroku (free)
database: MongoDB
database host: mlab (free)
everything in TypeScript, of course, because when you're in a hurry, you simply don't have time for your code to not be typesafe! (actually though, TS is a maaaaajor time saver, especially for smaller projects!)
My opinion is that when you're starting out, just go with a PaaS like Heroku. You can simply maintain a separate dev/prod branch and it'll automatically update the server.
All the issues you mentioned can be solved it just takes some investment somewhere (time if you do it today yourself / money to pay a PaaS or someone else to do it).
We personally use Kubernetes to solve these issues since we get stateless builds and simply have environment variables that change things like database connections, api keys, etc between our various environments. But again this took a few weeks to setup.
https://github.com/diesel-rs/diesel/tree/master/diesel_tests
Now, every time I alter application code and/or SQL migrations, I immediately test them together automatically.
If you're into that, or have CPU/RAM requirements that would be prohibitively expensive on Heroku then give it a try (I run it for a couple things on a cheap but powerful dedicated machine). If you're just doing something simple it's probably not worth it, just get a hobby dyno and go that route.
You can embed the Vue js file in your page, add <script></script> and you're ready to get started, no limits every feature is available. Of course for anything other than the most simple stuff you'll want some structure in your app so I use vue-cli which sets up the basic stuff.
- Cloud functions
Can be as simple as writing one in your browser in the azure/GCP/AWS console and as "complex" as using for example the serverless framework to deploy.
That's it!
Backend:- Spring Boot with Kotlin
I must say I am so impressed with what Pivotal did with Spring Boot. It’s amazing.
With Bootstrap and Devise (auth) and many other ruby gems / npm packages, we can prototype a project extremely quickly with this stack by simply following the conventions of the community and trying to avoid writing too much custom code.
The run part became easy the last few years: Dockerize all the things, run them on AWS ECS with Fargate (and add whatever else you might need, e.g. ELB, S3, SQS, ...), no servers to setup or maintain.
The built part, that actually became harder... You need to figure out the best tools for whatever problem you're trying to solve, and the list of tools keeps growing. I default to very conservative standards, because I'm familiar and productive with them: Java (Spring Boot), Vue.js and PostGRES, with sometimes a bit of Node or Python and some ElasticSearch or DynamoDB thrown in the mix.
Cloud Backend: https://cloudbackend.appdrag.com and Cloud CMS: https://appdrag.com
It's a fully serverless solution, nothing to install on your side, you can do everything in the browser directly. and we have a free tier :)
Also we have no lock-in, you can export everything in a ZIP, static files, db backup in mysql format, API source code in your language (Node.js, Python, Java, C#, Go, ...)
Been using that to host small projects here and there of late. Works well for keeping the app 12factor, and worry less about Devops
I like it because it allows me to get started without thinking of any build steps.
Set up your bare repository at say /root/myapp in your cloud server then clone this to your local dev area. Then clone it again to your cloud server django directories say /web/myapp . Finally git ignore you settings.py file so it can be different in each server.
This can actually scale up to reasonably sized prod/test/dev/local_dev cloud server setup by using appropriate branches though I know the traditionalists would be squirming in their seats.
It's now a viable option.
That said, never mind 2018...there are a whole load of joys (and horrors) that fresh devs these days won't ever really understand the same way because nothing like Docker or Heroku existed even just a decade ago.
You know, paying £3 a month for a shared hosting plan with 100MB disk space, and PHP4, phpmysql, Apache at your disposal.
Downloading FileZilla and deploying by dragging and dropping the new folder into the client, making sure to overwrite.
Debugging by using the same client to edit files and add logging in production.
Having to write htaccess rewrite rules for 'pretty' URLs that any developer today will think is just default behaviour for a web framework.
Having to use SVN and CVS, if using version control at all...
It's not like you can't still do any of this, it's just that dragging `index.php` into an FTP client isn't the default advice for deploying a simple site any more. For better and for worse.
I don't know how you guys did it 10 years ago, I couldn't even last 2 weeks with that system
If you need an ORM and you don't need any interactive views then Django is a good choice. (Interactive views are views that are stateful in the browser: an interactive graph, an interactive table, a To-Do list, etc.)
If you need interactive views then you'll have much easier time using a React+Node.js framework such as Next.js (https://github.com/zeit/next.js) or Reframe (https://github.com/reframejs/reframe). And if you need an ORM you can use one of the many Node.js ORM such as https://github.com/typeorm/typeorm
If your site is static then go for a static site generator such as https://github.com/nozzle/react-static. ("Static sites" are webapps/websites that are HTML-static: The HTML doesn't need to be dynamically generated at request-time but is static, no server is required, and your app can be statically served.).
Disclaimer: I'm Reframe's author.
Pre-built LXD image with MariaDB, nginx and PHP. Git for deployment.
Provisioned and live in three seconds with support for rollbacks, migrations, atomic updates and zero downtime.
Should work well for most other scripting languages too.
It allows me (and the teams I work with) to go from clean Linux to web app 5 - 10 min while keeping best practices and allowing the system to scale.
It's all based on Docker and Docker in Swarm mode clusters (setup included in docs) Backend with Python Flask Interactive docs with Swagger/OpenAPI HTTPS automatic handling with Let's encrypt handled by Traefik Asynchronous tasks with Celery Front end with a modern SPA (Angular, React, Vue) Relational DB with Postgres, although I'm also using a modified version with CouchDB (I'll create a project generator with that later) CI/CD intergraded And more stuff...
I'm all for having choices and I'm glad we're beyond choosing between FrontPage, Dreamweaver, and Notepad, but no wonder new people to web development are so overwhelmed.
If I don't need a database (or any persistent storage) I use Zeit Now, deploying Python apps (Django, Sanic or Uvicorn) via a Dockerfile.
re
>A big aspect of what I'm wondering is about automatically setting something up for keeping local/production environments in sync, quickly deploying to production, and not having to mess with a bunch of server configuration things, user accounts, security, etc.
The config, accounts default to secure useable stuff
Auto is sync doesn't really happen but its a matter of clicking "pack all" on local web2py and then "upload" on the one on the server.
On the minus side it doesn't have that many users.
Plus almost all websites are a kind of web app. And these have a complex backend for managing the content. While we browse the front end.
1. npm install -g now
2. run 'now' command in the folder containing your app files
The files are uploaded, your app is deployed and your clipboard contains the URL. So simple it's like cheating.
On the other hand if you're willing to ask for help there are plenty of freelance IT admins who would set up a digital ocean box with the DIY equivalent of Heroku.
I have read similar comments to the ones here about scaling and cost, so I might bump into that at some point.
Leaving a box with no monitoring and no on-site skill capable of fixing it is a bad idea. That box will explode at some point and it's going to explode at the worst possible moment, and you'll loose tons of business (and/or data) while you scramble to get someone to repair it.
Unless you have people ready to jump in and fix it should it break, don't risk it and just let Heroku handle it.
I think the main competition for Heroku these days is AWS and GCP. The workflow for deploying directly to managed cloud services has improved drastically over the last few years, so you might not need the niceties that Heroku offer.
Also, just because you use Heroku for your app servers (dynos) doesn't mean you have to use it for everything.
The piece I wouldn't mind cutting out is heroku. If you do end up going the docker route, docker-machine is nice for being able to quickly put things up, "push" updates to digital ocean:
Once you scale you can look into doing it manually with AWS when the cost savings start to become worthwhile (Heroku ends up being quite expensive for high traffic).
VueJS
Surge.sh
Firebase (if there's a need to store data)
I think I already have a pretty established workflow when starting things up, due to numerous stuff I have built previously. Hence, the process of doing things multiple times (and making some tweaks to along the way) seems to make it really fast and straightforward.
My take is that just do repetitively what you feel comfortable at and at some point, you will reach a level where everything feels so easy and natural.
or
Google Cloud free tier, Google App Engine running node.js, google cloud storage for static files and stuff or basic web page hosting
both are git-compatible and deployments are as easy as : "eb deploy" or "gcloud app deploy"
for front end stuff, if its just a prototype i just copy a bootstrap 'live preview' design that i like, and jquery stuff together.
Here's the simplest operational approach that I have yet found. Use Amazon RDS to run PostgreSQL as your production database. Architect your system to be one, static binary that is its own web server, contains all web assets compiled in, everything. It takes its configuration from a very small number of environment variables.
Start a CentOS VM. Copy the binary to it. Write a systemd service definition that sets the appropriate environment variables and runs the service as a dynamic user (so you don't have to worry about setting up accounts on the VM). Copy that definition to the VM and run `systemd daemon-reload` to make that service available. To deploy a new version, copy static binary of the new version to the VM and restart the service.
That glosses over lots of details, but it's your starting point for thinking about this. Every deviation adds operational complexity and has to pay for itself in reduced effort elsewhere.
waxx deploy stage or waxx deploy prod
The deploy script can be as simple as:
cd /path/to/folder && git pull && waxx migrate && waxx restart
Disclaimer: I am the author of Waxx and I wrote it to be as simple as possible yet still high performance and flexible.
I can now take a bare VM image on DO/AWS to a fully functioning Django app.
I ended up modifying: https://github.com/jcalazan/ansible-django-stack
If you only need a static site though I have used Cactus but Jekyll could work.
I know cost is on peoples minds so why not serverless? Haven't seen anyone mention aws lambda or gcp cloud functions. You get a massive free tier , like 2 million requests and free db...
Anyone doing this?
For $0 and less than 15 minutes I can spin up an ASP.NET Core app with Angular 6 with a free private git repo in VSTS. CI/CD fully setup to deploy to a free Azure App Service, for a few extra bucks per month I get deployment slots to separate out my dev/test/prod deployments. LetsEncrypt for SSL. Another $5 a month I get a fully managed SQL database that connects with my built in ASP.NET Core Identity to manage user logins, forgot passwords, etc. Auto-Healing, SSL, Backups, Geo-replication, AutoScale, DNS, CI/CD, cross platform IDEs, and feature/bug tracking are all included. So if my app gets hot I just pay more money to allow it to scale up and nothing else on my stack has to change.
All this in 15-30 minutes from my MacBook without fooling around with docker files, virtual machines, or Kubernetes.
http://readevalprint.tumblr.com/post/101841449553/its-alive-...
But I already know this stack and I already have a server setup that can just let me fork a new app into one of the subdirectories or subdomains. If you want something public facing, there are only so many corners you can cut as being pwned is much more embarassing than having a prototype crash and burn during a demo.
Frameworks are good in that they let you make something fast + powerful without having to worry about alot of the details once it is setup. The problem is you have to tackle the learning curve for the setup. Finding something with good documentation is the best way to handle this even if it takes more work to learn than you want to spend on a "throwaway" project.
Hence I am using a home-brewed stack on Express (Node.jS) + Nuxt (Vue.js) + MySql + Google App Engine.
This is based on Xmysql - which is absolutely a zero configuration way to derive REST APIs.
Xmysql : https://github.com/o1lab/xmysql/
I plan to make internal framework open source in coming few months.
It has built in features of regular frameworks + Authentication + Authorization + ACL + Payments (Stripe) + Microservice (google-cloud functions) + Pubsub (background jobs)..
$ up Create Ubuntu VM (with applicable config (ssh keys only, automatic security updates, turn off cruft)
Install dokku
Install PostgreSQL plugin for dokku
Install letsencrypt plugin for dokku
Create app in dokku
Add remote in git repository locally
Add buildpack triggering things/stuff to let Django run in this environment (gunicorn, collectstatic stuff, etc)
Git push dokku
Edit: formattingIt's very fast to scaffold a new app, with diverse options you'd want (react/vue/other stuff). Host it on github, create a heroku app and push it.
[1] https://devcenter.heroku.com/articles/github-integration
It also helps that it is an extremely fast framework. https://github.com/tbrand/which_is_the_fastest
Other frameworks like router.cr, Raze etc are faster performing, but getting started with a db middleware etc will take a bit longer.
Because the site needed a unique brand look n' feel, I opted out of Jekyll and used Foundation 6 as a base and node-sassed my styles with npm scripts and custom svg:s. For cache-busting I run hashmark with postbuild. Then I just write HTML.
Development is easy, things work nice, site is very fast and it looks great.
Moral of the story: starting with just static HTML and CSS is the right choice a lot of the time. Don't complicate things before you need to. And when the need to, only make dynamic those parts that can't be static.
Also look into Bubble for really quickly getting something up and prototyping an idea.
I wrote this about my experience.
https://medium.com/@mendoza.paul/sigparser-creation-story-bu...
The first thing I do is update them to the newest versions on the basic website, save that as my new cookie-cutter, then make the website.
I had another idea last Thursday and had a prototype completed by the end of the weekend. WordPress takes care of ORM, routing, user management, admin and most of the features every web app requires. This leaves you to develop the actual unique selling proposition.
My specific Go toolset consists of the following packages:
* urfave/cli
* gorilla/mux
* html/template
* keyselhightower/envconfig
* database/sql
* rubenv/migrate
The only downside I saw was learning a bit of cloud formation to automatize the stack creation. But I guess if you want a quick prototype/deploy you might as well do it manually and learn it later.
I really recommend you to take a look at AWS's serverless products: https://aws.amazon.com/serverless/
> django-admin startproject > copy+paste my webpack config for React > copy+paste my general management scripts into the package.json (mostly scripts to build the client, and if working locally also start a server)
Then if I want to deploy it, I just install nginx and gunicorn and again copy+paste my configs for those.
If I want to use mysql it's not too much trouble, takes 10 mins to get it up and running and my application hooked up to it.
If the webapp takes off, I can figure the rest out later.
I haven't actually used it but looks pretty cool
1) not everyone is a start-up. Established businesses also hand to put up web apps
2) you can use it for free with some limitations
3) Some other cloud services can work out quite expensive defending on your use case. Vs a Linode bare metal server, yes it is pricey, vs Heroku maybe less so?
The only challenge is setting up the appropriate infrastructure for deployment. Fabric works well for that.
I'm used to React.js and TypeScript/GraphQL server on the backend. I would use Netlify to quickly deploy React.js and Apex Up to deploy the server to AWS Lambda. Apex Up doesn't really use AWS Lambda in the normal way. It will create a reverse proxy and each AWS Lambda function is like a mini server a la Heroku.
2. create-react-app for front-end
3. digital ocean for hosting
I just cp files from local to server and use a couple different bash scripts for dev vs prod.
My first prototypes tend to be in create-react-app with session-storage (state dies with browser session). I publish this as entirely static content on Amazon S3 (via CloudFront).
After that if the use case seems solid I choose the appropriate tech for the job
I'll say though, surge.sh is the fastest way to get up static sites and zeit is the fastest way to get up webservers. One command to deploy without any configuration and you're done.
My first prototypes tend to be in create-react-app with session-storage (state dies with browser session).
After that if the use case seems solid I choose the appropriate tech for the job
API: flask + MySQL / Redis
UI: create-react-app
Use docker pre-build instances for MySQL or Redis or Nginx
If you have extra time in hand
Nginx --> flask
- is azure beginner friendly, for someone who has never done web app before?
- how does azure pricing and support turn out compared to other services mentioned around here?
- would it be easy as well to use PostgreSQL or some other database?
I wrote a short buildscript for that setup that i copy.
On the development side, I still think Rails is an excellent choice, but I also felt a lot of the same pain you're expressing, but instead of with server configuration, I started feeling it more specifically with the redundancy of putting together the same libraries over and over for each app.
To try to revive the joy of creating new projects, I created Bullet Train (https://bullettrain.co), which I describe as "Rails on Rails". It's an app template with authentication (Devise), authorization (CanCanCan), subscriptions (Koudoku), teams, invitations, OAuth integrations, etc. all wrapped in a consistent theme with a full feature-level test suite.
It also has a powerful code generation/scaffolding engine for pumping out CRUD views and controllers for the web, API endpoints, API documentation, and soon it'll handle your Zapier integration as well. (Posted a demo video of this here at https://twitter.com/andrewculver/status/934251715175395328) It also has a thin layer of conventions on top of vanilla Rails, like namespacing the public vs. account sections of an app. It's stuff that most of us were doing previously, just slightly different from app to app, and this is an attempt to standardize so we can build other magic on top of it.
As a demo, a few months ago I used Bullet Train + Heroku to build and launch a simple Trello clone in two hours: https://bt-cardboard.herokuapp.com/ . It's limited, and I haven't come back to it since, but I thought the end result was a powerful example of what you can get done quickly when you're using the right tools. (I have a video recording of the entire process which I'll upload to YouTube if anyone is interested in seeing it.)
Anyway, I wouldn't normally peddle my wares on HN, but the whole point of Bullet Train is to try to achieve new levels of developer productivity and happiness, which seemed relevant to the question you were asking. There's nothing quite like this in the Python world (I'm frequently told by Python developers,) but there probably should be, and I imagine it's just a matter of time before there is.
Really basic (dynamic) stuff: Python/Django, straight up HTML/CSS
Static - Html/CSS with a sprinkle of vanilla Javascript.
If it is a complete web app, then Create React App (or React + Parcel) + AWS AppSync
- It's instantly deployed
- Supports GIT
- Automatic npm installs when editing package.json
- You can access your virtual environment in an browser CLI
Yes Ember is still great. Ember data has gotten bloated though so I say pull that shit out IMO unless you are really used to it.
Ember v3.0 is all modular now, so you can just strip out modules until you get down to Glimmer. Versus React or Vue where you start with basically nothing and build upwards.
Exact opposite philosophy, but way faster for building 90% of CRUD apps.
ember and rails are SUPER optimized for rapid development. You don't have to spend the next 3 weeks configuring a React app so it builds right :) . Not to mention the next time you do it, it will be different :).
I presume that some of the fancier new frontend options would be an easier way to consume a vanilla RESTy backend. Doing things this was also has the benefit that I can just hire somebody to write me a new frontend, since that's not really my forte.
Build a client, write your routes and your good to go. Also scales really well.
deployment with Docker which makes is easy to go Kubernetes if things scale up.
mvn install; eb deploy
Absolutely LOVE Django cookiecutter.
deployed on aws or lightsail
We exclusively use AWS Lambda, DynamoDB or if the app is complex, we use Amazon RDS.
For search - AWS Elasticsearch
Our preferred stack is Go + VueJS.
WHY GO?
It's much easier for our senior developers to ramp up a team of 10 developers on Go than say Python or Ruby. Suprinsgly, we have a few guys who are Go experts, they unblock all other developers when it comes to best practices or some weird bugs.
WHY VUEJS?
It's has been a lot easier for us to introduce this to our frontend developers than any other thing.
WHY NOT RAILS?
We found it difficult to make SPA apps in Rails and ramp period for developers is much higher than Go + Vuejs.
WHY NOT PYTHON?
I loved Flask but we really need Type checking, we are not able to sleep without it. And Go has enough of what we need. Yes, we've briefly experimented with Haskell, OCaml, Scala etc.... but way difficult for new devs.
WHY NOT JAVASCRIPT BACKEND?
We found it much easier to write backend code in Go.
IDE/DEBUGGER
I am a pro-VIM user myself but it's so refreshing and fun to watch new developers speed up on Gogland IDE and the debugger makes developing in Go much easier. This is something only old languages like Java or C# has. It's way more difficult for new developers to pick up Java or C# in our experience. They've way more features which our developers found confusing. So, Go stayed everything else was thrown out including Haskell.
VUE CLI
We use https://github.com/vuejs/vue-cli No it does not require deep knowledge of webpack. There are just a few guys on our team who knows webpack/vuejs/javascript inside out in extensive details, rest of the developers simply use their custom designed/documented template and it satisfies 100% of our frontend needs. They unblock everyone on our team if any developer gets stuck with webpack.
DEVELOPERS ARE OUR BIGGEST COST
Keep in mind, we do not have access to the best developers at the budget price.
TRAINING
We give new developers as much help and training as they need. Our developers can call the pro guys anytime (even on weekends) and our senior developers love the respect/rewards they get in return.
COST
AppEngine costs $30 a pop, for 90% apps which receive less than 100 hits a day, it's expensive. This is where Lambda wins.
CI
Multi-tenant CI is still a pain in 2018. Current workflow with Gitlab sucks. We wish we could have a simple file in our repo and make 1 curl call to run the CI without any initial setup. But it will eventually happen.
PAYMENT PROCESSING
If the SaaS product needs multiple payment methods like Stripe, Braintree, PayPal Bitcoins, Ethereum, Wire Transfer we use http://killbill.io/ which is multi-tenant, opensource and self-hosted. Previously, we were using WHMCS, Amember pro, and Chargify but it ended up costing way more and was a lot more fragile at the end, completely failing monkey wrench test and our new developers found it much harder to wrap their head around 3 different products. A customer has to simply enter their API credentials for the respective gateway (Stripe or PayBear or BitPay) and we integrate it in minutes.
BIGDATA
If we need complex large aggregation, we haul in Athena or BigQuery.
Our developers prefer BigQuery but Athena is sometimes cheaper in the long run and makes it way easier to import/partition your big data.
STREAM PROCESSING
If we need anomaly detection or preprocessing of statistics we use Kinesis streams.
Because of this setup, we primary run on an army of bootcamp graduates and we are able to provide really cheap service to non-profits and other companies who are not able to afford even a dedicated freelancer.
FORGET VALUE, WE WANT TO BE CHEAP
"Cheap" is a wrong word to use as a marketer/sales guy. But yea, since I am now in technical position, so I remove sales guy hate and wear tech hat, making our creation as cheap, robust and secure as possible while still satisfying the requirements.
WHERE IS THE FUN
We drive our major profits from AdTech business (which involves stressful high tech stuff but it's lot more fun) and consultancy is just to validate our solutions across a large number of our portfolio customers. We've to ensure, their setup is as cheap, robust and secure as possible.
IMPROVEMENTS
As I want to improve my strategies and methods as much as possible, feel free to challenge my choice. It should not just work for 1 developer but an army of developers and it should make it trivial to add more developers.
With Go, are you using off-the-shelf web frameworks or libraries or do you have your own in-house framework/template?
So you said you're deploying 5000+ web apps a quarter. Are those new web apps? How many web apps are you deploying per dev head count?
No frameworks. We use http://www.gorillatoolkit.org/pkg/mux and sometimes we need a few more libraries for GWT/ElasticSearch/PostGres. I know there more performant options but we've found no reason to change so far.
So you said you're deploying 5000+ web apps a quarter. Are those new web apps?
Yes, 70-80% of them are new apps. Small apps, not multiple month project, mostly CRUD. Much easier/faster and cost-effective for us to develop what we've already done. OId app usually requires adding few routes and shuffling around the frontend elements or adding some small CSS tweaks. We use a simple list to accept/reject projects. We never undertake any complex project.
How many web apps are you deploying per dev head count?
These are small apps. We've 1500 developers in a very low-cost jurisdiction.
>12 Months Committed Agreement at £15,000 for 150,000 Software Units and 100 active users
Seemed steep for 100 users.