Show HN: Amplication – Instantly Generate Node.js Apps with GraphQL and REST API
github.com
github.com
We built Amplication so that developers like us could focus on coding the parts that really matter, rather than get distracted by undifferentiated heavy lifting. Amplication is an open-source tool that lets you design your data schema and in return it generates for you a human-readable and editable TypeScript Node.js codebase. This server codebase includes a GraphQL API, REST API, authorization, authentication, admin UI, users management, logging utility, error handler, and much more right out of the box.
we generate your server code dynamically based on changes in your schema. You can download the generated code or continuously push it to a GitHub repository to continue off and edit it further on your own.
For your convenience, we use a web UI to manage this whole operation and it is available for the community as a managed service on https://app.amplication.com, or you can run your own Amplication server. I’ll be more than happy to answer any questions you may have and get your feedback.
https://app.amplication.com/ckjuaxw2518112510s6qfb0xi8q shows {"statusCode":500,"message":"Internal server error"} for code download, and has been waiting for a sandbox environment for a while.
But I'll be back to try it again in a few days :)
How do you solve merging the modified codebase with a freshly generated ones? Let's say I need to add a new field. Do you rely on GIT for this?
Also, the readme could use a link to a sample hello world repo that this Amplication generates.
Meanwhile, we let the developer manage the merges in GitHub
When you sign in to app.amplication.com you get a simple sample app with your account
Seriously taking a look, this looks promising. We built an app on AppSync and Cognito and I want to get off AWS so I'm looking for alternatives, and this... fits the bill.
At XgeneCloud[1], we are after the same problem.
XgeneCloud provides a desktop app that can connect to any new/existing databases to instantly generate REST & GraphQL APIs.
(Supports MySQL, Postgres, SQL server & SQLite)
Happy to share notes on discord.
Could be only me, but if not, maybe change that?
I'll take the one/two days to set up node, express, postgres with libs for now. What takes up the majority of the time is domain modeling anyway.
I only made the switch a couple months ago and it's amazing how cozy I am with it: everything feels mature, stable and reliable. I reach out for 3rd party packages as needed but it doesn't feel like I'm gluing a Frankenstein together, or that I'm rolling out a bunch of code I don't want to own, or that I'm overthinking for the umpteenth time how I should structure my app. I think after a couple months with Django I'm nearly as productive as I ever was Node.js. Granted that many web dev concepts just carry over, but the feeling is uncanny regardless.
Also, the "language context switch penalty" is a complete myth. I picked up Django by reading two books in 2-3 days, and didn't need to even bother front-loading Python - I just picked it up as I went. I now switch between Python and JS/React seamlessly; I enjoy writing both and I really like the variety (though as dynamic, duck-typed languages maybe they're not that dissimilar). Every thousand characters I type in Python I'll make a silly mistake where I write some JS syntax and that's it - hardly what I'd a call a cognitive penalty.
As it stands, I'd only develop something in Node.js if I really needed its performance characteristics (and then, I may be able to get close to them with Python's asyncio - though I haven't researched this avenue yet so there may be pitfalls I'm not aware of).
All in all, I find it baffling that in over a decade of existence Node.js hasn't produced a web framework that even comes close to Django or Rails.
I do wish OP, Nest, Prisma and all the devs in the Node ecosystem the best of luck nevertheless. I love JavaScript and if someone produces a web framework that really emphasizes developer productivity and happiness I would consider coming back in the future.
Now if only it came with all batteries included, and the DI wouldn’t be so funky, it would be even better, but it’s still lightyears ahead of express for building a comolicated application.
Comparing Django to NodeJS itself is a bit of an apples to oranges comparison though. Even something like Express or Koa will come without an ORM. Django will certainly hold your hand a lot more through the process.
It seems like the biggest issue with the NodeJS ecosystem is that everyone wants to roll their own thing, rather than using the renowned incumbent which works perfectly well. In some ways, this is actually an indication of how deceptively easy it is to work with NodeJS — people really believe they can replace something that has hundreds of years of man hours behind it in a month.
I wouldn't question this for a second. Nor that some people may be extremely happy with it. But me personally, for my most common use case (end-to-end monolithic web apps, complete with client and back-end) it feels like it places a higher cognitive burden than the alternatives, due to all the things we're mentioning (eg, lack of an established ORM)
> Comparing Django to NodeJS itself is a bit of an apples to oranges comparison
Well, yea, but that's the point of my whole comment - Node could have a Django or Rails equivalent after ten years, don't you think?
> It seems like the biggest issue with the NodeJS ecosystem is that everyone wants to roll their own thing
Completely agree - it's almost an ethos thing. Though I'm not sure if it's a conscious "ethos" or rather having to due with the ecosystem and developer population being disparate and disjointed - anarchical, maybe?
Again, not questioning that there are some really good devs out there that are deliberate and successful in rolling out their own thing. I also think however there's a group of devs who think that they want to roll their own thing, until they have to face the consequences down the road and wish they hadn't.
> how deceptively easy it is to work with NodeJS
Yes, that's a big point in my comment. To add: I have a formal education in software engineering but like many others had to pick up web dev on my own. I bought into the Node.js "one language to rule them all" hype, only to find a much steeper learning curve than I would have had otherwise (mainly due to the async model and the lack of a batteries-included framework), without much of a payoff for it.
I feel no regrets, my path has been what it's been, I've learned a lot and I'm glad to have Node.js as an option in my toolbelt since it's so prevalent and there are good use cases for it. But if I had to recommend a young dev where to start I'd probably point them elsewhere.
As for me going forward I see myself sticking to Django and exploring things like Elixir/Phoenix, Swift, Go or F#, and only coming back to Node if the situation really calls for it or maybe, like I said previously, if there's a batteries-included framework that reaches maturity.
It's not that such a thing hasn't been developed, but that by the time such a thing gets developed (for example: [0]), NodeJS devs have already decided they don't like gulp (even though just last week gulp was the new thing vs. grunt), they like webpack; they don't like AngularJS, they like React (or VueJS now); etc.
Almost feels like the JS ecosystem is plagued by people who want to rise to dev stardom by making the next big framework, and they spend a LOT of time trying to convince people their thing is the next best thing since sliced bread. I've seen grown up devs abandon stacks that were perfectly fine to spend years migrating to the new thing — granted this happens more at larger companies where resume building sometimes overtakes business needs.
[0]: https://github.com/angular-fullstack/generator-angular-fulls...
Here's a great example of why: I do a bunch of research before I started my project (https://listifi.app - for anyone curious) and decided to go with prisma.js. It looked like it was exactly what I wanted for a REST API built with koa.
I've dumped probably a month fulltime on the project and now that I have enough experience using prisma, I realized it really doesn't do what I want it to do and is actually making my life more difficult as a result.
So now I'm in the process of switching from prisma to knex. Having the glue hidden from me would really affect my willingness to switch technologies and increase my frustrations with any platform.
For any reasonably complex application, you will eventually need to eject.
I want to see how everything is pieced together. Even these js builders like parcel that "do everything for you" eventually don't work.
I'll take a couple of days to set things up the way I want them to over something that tries to do it all for me while only accommodating the happy path.
Again I want to say that this is my personal preference when building any project. I pick a few barebones libraries to help me build what I want and get out of my way.
That should be obvious when you look at my tech stack: https://listifi.app/u/erock/listifi-tech-stack
I like Active Record + Arel (from Rails) a lot, and have found Knex relatively unpleasant in comparison, offhand Prisma has looked more pleasant/usable to me...
I’m not a fan of ActiveRecord or ORMs in general. I’d much rather write raw sql queries with a little help to improve reusability.
I found Prisma to be super basic. Anything complex like joins or a composition of where’s and ors and it didn’t work.
It also nests related objects where for my purposes I wanted everything to be flat. So if a list has a user associated with it, I want to flatten it like: { list, user }.
I also didn’t like how Prisma has a generate cli to integrate end developer models that must be integrated into your build step to deploy if you’re using typescript.
Its schema cli command worked but in weird ways that I didn’t like. Sharing Prisma types with the client was not automatic. For example, Prisma coverts datetime columns into dates, which sounds nice, but when I send that data as an api response it turns into a string. Now I can’t use their interfaces without plucking the date times and converting it to a string. It just wasn’t as useful as I had hoped.
Knex does exactly what I want and nothing more. All of my raw sql queries were easily converted and worked perfectly. I build the interfaces and knex uses them. There’s no special command that converts their schema format into something I can kind of use.
Their typing was nice once I got it working however, and for simple things it worked fine. I just noticed I had to write a lot of raw sql.
Regarding types, the more I've used JS the more I've come to hate JS's native types for numbers and dates/times, so not terribly shocked by that, kind of think its native types being really obnoxious is part of why typescript is relatively popular.
I am a bit curious - the piece of ORM-style solutions that I like is that they create a clear pattern for organizing certain kinds of application logic - for example, if there's a rule that value X meets certain conditions, usually there are tools or conventions with ORMs to make it not easy to write something that skips the rule without doing so intentionally. Whereas in codebases that don't use some sort of frameworky-ORM-y solution I often find myself thinking there aren't clear patterns of responsibility for such things, leading to bugs or poor DRY practices.
JSON.stringify(payload) turns dates into strings. Did that not work as a response for your API for some reason?
Does that make sense?
I found Prisma to be super basic. Anything complex like joins or a composition of where’s and ors and it didn’t work.
It also nests related objects where for my purposes I wanted everything to be flat. So if a list has a user associated with it, I want to flatten it like: { list, user }.
I also didn’t like how Prisma has a generate cli to integrate end developer models that must be integrated into your build step to deploy if you’re using typescript.
Its schema cli command worked but in weird ways that I didn’t like. Sharing Prisma types with the client was not automatic. For example, Prisma coverts datetime columns into dates, which sounds nice, but when I send that data as an api response it turns into a string. Now I can’t use their interfaces without plucking the date times and converting it to a string. It just wasn’t as useful as I had hoped.
Knex does exactly what I want and nothing more. All of my raw sql queries were easily converted and worked perfectly. I build the interfaces and knex uses them. There’s no special command that converts their schema format into something I can kind of use.
Their typing was nice once I got it working however, and for simple things it worked fine. I just noticed I had to write a lot of raw sql.
A lot of people like it so don’t let me critique shy you away from using it. It probably works best if you are using graphql since it automatically nests the models which I would imagine works well with query resolvers.
At first because they look so easy, clean and productive (just 5min!), but then because I try to get specific answers, like: what drives the schema? Can I use websockets with this? What problems does it solve that others don't? Why does a simple CRUD application need GraphQL integration? Why are there emojis everywhere? Why does it feel like their intentions are unclear?
Then I close the tab and leave with an empty feeling.
what drives the schema? We provide you with an intuitive UI to create the schema. Later down the road, we plan to add a CLI for easier integration with scripts and other tools.
Can I use websockets with this? Since we provide you with a generated Node.js source code you can build on top of it with whatever you want and expand your application with any missing capabilities. Websocket is also on our list, but to be honest the list is long. We are looking forward to getting more contributors to be able to expedite the releases.
What problems does it solve that others don't? We are focusing on saving time for Node.js developers and provide them with a set of tools for all the repetitive tasks they usually face.
Why does a simple CRUD application need GraphQL integration? We initially generate the app with CRUD operations (both with REST and GraphQL). The idea is that developers will keep adding on top of that all the more complex APIs and operations relevant to their business domain - Currently with code, and soon with more tools to expedite some of the boilerplate.
Why are there emojis everywhere? We love emojis, more precisely we love beautiful UI. Once the CLI is out you will be able to avoid the emojis :-)
Why does it feel like their intentions are unclear? I would love to provide details on every question you may have about our intentions. Generally speaking, we hope in the future to create a sustainable business around the open-source project, while keeping the service free for 99% of the users. The project is open-source so anyone can host a server locally and get all the benefits of Amplication with no string attached.
[0] https://fastapi.tiangolo.com/tutorial/sql-databases/ [1] https://fastapi.tiangolo.com/advanced/async-sql-databases/
Really love the work they're doing, definitely check them out!
All of JS with an :any appended to it ;)
Really comprehensive product!
One pipedream I've had with TS backed APIs is sharing the types between the backend and the frontend to prevent duplication. I didn't see anything in the API consumption docs, but is there anything here that tries to accomplish that deduplication?
Why do you require a GitHub account to test it?
---
Edit: and after I logged in with my GitHub credetials, I was directed to https://app.amplication.com/github/callback?code=968[...] which just showed me a 500 error. Hug of Death?
I'm getting " Error: Error in connector: Error querying the database: db error: FATAL: remaining connection slots are reserved for non-replication superuser connections " when deploying.
Thanks
My initial impression is I'm a bit confused as to whether the goal is a hosted service similar to supabase, firebase, etc, or an offline tool that generates the app then it's up to you to go host it somewhere.
See this discussion https://www.reddit.com/r/graphql/comments/duecak/comment/f77...
Also, there's BlitzJS which seems to have similar objectives.
There's definitely no incumbent in the Js/ts/nodejs world similar to the django/laravel/rails/mojolicious frameworks in the other, more mature, dynamic languages.
When you move your work across environmental abstraction, these beneficial abstracts tend to show their cracks.
By keeping the production and the development environments similar, my team avoids deployment surprises and disasters. More importantly, we avoid the escalation calls that take you away from the family dinner table.
If you are gonna delpoy in a docker container, maybe develop in the docker container.
https://macwright.com/2021/01/15/rust.html
"GraphQL basically lets your frontend application define queries, instead of the backend. You give it a range of things it could query, and the application - React or something else - sends arbitrary queries to the backend.
This makes things hard for the backend. Any sort of SQL-level optimization is impossible - your server is writing dynamic SQL, so you rely on the intelligence of your GraphQL server, which is not always high. Juniper, for example: n+1 queries by default. The workaround - a dataloader - is rough and independently maintained. So at the end of the day, you’re going to have a blisteringly-fast application layer that’s spending all of its time inefficiently querying your database."
This is the data coupling problem, allowing the front end to see and arbitrarily query the data model. Yes, you can put a great deal of effort into optimizing the GraphQL server, but then you've just introduced middleware again, and at that point it's hard to see what the GraphQL protocol has over REST.