Skip to content

kananimaulik26/text-gpt-p5-app

This branch is 10 commits behind mattelim/text-gpt-p5-app:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e73d3ec Β· May 1, 2023

History

34 Commits
Apr 25, 2023
May 1, 2023
Apr 26, 2023
May 1, 2023
Apr 26, 2023
Apr 27, 2023
Apr 25, 2023
Apr 27, 2023
Apr 26, 2023
Apr 25, 2023
May 1, 2023
Apr 26, 2023
Apr 27, 2023
Apr 27, 2023
Apr 25, 2023
Apr 26, 2023

Repository files navigation

Text-GPT-p5

A text to p5.js generative editor powered by GPT-3.5 ✨

  1. takes plain text prompts πŸ“
  2. makes an OpenAI GPT-3.5 call πŸ€–
  3. converts them into p5.js code 🌸
  4. displays the p5.js sketch πŸ–ΌοΈ

It is also a sandbox environment for running p5.js (or any javascript code). You can make direct edits to the generated code, which re-runs the sketch immediately, similar to Glitch or Replit.

Under the hood

A Next.js full-stack app (React, Next API routes).

Node module(s):

  • react-codemirror
  • cors

Getting Started

To get started, clone the repository and install the necessary node modules.

npm install

Environment Variables

Make a copy of the .env.example file, rename it as .env. Enter your OpenAI API key. Specific instructions 5 & 6 here.

The example also includes a NEXT_PUBLIC_REMOTE_API_URL and WHITELISTED_DOMAINS, in case you want to fetch from another server.

Development, Build, Deploy

Next.js defaults. See package.json for commands. Both dev and production are on port 3000.

Acknowledgments πŸ™

About

Text to p5.js Generative Editor powered by OpenAI GPT

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 89.7%
  • Dockerfile 5.6%
  • CSS 4.7%