gothinkster / realworld

"The mother of all demo apps" β€” Exemplary fullstack Medium.com clone powered by React, Angular, Node, Django, and many more

Home Page:https://main--realworld-docs.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ—„πŸ”§ Go + Gorilla mux

chilledoj opened this issue Β· comments

Current Status

Todo:

  • 🏁 Fork the starter repo & post the link in this issue
  • 🎨 Create logo for repo & update issue status (@EricSimons)
  • πŸ”¨ Implement all of Conduit's functionality per the spec & API
  • πŸ‘€ Move repo to main org & Peer review final codebase by admins/community (RFC)
  • πŸŽ‰ Tag v1 release and officially list it on the README!

Hi,

I have made a start on a fork utilising Go + Gorilla mux

Chilled OJ / realworld-starter-kit

@chilledoj awesome! Can't wait to see this πŸ‘

Hi @EricSimons, the api is now fully functional.

@chilledoj awesome! I'm gonna test this out when I get home later today β€” have you tried running it against one of the supported frontends yet?

I've only been testing against the Postman collections so far. Would appreciate someone else's view - maybe I missed something (error responses?). I've only been using the postman collections so far, but also studied the NodeJS code for a few things as I'm very familiar with NodeJS.

Let me know how you get on. This is my first stab at being part of open source code, and i'm a bit new to the git workflow.

I'll have a go at downloading a front end and testing it against it. I have a feeling I need to add CORS support - but luckily there is CORS available in the gorilla toolkit.

@chilledoj yeah there's some nuances to the frontend/backend API that we're going to add to the spec ASAP (response codes, CORS, etc) β€” if you've been following the node codebase you should be good though!

No sweat btw, almost all of us are first timers to OSS here :) I've never used Go before so it's taking a while to get set up, but lmk if you get one of our frontends up & running and don't run into any errors!

Any update on this? Sounds like we're ready to mark this as complete, pending testing. Would love to close this issue out if we're good to go.

I have tested the code against the postman collection and all tests pass - plus I have a few code tests written. I have struggled to test against a frontend. I'm not sure if anyone else has managed to download my code and test separately

@chilledoj I appreciate your wiki very much. Im a newb at GO and reading about options and decision making really helped.

I have a question though:

  • Why shy away from usage of config files. May be config.json or config.yml and push out hardcoded configurations such as UsernameLengthRequirement ? What made github.com/namsral/flag a better choice than traditional config files?

@sluongng i chose that package as it is a complete replacement for the standard flag package, but instead of just parsing command line options it will also check environment variables, and config files. In general my experience has been that things like http address/port and db urn are usually defined as environment variables in line with the idea of having a twelve factor app.
In terms of the username length requirement, that was personal preference, but also i see it as something bespoke to the models package. If I wanted to parameterise that item I'd need a way to pass in the value (and handle defaults) from the main package, by perhaps storing on the custom DB struct.

@BRWR I have had confirmation on the Golang Gitter channel from @guillaumemaka that he has successfully tested with the react front end. I too have managed to test against this now.

@chilledoj could you provide some sort of example template for config file? I agree with your point about Environment Variables but problems come when you try to communicate with a large group of people. Its better to have some documented guideline rather than forcing a Java/C# dev to read and understand GO code.

For example, something like:

//config.yml.example
host: 111.222.333.444
port: 8085

Would be very beneficial. Newcomers can just get the file from repo, edit and rename

@sluongng The github.com/namsral/flag package determines the config file format. But I've updated the repo to contain a config file and included some more items for handling http(s).

@chilledoj Any progress on this?

@Dkairu It’s been a while since I looked at this repo. I’m pretty sure that it was working across the whole API spec.

Hello, we moved the addition of new implementations to this website : https://codebase.show/projects/realworld
Please submit your implementation there.