How do you create front end in Golang? and other questions [closed]

139
February 10, 2020, at 07:40 AM
Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed yesterday.

I started learning programming sometime ago and started with HTML & CSS, finally mastered both of them, now I started using Javascript and learning Javascript. In my learning path I came across Node.js a runtime environment for javascript which basically allows me to have my Html , Css and Javascript into the Node.js environment. Translate to react native and finish coding the whole thing and have a working Web, iOS and Android app. (Haven't done this yet but this is my small understanding about how all this works)

Today I stumbled across Golang...

Loved how simple Golang looks and how easier it is to read than Javascript. I read the differences and similarities , also some tutorials. Now for you Golangers (Gophers?) I have multiple questions.

If I make my app in Golang how do I do the front end? Do I implement html and css? Do I do something else as a visual editor (like Adobe XD as a banal example) ? Do I use React to create the iOS,Android app? Can I use mongoDB(I assume yes as mongoldb was done on Golang, but I still rather ask)?

How does the typical steps in creating an application look like in go?

(Example as with Nodejs web app) 1.Create an Html and CSS UI 2.Add javascript for functionality of the app 3.run on node 4.import into React for iOS and Javascript 5.finish app and deploy

Thank you very much in advance! Golang community seems like a much nicer community than Nodejs community in my opinion.

Ps. Should I drop learning javascript and completely switch to Golang or finish learning Javascript and then learn Golang?

Answer 1

Front-end needs to be written in JavaScript (and HTML and CSS), there is usually no way around it. The only way you can possibly run Go in the front-end is if you manage to somehow compile Go to JavaScript, which I don't know if it's possible. I know it's possible to compile C, C++, Rust and C# to JavaScript.

Edit: It's indeed possible to compile Go into JavaScript: https://github.com/gopherjs/gopherjs

Answer 2

If I make my app in Golang how do I do the front end?

I would create the front end using React (note that this is different from React Native) and then use Go as your back-end to serve up this React app. You could then also port the front-end to React Native in order to have it on iOS and Android.

I have also recently discovered Go and enjoy it, which is why I'd recommend using Go as the back-end and serving up the React front-end.

Another note on the front end, if you are making it in React I strongly recommend using Create React App - this takes all of the hard work out of configuration, makes it super easy to develop (in development mode it auto-updates the app when you save any changes to source files - super fast). Create React App also then outputs a simple bundle of files which you can then easily serve up with a Go or Node.js or any other back-end.

Hope this helps.

Rent Charter Buses Company
READ ALSO
How to disable Morgan (request logger) during unit test?

How to disable Morgan (request logger) during unit test?

I use Morgan (default express generator request logger), and I'm trying to disable it during unit testing

167
aws s3 node js sdk method generatePutUrl returns differnt results for localhost and deployment on heroku

aws s3 node js sdk method generatePutUrl returns differnt results for localhost and deployment on heroku

I am trying to manage direct file upload to S3 according to heroku recomendations

115
Puppeteer on Raspberry pi zero w

Puppeteer on Raspberry pi zero w

I want to run a node js script with puppeteer on Raspberry pi zero w, but I'm getting this error:

156
Squeelize unable to access foreign key

Squeelize unable to access foreign key

I am trying this example:

134