https://github.com/treeder/quickstart-api-template-go
API template for quickstarting apps.
https://github.com/treeder/quickstart-api-template-go
Last synced: 4 months ago
JSON representation
API template for quickstarting apps.
- Host: GitHub
- URL: https://github.com/treeder/quickstart-api-template-go
- Owner: treeder
- Created: 2021-09-29T01:37:23.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-05-08T18:09:57.000Z (about 3 years ago)
- Last Synced: 2026-02-01T23:22:14.337Z (4 months ago)
- Language: Go
- Homepage:
- Size: 8.8 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Quickstart API Template
For rapid app creation.
[Frontend template](https://github.com/treeder/quickstart-ui-template)
## Getting Started
* Click `Use this template` button above
* Edit `go.mod`, change module name to your new repo name
* Create firebase project
* Upgrade project to pay as you go
* Create a Firestore
* Go to settings -> Service accounts, click "Generate new private key". This will download a JSON file.
* Run `base64 -w 0 account.json` to get encoded version of the file (for secrets)
* Make `.env` file with `G_KEY` (output of above command) and `G_PROJECT_ID`
* Or add those vars into your codespace secrets
* `make run` (boom)
## Auto Deploying
* Go to https://console.cloud.google.com/ , choose your firebase project
* Go to Cloud run -> create service
* Mostly defaults, but choose deploy from github and choose your repo
* No Google env vars required, but add any new ones you created
## Cloud Storage CORS setup
* Copy [cors.json](cors.json)
* Open the cloud shell at console.cloud.google.com
* Create cors.json and paste in the cors.json from here
* Run: `gcloud storage buckets update gs://BUCKET_NAME --cors-file=cors.json`