A Next.js application that uses AI to help generate responses to Request for Proposals (RFPs). Built with AWS infrastructure for production scalability.
- Node.js 18+ and pnpm installed
- AWS CLI configured with
rubywellprofile - Git with SSH keys set up for GitHub
git clone git@github.com:run-llama/auto_rfp.git
cd auto_rfp
pnpm installCopy the environment template:
cp .env.example .env.localAdd your OpenAI API key to .env.local:
OPENAI_API_KEY=your_openai_api_key_herecd infrastructure
npm install
npm run deployThis will create:
- RDS PostgreSQL database
- AWS Cognito User Pool
- S3 bucket for documents
- VPC with proper networking
- AWS SES for emails
# Get infrastructure outputs
aws cloudformation describe-stacks \
--stack-name AutoRfpInfrastructureStack \
--profile rubywell \
--output json > infrastructure-outputs.json
# Create Amplify app (run once)
aws amplify create-app \
--name auto-rfp \
--repository git@github.com:run-llama/auto_rfp.git \
--profile rubywell
# Connect branch
aws amplify create-branch \
--app-id YOUR_APP_ID \
--branch-name main \
--profile rubywellSet the following in AWS Amplify Console or via CLI:
DATABASE_URL: From infrastructure outputsDIRECT_URL: Same as DATABASE_URLNEXT_PUBLIC_COGNITO_USER_POOL_ID: From infrastructure outputsNEXT_PUBLIC_COGNITO_CLIENT_ID: From infrastructure outputsNEXT_PUBLIC_S3_BUCKET_NAME: From infrastructure outputsOPENAI_API_KEY: Your OpenAI API key
git add .
git commit -m "Initial setup"
git push origin mainAWS Amplify will automatically build and deploy your application.
# Start development server
pnpm dev
# Run database migrations
pnpm prisma migrate dev
# Generate Prisma client
pnpm prisma generate- AWS infrastructure deployed
- Database configured
- Authentication system (Cognito)
- Build pipeline (AWS Amplify)
- File storage (S3)
- RDS networking optimization
- Full authentication integration
- Database migration automation
# Database operations
pnpm prisma studio # Open database GUI
pnpm prisma migrate dev # Create and run migrations
pnpm prisma generate # Generate Prisma client
# Build and test
pnpm build # Build for production
pnpm start # Start production server
pnpm lint # Run linter
# Infrastructure
cd infrastructure
npm run deploy # Deploy AWS infrastructure
npm run destroy # Destroy AWS infrastructure (careful!)# List Amplify apps
aws amplify list-apps --profile rubywell --output table
# Check build status
aws amplify list-jobs \
--app-id YOUR_APP_ID \
--branch-name main \
--profile rubywell \
--output table
# Check database status
aws rds describe-db-instances \
--profile rubywell \
--output table# Get current environment variables
aws amplify get-branch \
--app-id YOUR_APP_ID \
--branch-name main \
--profile rubywell \
--query 'branch.environmentVariables' \
--output table
# Update environment variables
aws amplify update-branch \
--app-id YOUR_APP_ID \
--branch-name main \
--environment-variables '{"KEY":"VALUE"}' \
--profile rubywellauto_rfp/
βββ app/ # Next.js app directory
β βββ api/ # API routes
β βββ auth/ # Authentication pages
β βββ organizations/ # Organization management
β βββ projects/ # Project management
βββ components/ # React components
βββ lib/ # Utility libraries
β βββ utils/cognito/ # AWS Cognito utilities
β βββ services/ # Business logic
βββ infrastructure/ # AWS CDK infrastructure
βββ prisma/ # Database schema and migrations
βββ local-docs/ # Development documentation
βββ amplify.yml # AWS Amplify build configuration
Build fails with database connection errors:
# Check if RDS is in public subnets
aws rds describe-db-instances \
--db-instance-identifier YOUR_DB_ID \
--profile rubywell \
--query 'DBInstances[0].PubliclyAccessible'
# Check security groups
aws ec2 describe-security-groups \
--group-ids YOUR_SG_ID \
--profile rubywell1Password SSH issues:
# Disable commit signing
git config --global commit.gpgsign false
# Use regular SSH agent
unset SSH_AUTH_SOCK
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519Environment variable errors:
# Check all environment variables are set
aws amplify get-branch \
--app-id YOUR_APP_ID \
--branch-name main \
--profile rubywell \
--query 'branch.environmentVariables'- Architecture: local-docs/aws-migration-plan.md
- Troubleshooting: local-docs/aws-migration-lessons-learned.md
- RDS Networking: local-docs/rds-networking-issue-and-solution.md
- Quick Start: local-docs/quick-start-guide.md
- AWS Amplify Console:
https://console.aws.amazon.com/amplify/ - Live Application:
https://main.dk7mzhfo2065a.amplifyapp.com - RDS Console:
https://console.aws.amazon.com/rds/ - Cognito Console:
https://console.aws.amazon.com/cognito/
Estimated monthly costs:
- RDS PostgreSQL (t3.micro): ~$15.00
- S3 Storage: ~$0.25
- Cognito: Free (up to 50k users)
- AWS SES: ~$0.10
- AWS Amplify: ~$0.15
Total: ~$15.50/month
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
MIT License - see LICENSE file for details.
For urgent issues or questions, check the troubleshooting documentation in local-docs/ or create an issue in the GitHub repository.