Skip to content

LavX/yes-as-a-service-py

Repository files navigation

✅ Yes-as-a-Service (Python)

Yes-as-a-Service Banner

Ever needed a graceful way to say "yes"?
This tiny API returns random, generic, creative, and sometimes hilarious affirmations, perfectly suited for any scenario: personal, professional, student life, dev life, or just because.

Built for humans, affirmations, and humor.

Inspired by the original no-as-a-service project. This is a wrapper of no-as-a-service-py.


🚀 API Usage

Base URL

http://localhost:3000/yes

Method: GET
Rate Limit: 120 requests per minute per IP

🔄 Example Request

GET /yes

✅ Example Response

{
  "reason": "Absolutely! I'd love to help with that."
}

Use it in apps, bots, landing pages, Slack integrations, acceptance letters, or wherever you need a polite (or witty) yes.


🛠️ Self-Hosting

Want to run it yourself? It's lightweight and simple.

1. Clone this repository

git clone https://github.com/LavX/no-as-a-service-py.git
cd no-as-a-service-py

2. Install dependencies

pip install -r requirements.txt

3. Start the server

python main.py

The API will be live at:

http://localhost:3000/yes

You can also change the port using an environment variable:

PORT=5000 python main.py

🐳 Docker

Using Pre-built Image from GHCR

The Docker image is automatically built and pushed to GitHub Container Registry on every push to main branch.

docker pull ghcr.io/lavx/yes-as-a-service-py:latest
docker run -p 3000:3000 -e PORT=3000 ghcr.io/lavx/yes-as-a-service-py:latest

Building Locally

docker build -t yes-as-a-service-py .
docker run -p 3000:3000 -e PORT=3000 yes-as-a-service-py

Docker Compose

Create a docker-compose.yml:

version: '3.8'
services:
  yaas:
    image: ghcr.io/lavx/yes-as-a-service-py:latest
    ports:
      - "3000:3000"
    environment:
      - PORT=3000
    restart: unless-stopped

Then run:

docker-compose up -d

📁 Project Structure

yes-as-service-py/
├── main.py                      # FastAPI application
├── reasons.json                 # 1000+ universal affirmations
├── requirements.txt             # Python dependencies
├── Dockerfile                   # Docker image definition
├── .devcontainer.json           # VS Code / Github devcontainer setup
├── .github/
│   └── workflows/
│       └── docker-release.yml    # GitHub Actions workflow for GHCR
└── README.md

📦 requirements.txt

fastapi==0.109.0
uvicorn[standard]==0.27.0
slowapi==0.1.9

⚓ Devcontainer

If you open this repo in Github Codespaces, it will automatically use .devcontainer.json to set up your environment. If you open it in VSCode, it will ask you if you want to reopen it in a container.


🛠️ Tech Stack

  • FastAPI - Modern, fast web framework for building APIs
  • Uvicorn - ASGI server for running FastAPI
  • Slowapi - Rate limiting for FastAPI

👤 Inspiration

Inspired by the original Node.js version created by hotheadhacker


🌐 About the Maintainer

This project is maintained by LavX. Explore more of my projects and services:

🚀 Services

  • LavX Managed Systems – Enterprise AI solutions, RAG systems, and LLMOps.
  • LavX News – Latest insights on AI, Open Source, and emerging tech.
  • LMS Tools – 140+ free, privacy-focused online tools for developers and researchers.

🛠️ Open Source Projects


📄 License

MIT, do whatever, just don't say no when you should say yes.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors