5.0 KiB
description
| description |
|---|
| Initialize a new Next.js + DynamoDB project with Robin's opinionated stack |
Robin Project Initialization
Initialize a complete, production-ready Next.js 15 application with DynamoDB, following Robin's hyper-opinionated philosophy.
What This Command Does
Creates a fully-configured Next.js application with:
- Next.js 15 App Router (strict, no Pages Router)
- TypeScript strict mode configured
- Tailwind CSS pre-configured
- DynamoDB single-table schema starter
- NextAuth.js v5 authentication setup
- Testing infrastructure (Vitest + Playwright)
- SST deployment configuration
- ESLint + Prettier enforced code style
- All Robin standards and best practices
Interactive Setup
Ask the user for these details:
-
Project Name
- Validate: lowercase, alphanumeric with hyphens
- Example:
my-saas-app
-
Deployment Target
- Options:
aws(SST) orvercel - Default:
aws
- Options:
-
Include Authentication?
- Options:
yesorno - Default:
yes - If yes: includes NextAuth.js with Google + GitHub OAuth providers
- Options:
-
Application Type
- Options:
basic(todo-style app),saas(multi-tenant), orblog(content platform) - Default:
basic - Determines DynamoDB schema template
- Options:
Implementation Steps
-
Create Project Directory
mkdir <project-name> cd <project-name> -
Copy Template Files
- Use
fullstack-package.jsontemplate - Copy
tsconfig.json,tailwind.config.ts,.gitignore,.env.example - Adjust project name in package.json
- Use
-
Create Next.js App Structure
app/ ├── (auth)/ │ ├── login/page.tsx │ └── register/page.tsx ├── (dashboard)/ │ ├── layout.tsx │ └── page.tsx ├── api/ │ └── health/route.ts ├── actions.ts ├── layout.tsx └── page.tsx -
Set Up DynamoDB Configuration
- Copy appropriate template from
templates/dynamodb/ - Create
lib/db/client.tswith DynamoDB client - Create
lib/db/types.tswith TypeScript types - Create
lib/db/repository.tswith query methods
- Copy appropriate template from
-
Configure Authentication (if selected)
- Create
lib/auth/config.tswith NextAuth configuration - Create
app/api/auth/[...nextauth]/route.ts - Create
middleware.tsfor route protection - Add OAuth provider environment variables to
.env.example
- Create
-
Set Up SST (if AWS deployment selected)
- Create
sst.config.ts - Create
stacks/Database.tswith DynamoDB table - Create
stacks/Web.tswith Next.js site - Add SST scripts to package.json
- Create
-
Create Component Library
components/ ├── ui/ │ ├── button.tsx │ ├── card.tsx │ └── input.tsx └── features/ └── (feature-specific components) -
Set Up Testing
- Create
vitest.config.ts - Create
playwright.config.ts - Create
tests/unit/andtests/e2e/directories - Add sample tests
- Create
-
Initialize Git
git init git add . git commit -m "Initial commit: Robin-generated Next.js + DynamoDB app" -
Install Dependencies
npm install -
Generate README
- Project-specific README with:
- Setup instructions
- Environment variable configuration
- Development commands
- Deployment instructions
- Architecture overview
- Project-specific README with:
Post-Setup Instructions
After scaffolding, provide the user with:
✅ Robin has created your Next.js + DynamoDB application!
## Next Steps
1. Copy `.env.example` to `.env.local` and fill in values:
```bash
cp .env.example .env.local
-
Configure your AWS credentials (for SST):
aws configure -
Start development server:
npm run dev -
Run tests:
npm test -
Deploy to AWS:
npm run deploy
What Robin Created
- ✅ Next.js 15 App Router with TypeScript
- ✅ DynamoDB single-table schema
- ✅ NextAuth.js authentication (if selected)
- ✅ Tailwind CSS styling
- ✅ SST deployment config (if selected)
- ✅ Testing infrastructure
- ✅ Production-ready structure
Robin's Philosophy
This project follows Robin's hyper-opinionated approach:
- Server Components by default
- Single-table DynamoDB design
- Test-driven development
- No technology debates
- Focus on shipping
Start building! Robin has eliminated all the setup decisions for you.
## Important Notes
- **No Choices During Setup**: Don't ask about styling libraries, state management, or other tech stack decisions. Robin is opinionated.
- **Enforce Standards**: All generated code must follow Robin's strict TypeScript, ESLint, and Prettier rules.
- **Complete Setup**: Don't generate partial projects. Everything should be ready to run after `npm install`.
- **Production-Ready**: Include error handling, loading states, and proper TypeScript types from the start.
You ship functional, complete applications. Period.