A privacy-first web application that learns your unique writing style and transforms any text to match your voice perfectly.
- Personalized Profile: 70+ binary parameters (0 or 1) capture every nuance of your writing style
- Smart Onboarding: 20-question wizard that maps your preferences to style parameters
- AI-Powered Rewriting: Transform any text to match your unique voice using GPT-4
- Version History: Track all your rewrites with full parameter snapshots
- Export & Share: Download your profile as JSON
- Privacy-First: Your data stays secure with encrypted storage
- Authentication: Email/password + OAuth (Google) support
- Frontend: Next.js 14+ (App Router), React, TypeScript, Tailwind CSS
- Backend: Next.js API Routes
- Database: PostgreSQL with Prisma ORM
- Authentication: NextAuth.js
- AI: OpenAI GPT-4o
- Node.js 18+ and npm
- PostgreSQL database
- OpenAI API key (for rewrite functionality)
-
Clone the repository
git clone <your-repo-url> cd aira
-
Install dependencies
npm install
-
Set up environment variables
Update
.env.localwith your values:# Database DATABASE_URL="postgresql://user:password@localhost:5432/aira?schema=public" # NextAuth NEXTAUTH_URL="http://localhost:3000" NEXTAUTH_SECRET="your-secret-key-change-this-in-production" # OAuth Providers (optional) GOOGLE_CLIENT_ID="your-google-client-id" GOOGLE_CLIENT_SECRET="your-google-client-secret" # OpenAI API (required for rewrite functionality) OPENAI_API_KEY="your-openai-api-key"
To generate a secure
NEXTAUTH_SECRET:openssl rand -base64 32
-
Set up the database
# Create the database schema npx prisma migrate dev --name init # Generate Prisma Client npx prisma generate
-
Run the development server
npm run dev
-
Open your browser
Visit http://localhost:3000
- Stores user authentication and profile information
- Supports both email/password and OAuth authentication
- Stores the 70+ binary parameters for each user
- Includes a scorecard explaining which onboarding answers set which parameters
- Version tracking for parameter changes
- Stores rewrite history
- Each entry includes input text, output text, and parameter snapshot
- Enables users to track how their profile evolution affects outputs
AIRA tracks 70+ binary parameters across 11 categories:
- Personality (12 params): Assertive, supportive, confident, cautious, humorous, etc.
- Tone (10 params): Formal, casual, friendly, academic, technical, etc.
- Style (12 params): Active voice, storytelling, bullets, examples, analogies, etc.
- Structure (10 params): Intro, summary, conclusion, problem-solution, steps, etc.
- Punctuation (8 params): Em dashes, Oxford comma, exclamations, emoji, etc.
- Audience (6 params): Experts, executives, students, general public, etc.
- Content Safety (6 params): Sensitive topics, medical/legal/financial disclaimers, etc.
- Productivity (5 params): Templates, auto-headings, outlines, variants, summaries
- Formatting (7 params): Plain language, reading level, title case, Markdown, etc.
- Sign Up → Create account with email/password or Google OAuth
- Onboarding → Answer 20 questions about writing preferences
- Profile Creation → System computes 70+ binary parameters from answers
- Dashboard → View/edit profile, rewrite text, access history
- Rewrite → Paste text and transform it to match your voice
- History → Track all rewrites with parameter snapshots
- Export → Download profile as JSON for backup or sharing
POST /api/auth/signup- Create new accountPOST /api/auth/signin- Sign in with credentialsGET /api/auth/session- Get current session
POST /api/profile/onboarding- Save profile from onboarding answersGET /api/profile- Get user's profilePUT /api/profile- Update profile parameters
POST /api/rewrite- Rewrite text using user's profile
GET /api/responses- Get rewrite historyPOST /api/responses- Save rewrite to history
npm run devnpm run build
npm start# Create a new migration
npx prisma migrate dev --name your_migration_name
# Apply migrations in production
npx prisma migrate deploy
# View database in Prisma Studio
npx prisma studionpx tsc --noEmitEnsure all environment variables are set in your production environment:
DATABASE_URL- Production PostgreSQL connection stringNEXTAUTH_URL- Production URL (e.g., https://yourdomain.com)NEXTAUTH_SECRET- Secure random stringOPENAI_API_KEY- OpenAI API key- OAuth credentials (if using Google/Apple sign-in)
- Push code to GitHub
- Import project in Vercel
- Set environment variables
- Deploy
The app will automatically build and deploy.
- Password Hashing: bcrypt with 12 rounds
- Session Management: JWT-based sessions with 30-day expiry
- Rate Limiting: 120 requests per minute per user
- PII Encryption: Sensitive data encrypted at rest
- HTTPS Only: Force secure connections in production
- CSRF Protection: Built into NextAuth.js
- Input Validation: Zod schema validation on all inputs
AIRA is privacy-first:
- No tracking or analytics by default
- User data never shared with third parties
- OpenAI API calls are stateless (not used for training)
- Users can export and delete their data anytime
# Test database connection
npx prisma db push- Verify your API key is valid and has credits
- Check rate limits on your OpenAI account
- Ensure
OPENAI_API_KEYenvironment variable is set
# Clean install
rm -rf node_modules package-lock.json
npm install
# Regenerate Prisma Client
npx prisma generateMIT License - see LICENSE file for details
For issues or questions, please open an issue on GitHub.
Built with ❤️ using Next.js, Prisma, and OpenAI