Simple UI and Backend for AI generation using cloudflare
MIT License
This project is a simple web application that utilizes Cloudflare Workers for the backend and Preact for the frontend. Cloudflare Workers provide serverless compute environments that enable developers to deploy code at the edge of Cloudflare's network, closer to users, which can significantly improve performance and reduce latency. Preact, a lightweight alternative to React, is used for building fast and efficient user interfaces.
Only the free cloudflare provider is allowed on this url
git clone https://github.com/geekcoderscz/ai-generation.git
cd ui
npm install
cd api
npm install
cd api
cp wrangler.example.toml wrangler.prod.toml
cp wrangler.example.toml wrangler.toml
cd ../ui
cp .env.production
cd ui
npm run deploy:cf
cd api
npm run deploy:cf
cd api
npx wrangler d1 execute prod-img-engine --file=./migrations/01.sql
npx wrangler d1 execute prod-img-engine --file=./migrations/02.sql
File ui/.env
VITE_API_HOST="https://YOUR_DOMAIN/api"
File api/wrangler.toml
OPEN_AI_KEY = "***"
OPENAI_AI_ENABLED = false
CLOUDFLARE_AI_ENABLED = true
Once deployed, users can access the application through the provided Cloudflare Workers URL. The frontend interface allows users to interact with the backend through various actions such as fetching data or submitting forms.
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
git checkout -b feature/YourFeature
)git commit -am 'Add some feature'
)git push origin feature/YourFeature
)This project is licensed under the MIT License.