Skip to content

Latest commit

Β 

History

History
55 lines (45 loc) Β· 1.75 KB

File metadata and controls

55 lines (45 loc) Β· 1.75 KB

πŸ’  Affirmation Generator

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! 🌟

✨ Features

  • Fetches affirmations from affirmations.dev
  • Next.js API route to handle API requests and avoid CORS issues
  • Responsive and clean blue-themed UI

πŸ“Έ Screenshot

image

πŸš€ Getting Started

1️⃣ Clone the repository

git clone https://github.com/jemorak/affirmation-generator.git
cd affirmation-generator

2️⃣ Install dependencies

npm install

3️⃣ Run the development server

npm run dev

The app will be available at http://localhost:3000 🌐

πŸ“‚ Project Structure

πŸ“ 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

πŸ› οΈ Technologies Used

  • Next.js – React framework for SSR & API routes
  • Tailwind CSS – Utility-first styling
  • Fetch API – Calls external API via Next.js backend

πŸ”— API Handling

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.

πŸ“Œ Future Improvements

  • Add animations (e.g., fade-in and floating objects effects)
  • Save affirmations to local storage