An open API service indexing awesome lists of open source software.

https://github.com/neil-ptr/until-failure-api

GraphQL API for my workout logger written using Go
https://github.com/neil-ptr/until-failure-api

Last synced: 5 months ago
JSON representation

GraphQL API for my workout logger written using Go

Awesome Lists containing this project

README

          

Screen Shot 2022-11-13 at 11 47 42 AM

# Workout Logger API

The GraphQL api for a very simple workout logger app I built for myself to track progression of weight I'm lifting for certain exercises.

# Try It Out

1. Go to https://workout-logger-api-ejtky726bq-uw.a.run.app/
2. Do a login mutation to get the access token by pasting and running

```
mutation Login{
login(loginInput: {email:"test@test.com", password:"password123"}) {
accessToken
refreshToken
}
}
```

3. take the access token and paste this into the header section at the bottom of the page

```
{
"Authorization": "Bearer "
}
```

4. Click the docs button on the top left of the page and start running queries!

# Techonologies Used

- Go
- GORM
- GQLGen
- GraphQL
- PostgreSQL

# Prereqs

- A postgres db url
- Go installed on your machine

# Setup

1. Clone repo
2. `cd` into the root of the repo
3. Have copy contents of `.test.env` into a new `.env` file
4. Fill in and replace secrets and postgres database connection parameters
5. Run `make dev` to start dev server or `make test` to run all integration tests

# Commands

- `make dev`: start dev environment
- `make test`: run all test files
- `make format`: format all code within repo
- `make regenerate`: regenerate graphql resolvers from `schema.graphqls`
- `make schema_json`: generate new `schema.json` file for the iOS client
- `make deploy`: deploy to GCP Run

# Deployment

1. Follow default prompts
2. Deploy to us-west1