Fun with AI is an app with two modes:
- Send plain-text prompts to GPT-3 using the OpenAI API and receive a response
- Send images to the backend, where optical character recognition (OCR) is performed using TesseractJS's library and the result is sent to OpenAI's API for cleanup and final processing
Sending a prompt:
Uploading an image for OCR text extraction and GPT-3 cleanup:
GPT-3 generating a colour based on a prompt, and the app theme reflecting it to the user:
The app is fully responsive and suitable for mobile devices:
Front End
- React
- HTML
- CSS
Back End
- Node.js
- Express
- Multer
- TesseractJS
APIs
- OpenAI
- imgur
- Create the
.env
by using.env.example
as a reference:cp .env.example .env
- Update the .env file with your correct local information
- OPENAI_API_KEY: Get an API key for free at OpenAI
- CLIENT_ID: Create an account at imgur and register an application here
- Install dependencies:
npm i
- Run the Node.js server in the 'backend' directory:
npm run dev
- Note: nodemon is used, so you should not have to restart your server
- Run the React server in the 'frontend' directory:
npm start
- Visit
http://localhost:3000/
Built by Andrew McNeill