[Advice Needed - Please] ProgressQuest in Go - WebApp version

xuanbao · · 329 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Hey folks. </p> <p>Previously, I posted about a project I was working on which was a Go implementation of ProgressQuest, which you can find here: <a href="https://github.com/Skarlso/goprogressquest">GoProgressQuest</a>. </p> <p>However, that got me thinking, that folks usually like WebApps and shiny things more. And I wanted an excuse to learn React. So... I started working on a web application implementation which you can find here: <a href="https://github.com/Skarlso/goquestwebapp">GoProgressQuestWebApp</a>. But than suddenly realised, I know very little about a full stack web app. So I started digging around how user session and login works in Go land, and this is where I&#39;m standing right now. </p> <p>Basically, you can Log - In using your Google account and it will save you in MongoDB and tell you if you are somebody who it knows. I&#39;m handling sessions through Gin-Gonic and Gorilla sessions middleware and a small middleware which checks if user-id is set. </p> <p>It&#39;s pretty basic, and the user-id is not validated to the user right now, it just checks if it&#39;s nil. That&#39;s fine, I&#39;ll implement that next time. </p> <p>However I would like to ask you fine gentleman and ladies if I&#39;m on the right course at all?! Is this how people do it? I&#39;m pretty sure the google integration is fine for now. Though I&#39;m sure there are like a 100 libraries out there which do it in some way. :) </p> <p>I&#39;m a noob in web app territory, so please, spare me the &#39;OMG you are an idiot&#39;, if you see something that is completely wrong, just point it out. I&#39;m here to learn. :) Also, please disregard my leet haxor front-end design skillz. :D And also note, that this is currently very much a WIP. :) so you might find dead code in there, or things I&#39;ll change, delete, whatever. :) </p> <p>Thank you very much in advance folks!<br/> Have a lovely Halloween!</p> <hr/>**评论:**<br/><br/>bear1728: <pre><p>I think you&#39;ll find lots of different approaches. I&#39;m sure plenty of people on here have tried similar apps and will have some great opinions. I can only offer my experience.</p> <p>First, I think you&#39;re doing the right thing in terms of authentication. I don&#39;t recommend anyone build a username+password database. Plus using google authentication is pretty simple once you find the right pictures in the google documentation. However, we are moving towards <a href="https://auth0.com" rel="nofollow">Auth0</a> to deal with other possible logins, and will identify accounts with emails. You may find it helpful to add a special &#34;dev&#34; mode for the server which automatically logs you in without asking google for permission. This can be really helpful when first starting out.</p> <p>Are you planning on using some kind of REST thing or websockets to stream events to the client? Is there any multiplayer aspect of progress quest? If not you could actually run everything on the client and then just save the progress everyonce in a while. In fact you could probably do it without a server at all by taking advantage of something like paste-bin to dump &#34;save files&#34;, I just don&#39;t know how you get a deterministic URL from the user. That might be fun. But if there is multiplayer or you want to write all the logic on the server, then you might want to look at other databases too. It might be fun to try out a graph based solution or maybe you need something very simple like &#34;bolt&#34; which is great to use in Go. Or even sqlite3 which is super easy to get started..</p> <p>In terms of the front end I&#39;m definitely not an expert. But I can say that React + <a href="https://getstorybook.io/" rel="nofollow">storybook</a> (which is similar to devcards for om) is great for front-end dev stuff. We personally use typescript+react+redux. It absolutely has a learning curve, but once you get going it&#39;s really nice. But you should also consider other options like Vue, I&#39;ve heard great things about that too. I have never done any &#34;streaming&#34; things in react but I am sure there are docs about it.</p> <p>It sounds like a sounds project though, so keep it up!</p></pre>skarlso: <pre><p>Man. Massive thanks for this write up. Both look very intriguing, storybook AND Auth0! I gotta run right now, family calls. Thanks!!! :gold: </p></pre>bear1728: <pre><p>No problem and thanks for the gold! Let me know if you have any other questions about our setup or things. Good luck!</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

329 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传