11 ms·
Go-bootstrap: Generates a lean and mean Go web project
- zedpm 11y agoExcellent overview. I'm sick to death of landing pages that are vague, hard to navigate, and leave you wondering what the project is all about; you avoided all of that. In particular, the "Decisions made for you" clearly answers many of the questions someone will have when they investigate a project like this. Kudos.
- rylee 11y agoI can't agree enough! More projects need this "decisions made for you" section in them. Hmm, maybe I should go through the common Ruby frameworks and add a section like this in a pull request...
- MetaCosm 11y agoIndeed, it is one of the best one page introduction for a project I have ever seen. Making me go back to some of my projects and redo the READMEs.
- po84 11y ago"Decisions [It/We] Made for You" is brilliant. 10/10 will use on my next README, landing page, etc.
- didip 11y agoThanks for the feedback! The project is aimed at getting up to speed as fast as possible, and the docs is geared towards that.
- ejcx 11y agoI like the project. You integrated a lot of well known and standard packages that people writing Go-WebApps would want, and didn't make the project super heavyweight. Very useful and still very light. I will definitely be using it, since one of my biggest problems with getting new go machines set up is going out and finding all the packages I have used in the past. On top of that, you got me another Gorilla Secure Cookie default integrity key to add to my project for attacking Gorilla SecureCookies.
- sinatra 11y agoWould love to see something like this for RESTful Web Services built on Go with /users, auth, rate-limiting, etc already working out of the box.
- loosescrews 11y agoI wrote something like that a while back: https://github.com/iangudger/basicGoAPI https://github.com/iangudger/basicGoAPI No rate limiting, but it has pretty much everything else. If you want to add it I would welcome a pull request :)
- abtinf 11y agoYour project is GPL licensed. Is that your idea of a joke? There is a place for the GPL, but this is not it.
- papaf 11y agoI have found the GPL is workable in web projects: https://programmers.stackexchange.com/questions/132485/does-a-website-running-modified-gpl-software-have-an-obligation-to-release-their https://programmers.stackexchange.com/questions/132485/does-... I understand why people don't like the GPL but its not a showstopper for most business applications.
- abtinf 11y agoYou are grossly misguided and should consult a lawyer. Linking to a random programmers stackexchange question is an unwise way to make licensing decisions. Per GNU's own faq at https://www.gnu.org/licenses/gpl-faq.html#UnreleasedMods https://www.gnu.org/licenses/gpl-faq.html#UnreleasedMods: A company is running a modified version of a GPL'ed program on a web site. Does the GPL say they must release their modified sources? The GPL permits anyone to make a modified version and use it without ever distributing it to others. What this company is doing is a special case of that. Therefore, the company does not have to release the modified sources. It is essential for people to have the freedom to make modifications and use them privately, without ever publishing those modifications. However, putting the program on a server machine for the public to talk to is hardly “private” use, so it would be legitimate to require release of the source code in that special case. Developers who wish to address this might want to use the GNU Affero GPL for programs designed for network server use. In case you missed it: However, putting the program on a server machine for the public to talk to is hardly “private” use, so it would be legitimate to require release of the source code in that special case. There are numerous other potential consequences to the GPL and the question of when propagation occurs is ambiguous.
- captainkrtek 11y agoJust got this up and running, this is fantastic! great work
- shocks 11y agoThis is really exciting. Thank you very much. Anyone with a 'large' web project written in Go want to chime in?
- Vendan 11y agoIMHO, once you've got a db attached, "secure cookies" are a bad idea.
- Jailbird 11y agowithout reference to this project - Perhaps you meant storing all session data is a bad idea versus just an ID? (If so, I'm with you) If not - how would you identify an authenticated user? Or, how would you look up all their relevant session data in the DB?
- Vendan 11y ago"securecookies" is a term used, at least in the context of github.com/gorilla/sessions, to refer to a session storage based on encrypting all of the session data and sending it as a cookie. That means all of your session data, including if the user is authenticated and even which user it is, is sent to the browser and back to the server on the next (and subsequent) request(s). This is an interesting concept, but IMHO, rather flawed. About the only valid use is for small micro-apps that don't have any server side persistent storage. A db based session, which really wouldn't be that hard to set up with github.com/gorilla/sessions, would just send a randomly generated session id to the client in a cookie, save the data in the db, then read that data back out of the db on the next request.
- deleted 11y ago[deleted]
- bsaul 11y agogreat initiative ! thanks a lot !
- enneff 11y agoI'm a bit confused as to why the initial step is a "git clone". Why not "go get"?
- asurma 11y agoI agree. I thought it would be a blank project skeleton you are supposed to clone, but it’s not. So `go get` would make much more sense on the landing page.
- didip 11y agoGreat point! I've updated the instruction.
- enneff 11y agoLooking better, but since the 'go get' step compiles your main.go and puts it in $GOPATH/bin/go-bootstrap, the instructions could be simpler still: go get github.com/go-bootstrap/go-bootstrap $GOPATH/bin/go-bootstrap -dir github.com/$GIT_USER/$PROJECT_NAME cd $GOPATH/src/github.com/$GIT_USER/$PROJECT_NAME && go run main.go
- superuser2 11y ago>It does not use ORM nor installs one. Take a look at [1]. Congratulations, you've written an ORM. The belief that ORMs are evil is precisely the belief that this sort of code should be repeated everywhere database access is performed. If you have generalized routines for interacting with the database with more comfortable abstractions then string concatenation, you are using an ORM, but possibly a poorly tested, poorly documented homegrown one instead of a generally accepted solution that has more eyes on it. You are what you claim to be above. Which is not bad, lightweight ORM is awesome. You could also debate terminology that these are not really objects, but the spirit is still pretty similar to activerecord and sqlalchemy. [1]https://github.com/go-bootstrap/go-bootstrap/blob/master/blank/dal/base.go https://github.com/go-bootstrap/go-bootstrap/blob/master/bla...
- civilian 11y agoAnd if you look at dal/README.md https://github.com/go-bootstrap/go-bootstrap/tree/master/blank/dal https://github.com/go-bootstrap/go-bootstrap/tree/master/bla... , they say that they got the "data access layer" defintion from wikipedia http://en.wikipedia.org/wiki/Data_access_layer http://en.wikipedia.org/wiki/Data_access_layer , and in the last line of the wiki page says: > Object-Relational Mapping tools provide data layers in this fashion, following the active record model. The ORM/active-record model is popular with web frameworks. :D
- deleted 11y ago[deleted]
- superuser2 11y agoIt may be technically true that this DAL is not really on ORM, but saying that the project skeleton does not contain an ORM is misleading at best. It would be simplest to just rework the language to something like, "a lightweight ORM" or "a database access layer like what's found in traditional ORMs" or something.
- lateefj 11y agoMost ORM's are evil. sqlachemy being the only one that I can think of that is not evil (assuming you don't use the object mapping feature). I have found time and again that ORM's create unintended consequences in productions. Generation after generation of ORM's I have dealt with always have the same problem the create N+1, bad queries, memory bloat and are horrible to deal with in production. Once almost all the database operations are replaces with hand writing queries the application performance as expected. It is amazing to me that even though experiences engineers who have had ORM failures continue to use them. Some of have found that the cost of ORM is greater than the benefit and prefer simple libraries.
- elcct 11y agoYou can also check this one http://defaultproject.com/ http://defaultproject.com/ Based on Goji and Mongo. This site uses it http://gifuk.com/ http://gifuk.com/
- czbond 11y agoAfter fiddling with the initial rev, and having issues - I pulled your May 8 commits and this is very nice and working well! Thank you so much! I've been using a "book in progress" for better practices for go web programming (http://www.manning.com/chang/ http://www.manning.com/chang/). But this was much better for me to get going! Cheers.
- didip 11y agoGlad to hear that the project helps!
- yarper 11y agoI wrote a simple one of these for rust using nickel.rs a while ago. https://news.ycombinator.com/item?id=9519642 https://news.ycombinator.com/item?id=9519642