https://github.com/primer/api
A GraphQL API for collecting and accessing data about the Primer Design System
https://github.com/primer/api
api graphql
Last synced: 7 months ago
JSON representation
A GraphQL API for collecting and accessing data about the Primer Design System
- Host: GitHub
- URL: https://github.com/primer/api
- Owner: primer
- Archived: true
- Created: 2022-07-12T17:06:13.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-10T01:00:59.000Z (over 1 year ago)
- Last Synced: 2025-06-06T22:09:52.405Z (7 months ago)
- Topics: api, graphql
- Language: TypeScript
- Homepage:
- Size: 498 KB
- Stars: 4
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Primer API
> **Warning**: ⚠️ This repository is being sunset and is no longer actively maintained. It was part of an internal experiment and is not likely in active use. Please consider migrating to alternative solutions or repositories.
A [GraphQL](https://graphql.org/) API for collecting and accessing data about the [Primer Design System](https://primer.style)
## Data flow

## Technology stack
- [Apollo Server](https://www.apollographql.com/docs/apollo-server/) for running the GraphQL server
- [Prisma](https://www.prisma.io/) for defining the data schema
- [TypeGraphQL Prisma](https://prisma.typegraphql.com/) for generating a GraphQL API from our Prisma schema
- [Supabase](https://supabase.com) for hosting the PostgreSQL database
## Local development
### Set up
1. Clone the repository:
```shell
git clone git@github.com:primer/api.git primer-api
cd primer-api
```
1. Run the `setup` script:
```shell
npm run setup
```
This will install and build any necessary dependencies.
1. Create a `.env` file in the `api` directory of the repository with a `DATABASE_URL` variable:
```shell
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 locally
1. Run the `start` script:
```shell
npm run start
```
This will start the following servers locally:
- GraphQL API: http://localhost:4000
- Docs example: http://localhost:3000
### Publish schema changes
1. Make changes to the database schema in `prisma/schema.prisma`
1. Run a migration:
```shell
npm run prisma:migrate
```