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
