Git Product home page Git Product logo

gemini-vue-chat-cloudflare's Introduction

Vue Gemini Chat

Vue Gemini Chat is a web application that allows users to chat with an AI-powered bot using the Google's Gemini API. It is built with Vue.js, Pinia for state management, and Tailwind CSS for styling. The backend is powered by a Cloudflare Worker, which handles user authentication and communication with the Gemini API.

Follow me @elz0xn

Features

  • User registration and login
  • Chat interface for conversing with the Gemini AI bot
  • Markdown support for chat messages
  • Responsive design using Tailwind CSS with Daiysui
  • Using Cloudflare Workers and Cloudflare D1 for Storasge

Installation

  1. Clone the repository:

    git clone [email protected]:elsodev/gemini-vue-chat-cloudflare.git

  2. Navigate to the project directory:

    cd gemini-vue-chat-cloudflare

  3. Install Dependencies at root directory for Vue and at /cloudflare for CF workers.

    npm install or yarn

  4. Set up the Cloudflare Worker:

  • /cloudflare/src/index.js is the main functions of the worker

  • Create a /cloudflare/wrangler.toml , this is the configurations for your worker, env vars and D1 Database

  • /cloudflare/schema.sql is the Database Schema to run for D1

    • To run for local D1, run yarn run wrangler d1 execute vue_chat --file=./schema.sql
  • In cloudflare/wrangler.toml

    #:schema node_modules/wrangler/config-schema.json
    name = "gemini-chat-worker"
    main = "src/index.js"
    compatibility_date = "2024-05-29"
    compatibility_flags = ["nodejs_compat"]
    
    [vars]
    GEMINI_API_KEY = "REPLACE_YOUR_GEMINI_KEY"
    
    [[d1_databases]]
    binding = "DB" # i.e. available in your Worker on env.DB
    database_name = "vue_chat"
    database_id = "REPLACE_YOUR_D1_KEY"
    

Usage

You need to start Vue App and also run local Cloudflare workers(or you can deploy to your Cloudflare account)

  1. Start Cloudflare workers locally: yarn run wrangler dev --local

  2. You will be shown your workers local address copy that and replace VUE_APP_CLOUDFLARE_WORKER_URL value of .env at root directory (Your Vue Env)

  3. Start the development server at root of the project for Vue App: npm run serve

  4. You will be shown local address of your Vue App being served typically http://localhost:8080

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

gemini-vue-chat-cloudflare's People

Contributors

elsodev avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.