# Quick Start Guide Get your portfolio website up and running in 5 minutes! ## ⚡ Super Quick Setup (Docker) ```bash # 1. Clone repository git clone https://github.com/aiyu-ayaan/Aiyu.git cd Aiyu # 2. Configure environment cp .env.example .env # Edit .env with your credentials # 3. Generate secrets node -e "console.log('JWT_SECRET=' + require('crypto').randomBytes(64).toString('hex'))" node -e "console.log('POSTGRES_PASSWORD=' + require('crypto').randomBytes(24).toString('hex'))" node -e "console.log('BLOG_API_KEY=' + require('crypto').randomBytes(32).toString('hex'))" # Copy these into your .env file # 4. Start Docker (Postgres + App + Nginx) npm run docker:build npm run docker:up # 5. Login to admin, then seed the database (REQUIRED - FIRST TIME ONLY) # Visit http://localhost/admin and log in, then in the same browser tab: # http://localhost/api/seed # 6. Access your site # Main Site: http://localhost # Admin Panel: http://localhost/admin ``` > `npm run docker:up` runs the production Compose file (`docker-compose.yml`), > which fronts the app with Nginx on port 80. If you want the app published > directly on `:3000` for local building/testing, use `npm run docker:up:dev` > instead (builds from source via `docker-compose-local.yml`). ## 🚨 CRITICAL: First Time Setup ### Step 1: Seed the Database After Docker is running, you **MUST** seed the database. The seed endpoint requires authorization (an admin session or `SEED_SECRET`) — it's not open to the public. **Using Browser:** - Log into `http://localhost/admin` with your `ADMIN_USERNAME`/`ADMIN_PASSWORD` - In the same tab, navigate to `http://localhost/api/seed` - Wait for: `{"success": true, "message": "Database seeded successfully"}` **Using the Prisma script instead (no login needed):** ```bash npm run db:seed ``` ### What Gets Seeded? - ✅ Home page content (name, roles, tagline) - ✅ Sample projects and deployments - ✅ About section (bio, skills, experience) - ✅ Header navigation links - ✅ Social media links (GitHub, LinkedIn, etc.) - ✅ Default configuration (only if none exists yet) ### ⚠️ Important Warnings - Re-running it **deletes and re-creates** Projects/Deployments/About/Home/Header/Social - After seeding, customize via Admin Panel - Backup via Admin Panel → Database → Export before seeding again ## 📋 Minimal .env Configuration Update these in your `.env` file: ```env # PostgreSQL (use your generated password; keep in sync with DATABASE_URL) DATABASE_URL=postgresql://aiyu:YOUR_GENERATED_PASSWORD@postgres:5432/aiyu?schema=public POSTGRES_PASSWORD=YOUR_GENERATED_PASSWORD # Admin Login ADMIN_USERNAME=admin ADMIN_PASSWORD=YourSecurePassword123! # Security (use generated secrets — the app will not start without JWT_SECRET) JWT_SECRET=your_64_character_generated_secret BLOG_API_KEY=your_32_character_generated_key # Basic Info NEXT_PUBLIC_BASE_URL=http://localhost NEXT_PUBLIC_AUTHOR_NAME=Your Name ``` ## 🎯 Quick Customization After seeding and login: 1. **Admin Panel** → `http://localhost/admin` - Login: your `ADMIN_USERNAME` / `ADMIN_PASSWORD` from `.env` 2. **Update Home Page** - Admin Panel → Home - Edit name, roles, tagline 3. **Add Your Projects** - Admin Panel → Projects - Click "Add New Project" - Fill in details, upload images 4. **Customize About** - Admin Panel → About - Update bio, skills, experience 5. **Choose Theme** - Admin Panel → Themes - Select from 52 pre-built themes ## 🔍 Verify Installation Check everything works: ```bash # 1. Check containers running docker ps # 2. Check logs npm run docker:logs # 3. Verify security npm run docker:verify # 4. Test endpoints curl http://localhost curl http://localhost/api/health curl http://localhost/api/projects ``` ## 🚨 Troubleshooting Quick Fixes ### Problem: Blank pages or no content **Solution**: You forgot to seed! Run `npm run db:seed`, or log into `/admin` and visit `/api/seed`. ### Problem: Can't login to admin **Solution**: Check `ADMIN_USERNAME` and `ADMIN_PASSWORD` in `.env`. If `JWT_SECRET` is unset, the app refuses to start at all — check `npm run docker:logs`. ### Problem: Database connection failed **Solution**: Password in `DATABASE_URL` must match `POSTGRES_PASSWORD`, and the host must be `postgres` (in Docker) or `localhost` (host dev). ### Problem: Port 80/3000 in use **Solution**: ```bash # Windows netstat -ano | findstr :80 taskkill /PID [PID] /F # Linux/Mac lsof -ti :80 | xargs kill -9 ``` Or override the port via `NGINX_HTTP_PORT` / `APP_PORT` in `.env`. ### Problem: Docker build fails **Solution**: ```bash docker system prune -a npm run docker:build ``` ## 📚 Next Steps - **[Full Installation Guide](Installation-Guide)** - Detailed instructions - **[Admin Panel Guide](Admin-Panel)** - Manage your content - **[Configuration Guide](Configuration)** - Advanced settings - **[Deployment Guide](Deployment-Guide)** - Go to production ## 💡 Pro Tips 1. **Backup before seeding again**: Seeding deletes Projects/Deployments/About/Home/Header/Social! 2. **Use strong passwords**: Generate with crypto 3. **Enable HTTPS in production**: See the [Deployment Guide](Deployment-Guide) 4. **Setup automated backups**: Use Admin Panel → Database → Export on a schedule 5. **Monitor logs regularly**: `npm run docker:logs` ## 🆘 Need Help? - **[Common Issues](Common-Issues)** - Quick solutions - **[GitHub Issues](https://github.com/aiyu-ayaan/Aiyu/issues)** - Report bugs - **Email**: ayaan35200@gmail.com --- **Estimated Time**: 5 minutes for basic setup, 30 minutes for full customization **That's it!** Your portfolio is now live at `http://localhost` 🎉 --- **Next**: [Installation Guide](Installation-Guide) →