https://github.com/icco/graphql
A new backend to my blog
https://github.com/icco/graphql
graphql hacktoberfest
Last synced: 16 days ago
JSON representation
A new backend to my blog
- Host: GitHub
- URL: https://github.com/icco/graphql
- Owner: icco
- License: mit
- Created: 2017-11-25T02:18:41.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2023-12-25T21:06:42.000Z (over 1 year ago)
- Last Synced: 2025-03-24T12:39:14.693Z (about 1 month ago)
- Topics: graphql, hacktoberfest
- Language: Go
- Homepage: https://graphql.natwelch.com
- Size: 1.7 MB
- Stars: 10
- Watchers: 2
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# graphql.natwelch.com
A new backend for graphql.natwelch.com.
[](https://travis-ci.org/icco/graphql)
[](https://goreportcard.com/report/github.com/icco/graphql)
[](https://pkg.go.dev/github.com/icco/graphql)The next iteration in Nat's content management system. Previous versions include:
* [tumble.io](http://github.com/icco/tumble)
* [pseudoweb.net](http://github.com/icco/pseudoweb)
* [natnatnat](http://github.com/icco/natnatnat)## Install
This repo requires Go 1.11 to be installed.
1. Start postgres on your local machine with a database called writing.
2. Copy `local.env` to `.env`
3. `env $(cat .env) go run -v ./server` to start the server.
4. Visit which has a default graphql client.### Example Env
```
DATABASE_URL=postgres://localhost/writing?sslmode=disable&binary_parameters=yes
SESSION_SECRET="random string"
OAUTH2_CLIENTID=something.apps.googleusercontent.com
OAUTH2_SECRET=1234567890
OAUTH2_REDIRECT=http://localhost:8080/callback
PORT=9393
```### Auth
This uses Auth0 to generate logins. To save yourself setting up the Auth0, you can generate an API key for testing by creating a user. To create a user for testing, run the following insert SQL:
```sql
INSERT INTO users (id, role, created_at, modified_at) VALUES ('test', 'admin', now(), now());
```Then get your API key:
```sql
SELECT apikey from users where id = 'test';
```And then set that as the value of the `X-API-AUTH` on all of your requests to graphql.
## Design
This site is hosted at . It runs out of a docker container on Google Kubernetes. It has a postgres backend. This started as a rewrite of a previous project, natnatnat. Its [readme](https://github.com/icco/natnatnat/blob/master/README.md) walks through a lot of the previous inspiration.
We use to generate a lot of the files.
## Documentation
- For schema docs, https://graphql.natwelch.com.
- For `*.graphql` files. See for an explanation of the description schema.
- For Go, see https://godoc.org/github.com/icco/graphql