Skip to content

oktadev/okta-go-gin-vue-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic CRUD App with Go and Gin

This example app shows how to create a API with Go and Gin and display its data with a Vue UI. To follow along step-by-step, check out the blog post.

Prerequisites: Go, Node.js and npm.

Getting Started

To install this example application, run the following commands:

git clone https://github.com/oktadeveloper/okta-go-gin-vue-example.git
cd okta-go-gin-vue-example
cd todo-vue
npm install
npm run build
cd ..
go run main.go

This will get a copy of the project install locally. You will need to set up some environment variables before the app will run properly.

To integrate Okta's Identity Platform for user authentication, you'll first need to:

You will need to create an application in Okta:

  • Log in to your Okta account, then navigate to Applications and click the Add Application button
  • Select Single-Page App and click Next
  • Give your application a name (e.g. "Go Gin Web App")
  • Change the Base URI to http://localhost:8080/ and the Login redirect URI to http://localhost:8080/login/callback, then click Done
  • Save your Client ID for later

Now create a file called .env in the todo-vue directory and add the following variables, replacing the values with your own from the previous steps.

todo-vue/.env

VUE_APP_OKTA_CLIENT_ID={yourClientId}
VUE_APP_OKTA_DOMAIN=https://{yourOktaOrgUrl}

Now you can run both the Go/Gin API server and the Vue frontend with the same command:

go run main.go

Help

Please raise an issue if you find a problem with the example application, or visit our Okta Developer Forums. You can also email developers@okta.com if would like to create a support ticket.

License

Apache 2.0, see LICENSE.

About

RESTful API in Go and Gin with Vue SPA front end

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vue 42.7%
  • Go 33.3%
  • JavaScript 11.7%
  • HTML 9.9%
  • Shell 2.4%