Warning: Experimental. Not production ready.
A GraphQL API for collecting and accessing data about the Primer Design System
- Apollo Server for running the GraphQL server
- Prisma for defining the data schema
- TypeGraphQL Prisma for generating a GraphQL API from our Prisma schema
- Supabase for hosting the PostgreSQL database
-
Clone the repository:
git clone [email protected]:primer/api.git primer-api cd primer-api
-
Run the
setup
script:npm run setup
This will install and build any necessary dependencies.
-
Create a
.env
file in theapi
directory of the repository with aDATABASE_URL
variable:DATABASE_URL=...
The
DATABASE_URL
variable should be set to a connection string for a PostgreSQL database. Ask @colebemis, @langermank, or @mperrotti for the connection string.
-
Run the
start
script:npm run start
This will start the following servers locally:
- GraphQL API: http://localhost:4000
- Docs example: http://localhost:3000
-
Make changes to the database schema in
prisma/schema.prisma
-
Run a migration:
npm run prisma:migrate