Skip to content

Latest commit

Β 

History

History
116 lines (85 loc) Β· 3.31 KB

File metadata and controls

116 lines (85 loc) Β· 3.31 KB

Infipedia

An infinite, AI-generated encyclopedia where every word is a gateway to discovery. Powered by Google's Gemini AI.

Features

  • πŸ€– AI-Generated Content: Real-time streaming content generation using Gemini 2.5 Flash Lite
  • 🎨 ASCII Art Visualization: Creative ASCII art generated for each topic
  • πŸ”— Interactive Navigation: Click any word to explore related topics
  • 🎲 Random Discovery: Explore curated interesting concepts with the random button
  • ⚑ Fast & Responsive: Built with Next.js 15 and optimized for performance
  • 🎭 Modern UI: Beautiful, theme-aware interface using Tailwind CSS

Getting Started

Prerequisites

  • Node.js 20+ (as specified in the project requirements)
  • A Gemini API key from Google AI Studio

Installation

  1. Clone the repository:
git clone <repository-url>
cd infipedia
  1. Install dependencies:
npm install
  1. Set up environment variables:
# Create .env.local file in the root directory
echo "GEMINI_API_KEY=your_gemini_api_key_here" > .env.local

Replace your_gemini_api_key_here with your actual Gemini API key.

  1. Run the development server:
npm run dev
  1. Open http://localhost:3000 in your browser.

Project Structure

infipedia/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ actions/
β”‚   β”‚   └── gemini.ts          # Server Actions for secure API calls
β”‚   β”œβ”€β”€ globals.css            # Global styles with Tailwind
β”‚   β”œβ”€β”€ layout.tsx             # Root layout with metadata
β”‚   └── page.tsx               # Main page component (HomePage)
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ AsciiArt.tsx           # ASCII art display component
β”‚   β”œβ”€β”€ ContentDisplay.tsx     # Content rendering with interactive words
β”‚   β”œβ”€β”€ LoadingSkeleton.tsx    # Loading state component
β”‚   └── Header.tsx             # Header with search and random navigation
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ constants.ts           # Predefined words for random selection
β”‚   β”œβ”€β”€ types.ts               # Shared TypeScript types
β”‚   └── utils.ts               # Utility functions
└── .env.local                 # Environment variables (not in git)

Security

This project implements Next.js 15 Server Actions to keep the Gemini API key secure:

  • API calls are made server-side only
  • The API key never reaches the client
  • Streaming responses are handled securely through Server Actions

Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm start - Start production server
  • npm run lint - Run ESLint
  • npm run format - Format code with Prettier
  • npm run format:check - Check code formatting

Technologies Used

  • Framework: Next.js 15 (App Router)
  • Language: TypeScript
  • Styling: Tailwind CSS 4
  • AI: Google Gemini 2.5 Flash & Flash Lite
  • UI Components: shadcn/ui components
  • Code Quality: ESLint, Prettier, Husky, lint-staged

Theme Support

The app uses CSS variables for theming. To customize the theme, modify the CSS variables in app/globals.css:

:root {
	--background: oklch(0.9821 0 0);
	--foreground: oklch(0.3485 0 0);
	--primary: oklch(0.4891 0 0);
	/* ... more variables */
}

Credits

Powered by Google Gemini AI