Skip to content

PerretWilliam/poke-cards

Repository files navigation

Poke Cards v2

A modern full-stack flash card application

Node.js pnpm Bun Docker License


Monorepo Structure

poke-cards/
├── apps/
│   ├── api/          # Express API (Bun · Better Auth · Drizzle ORM · MariaDB · Swagger)
│   └── web/          # React Router + Vite frontend
└── packages/
    ├── contracts/    # Shared Zod contracts
    └── ui/           # Shared shadcn-based UI components

Tech Stack

Layer Technology
Runtime Bun
API Express.js
Auth Better Auth
ORM Drizzle ORM
Database MariaDB
API Docs Swagger / OpenAPI
Frontend React Router v7 + Vite
Validation Zod (shared contracts)
UI shadcn/ui
Package Manager pnpm (monorepo)

Getting Started

Prerequisites

  • Node.js >= 20
  • pnpm >= 10
  • Bun
  • Docker (recommended for MariaDB)

Installation

pnpm install

Environment Setup

cp apps/api/.env.example apps/api/.env
cp apps/web/.env.example apps/web/.env

Fill in the required environment variables in each .env file before starting the app.

Start MariaDB

docker compose up -d mariadb

Run in Development

Start both API and web in parallel from the monorepo root:

pnpm dev

Or run each app individually:

# API only
pnpm --filter @poke-cards/api dev

# Web only
pnpm --filter web dev

Docker — Full Stack

Run the entire stack (MariaDB + API + Web) with a single command.

1. Copy environment files:

cp apps/api/.env.example apps/api/.env
cp apps/web/.env.example apps/web/.env
cp .env.compose.example .env.compose

2. Build and start:

docker compose --env-file .env.compose -f compose.yml up -d --build

Or use the monorepo scripts:

pnpm docker:build   # Build all images
pnpm docker:up      # Start the stack
pnpm docker:logs    # Stream logs
pnpm docker:ps      # Check running containers
pnpm docker:down    # Stop the stack

3. Available URLs:

Service URL
Web http://localhost:3000
API http://localhost:4000
Swagger UI http://localhost:4000/api/v1/docs

Useful Commands

# Testing
pnpm --filter @poke-cards/api test
pnpm --filter @poke-cards/api test:coverage

# Database
pnpm --filter @poke-cards/api db:migrate
pnpm --filter @poke-cards/api db:seed

# Type checking
pnpm --filter web typecheck

Manual Docker Builds

# API image
docker build -f apps/api/Dockerfile -t poke-cards-api .

# Web image
docker build -f apps/web/Dockerfile -t poke-cards-web .

Author

Made by William Perret

Website · GitHub · LinkedIn · Instagram · Buy Me a Coffee


License

This project is distributed under MIT + Commons Clause.

You can use, study, modify, and distribute the code, but you may not sell the software or commercialize a product or service whose value derives substantially from it.

See LICENSE for the full text.

About

Poke Cards v2 is a full-stack flashcard platform built with Bun, Express, React Router, and Drizzle, designed to create, study, and manage decks with shared Zod contracts, AI-assisted card generation, and a polished modern UI.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages