https://github.com/foryforx/ibossgo
golang with google oauth and postgres. Implemented in clean-architecture with sql migration.
https://github.com/foryforx/ibossgo
clean-architecture gin golang mongodb oauth2 postgres postgresql sql-migration
Last synced: about 1 month ago
JSON representation
golang with google oauth and postgres. Implemented in clean-architecture with sql migration.
- Host: GitHub
- URL: https://github.com/foryforx/ibossgo
- Owner: foryforx
- Created: 2019-03-01T02:19:39.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-09T20:28:53.000Z (over 2 years ago)
- Last Synced: 2025-02-14T22:13:55.223Z (3 months ago)
- Topics: clean-architecture, gin, golang, mongodb, oauth2, postgres, postgresql, sql-migration
- Language: Go
- Size: 12.3 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Golang with Google OAuth + postgres backend(option to move to mongo) + sql migration + clean architecture
Got kick start from (https://github.com/Skarlso/goprogressquest).
# Installation
Simply `go get github.com/karuppaiah/golang-oauth-postgres-clean-architecture`.
# Setup
export ENV=development
export DATABASE_URL=postgres://postgres@localhost:5432/ibossgo?sslmode=disable
### Postgres ###
export PGHOST=localhost
export PGPORT=5432
export PGDATABASE=ibossgo
export PGUSER=postgres
export PGPASSWORD=
export PGSSLMODE=disable
export BASE_URL=localhost:9090
export BASE_PROTOCOL=httpIn order for the Google Authentication to work, you'll need developer credentials which the this application gathers from a file in the root directory called `creds.json`. The structure of this file should be like this:
```json
{
"cid":"hash.apps.googleusercontent.com",
"csecret":"somesecrethash"
}
```To obtain these credentials, please navigate to this site and follow the procedure to setup a new project: [Google Developer Console](https://console.developers.google.com/iam-admin/projects).
## Dependencies
To gather all the libraries this project uses, simply execute from the root: `go get -v ./...`
# Running
To run it, simply build & run and navigate to http://127.0.0.1:9090/login, nothing else should be required.
```
go build
(install fresh: https://github.com/gravityblast/fresh)
fresh
```