Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deploy Docs

on:
push:
branches: [main]
paths:
- 'docs/**'
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: cd docs && bun install --frozen-lockfile

- name: Build static site
run: cd docs && bun run build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/out

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
</p>

<p align="center">
<a href="docs/">Documentation</a> &bull;
<a href="#getting-started">Getting Started</a> &bull;
<a href="#supported-resources">Resources</a> &bull;
<a href="#sdk-usage">SDK Usage</a> &bull;
Expand All @@ -25,7 +26,7 @@ Strimulator is a drop-in local replacement for the Stripe API. It runs as a sing
- **Full control** — Trigger payment failures, advance subscriptions, simulate edge cases from the dashboard
- **SDK-compatible** — Point the official `stripe` package at localhost and it just works
- **Docker-ready** — Drop it into your docker-compose alongside Postgres, Redis, Firebase emulator, etc.
- **464 tests** — Strict fidelity to Stripe's API shapes, state machines, and error formats
- **496 tests** — Strict fidelity to Stripe's API shapes, state machines, and error formats

## Getting Started

Expand Down Expand Up @@ -275,16 +276,30 @@ tests/
unit/ # Service-layer tests
integration/ # HTTP request/response tests
sdk/ # Tests using the official stripe npm package
docs/ # Fumadocs documentation site (Next.js)
```

## Documentation

Full documentation is available in the `docs/` directory. To run it locally:

```bash
cd docs
bun install
bun run dev
```

Then open http://localhost:3000 for the docs site with Getting Started guides, API reference, and architecture documentation.

## Tech Stack

- **Runtime:** [Bun](https://bun.sh)
- **Framework:** [ElysiaJS](https://elysiajs.com)
- **Database:** SQLite via [Drizzle ORM](https://orm.drizzle.team) + bun:sqlite
- **Types:** Imported from the [`stripe`](https://www.npmjs.com/package/stripe) npm package
- **Dashboard:** [Preact](https://preactjs.com) + [HTM](https://github.com/developit/htm) (loaded from CDN)
- **Testing:** bun:test (464 tests)
- **Testing:** bun:test (496 tests)
- **Documentation:** [Fumadocs](https://fumadocs.dev) + OpenAPI

## License

Expand Down
4 changes: 4 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.next/
node_modules/
.source/
out/
42 changes: 42 additions & 0 deletions docs/app/docs/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { source } from '@/lib/source';
import { notFound } from 'next/navigation';
import {
DocsPage,
DocsBody,
DocsTitle,
DocsDescription,
} from 'fumadocs-ui/page';
import { getMDXComponents } from '@/components/mdx';
import type { ComponentType } from 'react';

export default async function Page({
params,
}: {
params: Promise<{ slug?: string[] }>;
}) {
const { slug } = await params;
const page = source.getPage(slug);

if (!page) notFound();

const data = page.data as typeof page.data & {
body: ComponentType<{ components?: Record<string, unknown> }>;
toc: { depth: number; url: string; title: string }[];
};

const Mdx = data.body;

return (
<DocsPage toc={data.toc}>
<DocsTitle>{data.title}</DocsTitle>
<DocsDescription>{data.description}</DocsDescription>
<DocsBody>
<Mdx components={getMDXComponents()} />
</DocsBody>
</DocsPage>
);
}

export function generateStaticParams() {
return source.generateParams();
}
12 changes: 12 additions & 0 deletions docs/app/docs/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
import { baseOptions } from '@/lib/layout.shared';
import { source } from '@/lib/source';
import type { ReactNode } from 'react';

export default function Layout({ children }: { children: ReactNode }) {
return (
<DocsLayout {...baseOptions()} tree={source.getPageTree()}>
{children}
</DocsLayout>
);
}
6 changes: 6 additions & 0 deletions docs/app/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@import 'tailwindcss';
@import 'fumadocs-ui/css/neutral.css';
@import 'fumadocs-ui/css/preset.css';

@source '../node_modules/fumadocs-ui/dist/**/*.js';
@source '../node_modules/fumadocs-openapi/dist/**/*.js';
13 changes: 13 additions & 0 deletions docs/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { RootProvider } from 'fumadocs-ui/provider/next';
import type { ReactNode } from 'react';
import './global.css';

export default function Layout({ children }: { children: ReactNode }) {
return (
<html lang="en" suppressHydrationWarning>
<body className="flex flex-col min-h-screen">
<RootProvider>{children}</RootProvider>
</body>
</html>
);
}
5 changes: 5 additions & 0 deletions docs/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { redirect } from 'next/navigation';

export default function Home() {
redirect('/docs');
}
Loading
Loading