https://github.com/nwthomas/graphql-article-server
The Express, GraphQL, and PostgreSQL server for Nathan Thomas' article
https://github.com/nwthomas/graphql-article-server
Last synced: about 1 year ago
JSON representation
The Express, GraphQL, and PostgreSQL server for Nathan Thomas' article
- Host: GitHub
- URL: https://github.com/nwthomas/graphql-article-server
- Owner: nwthomas
- License: mit
- Created: 2019-07-24T03:28:37.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-11T04:50:31.000Z (over 3 years ago)
- Last Synced: 2025-03-26T21:35:44.928Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 219 KB
- Stars: 2
- Watchers: 0
- Forks: 5
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GRAPHQL ARTICLE SERVER
This is the set of starter files for Nathan Thomas' [GraphQL Article](https://hackernoon.com/building-your-first-graphql-server-exbh3wpq). Note that this server does not satisfactorily run on initial clone. You will need to follow along in my article to flesh it out.
## GETTING STARTED
- Fork or clone the repository
- Add a `.env` file. Copy over the contents of the `.env.example` file and then modify it with the following conditions:
- Create a `PORT` variable with the port number you want to run your server on (the server will default to `8000` if you don't set anything)
- Make sure to add the `NODE_TLS_REJECT_UNAUTHORIZED='0'` environment variable (you wouldn't want to use this for a real project, but we need it for how I'm having you set this database up fast)
- Implement a database instance of PostgreSQL somewhere such as Supabase (details in article) and assign the URL for that cluster to `DATABASE_URL` in your `.env` file
- Install all full dependencies with `yarn` or `npm install` including:
- `cors`
- `dotenv`
- `helmet`
- `faker`
- `graphql`
- `graphql-playground-middleware-express`
- `knex`
- `pg`
- `nodemon`
- `jest`
- Migrate all tables to your PostgreSQL instance by using the command `npx knex migrate:latest` in the root directory
- Run all seeds to populate dummy data in the database by using the command `npx knex seed:run` in the root directory
- Run `yarn server` or `npm run server` to launch server