Live data from Hacker News

Show HN: Copper – A Go framework for your projects

github.com

11–20 of 86 posts

Re: Show HN: Copper – A Go framework for your projects

#11
Devs interested in this may also be interested in Pagoda [1], a rapid, easy full-stack web development starter kit in Go that I wrote. It leverages popular frameworks and modules that you can easily swap out, if desired. The readme contains full documentation and it's very much batteries-included.

[1] https://github.com/mikestefanello/pagoda

Re: Show HN: Copper – A Go framework for your projects

#12
Cool project. I'm currently building something similar to hacker news using only the standard library. How could this project help me?

The way I use the standard library is like a super condensed version of React. Templates are my components. Since templates can be nested, templates can be used to build "components" and those components can be stored in separate files and compiled together at run time with a "model" being fed to the template(s) via a state object passed by the application.

So I may have a few dozen template files in a folder called /components, and another folder called /pages with a few templates that use these components. When a user visits a "page", the template file is "compiled" with the appropriate components.

A page might look like this:

  
    {{template "nav"}}
    {{template "thread" .Thread}}
    {{template "footer"}}
  
And "nav", "thread", and "footer" are all components defined in another file. This allows for re-use across multiple pages.

I want to do a write-up on it but I'm not sure if it's a novel idea.

Re: Show HN: Copper – A Go framework for your projects

#14
post #8

Earlier quoted context omitted.

>The main issue is that it doesn’t support placeholder values Can you elaborate? Like give me an example of a route path that uses placeholder values? I use Go to build web apps too and I really don't see a need for anything other than the standard library.

GET /{username}

You definitely don't need a framework to get the user name out of a URL, you need one line of code.

Re: Show HN: Copper – A Go framework for your projects

#15
this looks fine but not a fan of gorm.

but it could be decent choice if u want to build integrated framework i can understand why people would choose it, another option is code_generation_meta_hell with sqlboiler. upper db [0] would have been perfect fit for this kind of project but is not that famous, its development is slow but stable.

ps: i like sqlboiler what i am saying is if u are building framework top on it then not that fun

[0]: https://github.com/upper/db

edit: include link

Re: Show HN: Copper – A Go framework for your projects

#17

Cool project. I'm currently building something similar to hacker news using only the standard library. How could this project help me? The way I use the standard library is like a super condensed version of React. Templates are my components. Since templates can be nested, templates can be used to build "components" and those components can be stored in separate files and compiled together at run time with a "model"…

Sounds like old school server-side rendering techniques to me: php, coldfusion, classic ASP

Re: Show HN: Copper – A Go framework for your projects

#19

Cool project. I'm currently building something similar to hacker news using only the standard library. How could this project help me? The way I use the standard library is like a super condensed version of React. Templates are my components. Since templates can be nested, templates can be used to build "components" and those components can be stored in separate files and compiled together at run time with a "model"…

Oh that's fun! In my demo video [1], I build a (minimal) HN clone so hopefully that answers your question in detail.

But the tldr is - you'll need a lot more than just templating for a production ready app. To name a few things - server, storage, migrations, logging, configs. IMO there's a huge benefit in having a batteries included toolkit that stays close to the stdlib - so you can totally keep your templates as is!

[1] https://vimeo.com/723537998

Re: Show HN: Copper – A Go framework for your projects

#20

this looks fine but not a fan of gorm. but it could be decent choice if u want to build integrated framework i can understand why people would choose it, another option is code_generation_meta_hell with sqlboiler. upper db [0] would have been perfect fit for this kind of project but is not that famous, its development is slow but stable. ps: i like sqlboiler what i am saying is if u are building framework top on it t…

Code generation is an awesome alternate, I'm more familiar with sqlc.dev. They're doing some really interesting work.

My goal with Copper is to provide out-of-the-box integrations with popular solutions to various problems. For now, I picked GORM but I definitely see adding support for other tools.

Post reply on HN