Skip to content

virden26-sudo/Agenda_plus

Repository files navigation

Agenda_plus

Simple helper for local development: an Express proxy plus a Kotlin shared client.

Overview

  • Lightweight Node server in app.js exposing GET /health and POST /generate.
  • Kotlin shared module provides HttpChatClient which calls the proxy by default.

Quick start

  1. Install dependencies:
npm install
  1. Start the server:
npm start

Environment (PowerShell example)

$env:GEMINI_ENDPOINT = 'https://your-gemini-endpoint'
$env:GEMINI_API_KEY = 'YOUR_KEY'
npm start

API examples

  • Health check:
curl http://localhost:3000/health
  • Generate (proxy):
curl -X POST http://localhost:3000/generate \
  -H "Content-Type: application/json" \
  -d '{"prompt":"Hello"}'

Kotlin usage

Use HttpChatClient from the shared module. By default it calls http://localhost:3000/generate.

val client = HttpChatClient()
val response = client.sendMessage("Hello", apiKey)

Security

  • Do NOT commit real API keys. Use environment variables, keystore or CI secrets.

License

  • MIT

Capacitor (mobile)

  • If you're building a mobile app with Capacitor, the project uses www/ as the web assets directory.
  • Quick commands (run from project root):
# build web assets (optional)
npm run build

# add android (only once)
npx cap add android

# copy web assets + plugins
npx cap sync android

# open Android Studio
npx cap open android
  • Web fetch (works in browser / web runtime):
async function generate(prompt: string) {
  const res = await fetch('http://localhost:3000/generate', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ prompt })
  });
  return await res.json();
}
  • Native (avoid CORS) using @capacitor-community/http:
npm install @capacitor-community/http
npx cap sync
import { Http } from '@capacitor-community/http';

async function generate(prompt: string) {
  const opts = {
    url: 'http://localhost:3000/generate',
    headers: { 'Content-Type': 'application/json' },
    data: { prompt }
  };
  const res = await Http.post(opts);
  return res.data;
}

Notes: prefer the native plugin on device to avoid CORS; never hardcode API keys in client code.

Agenda_plus — Node Gemini helper & Kotlin integration

Quick summary

  • A small Express helper is in app.js exposing GET /health and POST /generate.
  • The Kotlin shared module contains HttpChatClient which defaults to http://localhost:3000/generate.

Run locally

  1. Install Node deps (already run in this workspace):
npm install
  1. Set environment variables (preferred) or use --endpoint / --key in CLI/HTTP body.
  • Example using environment variables (PowerShell):
$env:GEMINI_API_KEY = 'AIzaSyAc-5b06tOEjZOe_PZTEQAkqdvXnYLaPb4Y'
npm startowershell

  1. Health check:
curl http://localhost:3000/health
  1. Proxy a generate request (body: { "prompt":"Hi" }):
curl -X POST http://localhost:3000/generate -H "Content-Type: application/json" -d '{"prompt":"Hello","endpoint":"https://your-gemini-endpoint","key":"YOUR_KEY"}'

Kotlin usage

In shared code use HttpChatClient:

val client = HttpChatClient()
val response = client.sendMessage("Hello", apiKey)

By default endpointUrl is optional — HttpChatClient will call http://localhost:3000/generate.

Security

  • Do NOT commit real API keys. gradle.properties had a committed key which has been removed.
  • Prefer storing secrets in environment variables, Android/iOS keystores, or CI/CD secret stores.

Agenda_plus

About

No description, website, or topics provided.

Resources

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors