SopHero is a modern web application that helps students create compelling Statements of Purpose (SOPs) for university applications using advanced AI technology. Built with Next.js 15, React 19, and shadcn/ui components, SopHero provides a beautiful, user-friendly interface for generating personalized SOPs powered by OpenAI's GPT-4.
- AI-Powered Generation: Advanced OpenAI GPT-4 technology creates personalized, compelling SOPs
- Professional Templates: Access industry-standard templates and formats
- Quick & Easy: Generate complete SOPs in minutes, not hours
- Quality Assurance: Built-in quality checks ensure university standards
- Personalized Content: Every SOP is uniquely crafted based on your background
- Expert Guidance: Follow proven strategies from successful applicants
- User Authentication: Secure signup/login with email and Google OAuth
- Data Persistence: Save and manage your SOPs with MongoDB integration
- Beautiful UI: Modern, responsive design with shadcn/ui components
- Theme Support: Light/dark mode with system preference detection
- Fallback System: Template-based generation if AI is unavailable
- Frontend: Next.js 15, React 19, TypeScript
- Styling: Tailwind CSS 4, shadcn/ui components
- Authentication: NextAuth.js (Email/Password + Google OAuth)
- Database: MongoDB with Mongoose ODM
- AI: OpenAI GPT-4 API for intelligent SOP generation
- Icons: Lucide React
- Theme: next-themes for dark/light mode
- Security: bcryptjs for password hashing
Before running this project, make sure you have:
- Node.js 18+ installed
- MongoDB database (local or cloud)
- Google OAuth credentials (optional, for Google sign-in)
- OpenAI API key (required for AI-powered SOP generation)
-
Clone the repository
git clone <repository-url> cd ai-sop
-
Install dependencies
npm install
-
Set up environment variables
cp env.example .env.local
Edit
.env.localand add your configuration:# MongoDB Connection MONGODB_URI=mongodb://localhost:27017/sophero # NextAuth Configuration NEXTAUTH_SECRET=your-nextauth-secret-key-here NEXTAUTH_URL=http://localhost:3000 # Google OAuth (Optional) GOOGLE_CLIENT_ID=your-google-client-id GOOGLE_CLIENT_SECRET=your-google-client-secret NEXT_PUBLIC_GOOGLE_OAUTH_ENABLED=true # OpenAI API (Required for AI-powered SOP generation) OPENAI_API_KEY=your-openai-api-key-here # Environment NODE_ENV=development
-
Run the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
- Sign Up: Create an account using email/password or Google OAuth
- Complete Questionnaire: Answer questions about your background, goals, and target program
- Generate SOP: Let SopHero's AI create your personalized Statement of Purpose
- Review & Edit: Make any necessary adjustments to your SOP
- Download: Save your final SOP for submission
- Sign In: Access your SopHero dashboard
- View SOPs: See all your previously created Statements of Purpose
- Create New: Start a new SOP for different programs or universities
- Manage: Download, view, or create new SOPs as needed
ai-sop/
βββ app/ # Next.js app directory
β βββ api/ # API routes
β β βββ auth/ # Authentication endpoints
β β βββ sop/ # SOP management endpoints
β βββ auth/ # Authentication pages
β βββ dashboard/ # User dashboard
β βββ generate-sop/ # SOP generation page
β βββ questionnaire/ # SOP questionnaire
β βββ globals.css # Global styles
β βββ layout.tsx # Root layout
β βββ page.tsx # Home page
βββ components/ # React components
β βββ ui/ # shadcn/ui components
β βββ Navigation.tsx # Navigation bar
β βββ Footer.tsx # Footer component
β βββ theme-provider.tsx # Theme provider
βββ lib/ # Utility libraries
β βββ mongodb.ts # Database connection
β βββ sop-generator.ts # AI SOP generation logic
β βββ demo-data.ts # Sample data
β βββ utils.ts # Utility functions
βββ models/ # Database models
β βββ User.ts # User model
β βββ SOP.ts # SOP model
βββ types/ # TypeScript type definitions
β βββ next-auth.d.ts # NextAuth type extensions
βββ public/ # Static assets
- Email/Password: Traditional authentication with bcrypt password hashing
- Google OAuth: One-click sign-in with Google accounts
- Session Management: JWT-based sessions with NextAuth.js
- Protected Routes: Automatic redirection for unauthenticated users
- MongoDB: NoSQL database for flexible data storage
- User Data: Secure storage of user profiles and authentication info
- SOP Storage: Complete SOP data including questionnaire responses and generated content
- Data Privacy: User data is isolated and secure
- GPT-4 Model: Uses OpenAI's latest language model for sophisticated SOP generation
- Intelligent Prompting: Carefully crafted prompts ensure high-quality, personalized content
- Context Awareness: AI understands academic writing standards and university requirements
- Personalization: Each SOP is uniquely tailored to the applicant's background and goals
- Template-Based Generation: If OpenAI API is unavailable, falls back to template-based generation
- Reliability: Ensures SOP generation always works, even without internet connectivity
- Quality Assurance: Both AI and template methods produce professional-quality SOPs
- Natural Language: Generates human-like, engaging content
- Academic Tone: Maintains professional, scholarly writing style
- Structure Optimization: Creates well-organized, logical flow
- Content Enhancement: Transforms rough ideas into compelling narratives
- Responsive Design: Works perfectly on desktop, tablet, and mobile
- Modern Components: Built with shadcn/ui for consistent, beautiful design
- Theme Support: Light and dark mode with system preference detection
- Loading States: Smooth loading animations and feedback
- Form Validation: Real-time validation and error handling
- Accessibility: WCAG compliant with proper ARIA labels
- Get API Key: Sign up at OpenAI and get your API key
- Add to Environment: Set
OPENAI_API_KEY=your-api-keyin.env.local - Test Generation: Try creating an SOP to verify the API integration
See GOOGLE_OAUTH_SETUP.md for detailed instructions on setting up Google OAuth.
MONGODB_URI: Your MongoDB connection stringNEXTAUTH_SECRET: Secret key for NextAuth.js (generate withopenssl rand -base64 32)NEXTAUTH_URL: Your application URLGOOGLE_CLIENT_ID: Google OAuth client ID (optional)GOOGLE_CLIENT_SECRET: Google OAuth client secret (optional)NEXT_PUBLIC_GOOGLE_OAUTH_ENABLED: Enable/disable Google OAuth buttonOPENAI_API_KEY: Your OpenAI API key (required for AI features)
- Push your code to GitHub
- Connect your repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy automatically
- Netlify: Similar to Vercel deployment
- Railway: Great for full-stack applications
- DigitalOcean: App Platform for easy deployment
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check the Google OAuth Setup Guide
- Review the troubleshooting section in the setup guide
- Open an issue on GitHub
- Contact the development team
- OpenAI for providing the GPT-4 API
- shadcn/ui for beautiful components
- NextAuth.js for authentication
- Tailwind CSS for styling
- Lucide for icons
- MongoDB for database
- Vercel for hosting
SopHero - Your Statement of Purpose Hero π¦ΈββοΈ