A modern, full-stack portfolio website built with a monorepo architecture. Features a React/TypeScript frontend with SSR and a KeystoneJS 6 headless CMS backend, all managed in a single repository.
- Frontend:
web/
— React Router v7, TypeScript, TailwindCSS, SSR, GraphQL client - Backend:
cms/
— KeystoneJS 6, PostgreSQL, Prisma ORM, GraphQL API - Monorepo: Unified development, shared tooling, and consistent TypeScript across both apps
- Framework: React Router v7 (file-based routing, SSR, pre-rendering)
- Language: TypeScript (strict mode)
- Styling: TailwindCSS v4,
@tailwindcss/typography
,tailwindcss-animate
- GraphQL:
graphql-request
client, codegen via@graphql-codegen
- UI: Custom component library using
cva
(Class Variance Authority) - Analytics: PostHog integration
- Build: Vite, TypeScript path mapping
web/app/
├── components/ # Reusable UI components
├── routes/ # React Router v7 routes
├── utils/ # Utility functions
├── generated/ # Auto-generated GraphQL types
├── queries/ # GraphQL query definitions
└── images/ # Static assets
npm run dev:web
— Start frontend dev servernpm run generate:types
— Generate GraphQL types from CMS schema- Server-side data fetching in route loaders
- Use absolute imports with
~/
prefix
- Framework: KeystoneJS 6 (headless CMS)
- Database: PostgreSQL (Prisma ORM)
- Auth: KeystoneJS built-in, bcrypt password hashing
- API: Auto-generated GraphQL at
/api/graphql
- Language: TypeScript
cms/
├── keystone.ts # Main Keystone config
├── schema.ts # Database schema
├── auth.ts # Auth config
├── seed.ts # DB seeding
├── migrations/ # Prisma migrations
npm run dev:cms
— Start CMS dev server (admin UI at/admin
)- GraphQL playground at
/api/graphql
- Use Prisma migrations for schema changes
npm run generate:types
after schema changes
-
Install dependencies
npm install
-
Set up environment variables
- Copy
.env.example
to.env
in bothweb/
andcms/
as needed - Fill in database URLs, secrets, etc.
- Copy
-
Run development servers
npm run dev # or run frontend/cms separately: npm run dev:web npm run dev:cms
-
Generate GraphQL types
npm run generate:types
-
Apply database migrations
cd cms && npx prisma migrate deploy
-
Seed the database
cd cms && npm run seed
- Production CMS endpoint:
https://admin.sethdavis.tech/api/graphql
- Environment-specific database URLs
- Session management with secure cookies
- CORS configured for production domains
- All secrets in environment variables
- Passwords hashed with bcrypt
- Input validation on client and server
- TypeScript for compile-time safety
- CORS and session security
PRs and issues welcome! Please follow the established code style and patterns:
- Strict TypeScript
- Functional, compositional React
- TailwindCSS utilities
- GraphQL codegen for types
- Server-side data fetching in loaders
MIT © Seth Davis