Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 1.09 KB

README.md

File metadata and controls

60 lines (42 loc) · 1.09 KB

Politigraph

[WIP] A Thai politics database

Stack

  • Nuxt
  • Better-Auth
  • Apollo GraphQL Server
  • Neo4J

Set Up

Environment Variables

Add following variables to the .env

NEO4J_HOST=localhost
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=<SOME_PASSWORD>
BETTER_AUTH_URL=http://localhost:3000
BETTER_AUTH_SECRET=<RANDOM_STRING>

Start Development Server

npm i	# Install dependencies for the first time
npm run dev

Create User Account

Make a POST request to /auth/sign-up/email with the body:

{
	"name": "*****",
	"email": "*****",
	"password": "*****"
}

GraphQL Usage

GraphQL is available at /graphql with a playground enabled on the local environment.

API Authentication

GraphQL required user account for write permission. To make an update to GraphQL outside the Politigraph website, make a POST request to /auth/sign-in/stateless with the body to get the token.

{
	"email": "*****",
	"password": "*****"
}

Then you can include the token in Authorization: Bearer <token> headers of GraphQL request to get the write permission.