A simple affirmation generator built with Next.js, Tailwind CSS. The app features a soothing blue-themed UI and fetches positive affirmations to uplift your day! 🌟
- Fetches affirmations from affirmations.dev
- Next.js API route to handle API requests and avoid CORS issues
- Responsive and clean blue-themed UI
git clone https://github.com/jemorak/affirmation-generator.git
cd affirmation-generatornpm installnpm run devThe app will be available at http://localhost:3000 🌐
📁 affirmation-generator
├── 📁 pages
│ ├── 📄 index.tsx
│ ├── 📁 api
│ │ ├── 📄 affirmation.ts (API route to fetch affirmations)
├── 📁 public
│ ├── 🎨 hand-drawn-aesthetic-blue-background-vector.jpg (Background image)
├── 📁 styles
│ ├── 📄 globals.css (Tailwind styles)
├── 📄 package.json
- Next.js – React framework for SSR & API routes
- Tailwind CSS – Utility-first styling
- Fetch API – Calls external API via Next.js backend
To avoid CORS issues, this app uses a Next.js API route (/api/affirmation.ts) to fetch affirmations server-side before sending them to the frontend.
- Add animations (e.g., fade-in and floating objects effects)
- Save affirmations to local storage
