Skip to content

EnzoBarros859/simple-openai

Repository files navigation

Simple AI Text Generator

A modern web application that generates AI-powered responses using OpenAI's GPT-3.5 Turbo model. Built with Next.js, TypeScript, and Tailwind CSS.

Features

  • Real-time AI text generation
  • Clean and responsive UI
  • Error handling and loading states
  • OpenAI GPT-3.5 Turbo integration
  • TypeScript support
  • Tailwind CSS styling

Prerequisites

Before you begin, ensure you have:

  • Node.js (Latest LTS version recommended)
  • An OpenAI API key
  • npm or yarn package manager

Environment Setup

  1. Clone the repository
  2. Create a .env file in the root directory
  3. Add your OpenAI API key:
OPENAI_API_KEY=your_api_key_here

Installation

# Install dependencies
npm install
# or
yarn install

# Run the development server
npm run dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the application.

Project Structure

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

Technologies Used

Development

# Run in development mode with hot reload
npm run dev:watch
# or
yarn dev:watch

# Build for production
npm run build
# or
yarn build

# Start production server
npm start
# or
yarn start

Error Handling

The application includes comprehensive error handling for:

  • API connection issues
  • Invalid inputs
  • OpenAI API errors
  • Network problems

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Acknowledgments

  • OpenAI for providing the GPT-3.5 Turbo API
  • Next.js team for the excellent framework
  • Vercel for hosting solutions

About

next.js, open ai, tailwindcss

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •