A monorepo containing a GraphQL API and web frontend for searching Magic: The Gathering cards legal in the Middle School format.
middleschool-mono/
├── apps/
│ ├── api/ # Hono GraphQL API
│ └── web/ # Remix.js frontend
└── packages/ # Shared packages (if needed)
- Node.js 20+
- pnpm
-
Install dependencies:
pnpm install
-
Start development servers:
pnpm dev
This starts:
- API server on http://localhost:3001
- Web frontend on http://localhost:3000
The API is built with Hono and serves a GraphQL endpoint at /graphql.
Available queries:
searchCards(query: String!, limit: Int)- Search cards by name, type, or textgetCard(oracleId: String!)- Get a single card by Oracle IDgetCardsByColor(colors: [String!]!)- Filter cards by mana colors
Convert CSV data:
cd apps/api
pnpm run convert-dataThe frontend is built with Remix.js and consumes the GraphQL API.
Both apps are configured for Vercel deployment:
- API: Deploy as serverless functions
- Web: Deploy as static site with SSR
Copy the example environment file and configure:
cp .env.example .env.localRequired variables:
API_URL- GraphQL API endpoint URL
For local development:
API_URL=http://localhost:3001/graphql
For Vercel deployment: Set in Vercel dashboard or CLI:
vercel env add API_URL
# Enter: https://your-api-domain.vercel.app/graphqlThe card data is sourced from a CSV file and converted to JSON at build time. The data includes:
- Card names (English and Japanese)
- Mana cost and colors
- Card types and rarity
- Legal/banned status in Middle School format
- Rules text and power/toughness
- API: Hono.js, GraphQL Yoga, TypeScript
- Frontend: Remix.js, React, TypeScript
- Build: Turbo, pnpm workspaces
- Deployment: Vercel