📖 Full Documentation | 🚀 Getting Started | 📚 API Reference
Does it ever happen in your career or personal life that you need to collect money someone owes you? Are you shy, out of words, or don't know how to ask or what tone to use?
Should it be Professional, Friendly, Frank, Funny, or Playful?
This project will perfectly solve (I hope) the questions above.
PayUs-as-a-Service (PUaaS) is an API that returns randomized messages for past-due invoices — perfectly suited for any scenario: personal, professional, dev life, or just your everyday life.
Built for thick-faced, ghost, and shameless clients.
Live API: https://puaas.sticknologic.is-a.dev
Interactive Documentation: https://puaas.sticknologic.is-a.dev/docs
Method: GET
Rate Limit: 60 requests per minute per IP
| Method | Endpoint | Auth | Description | Rate Limit |
|---|---|---|---|---|
| GET | /payus | No | Get a randomized message in random tone | 60/min |
| GET | /payus/professional | No | Get random professional message | 60/min |
| GET | /payus/frank | No | Get random frank message | 60/min |
| GET | /payus/friendly | No | Get random friendly message | 60/min |
| GET | /payus/playful | No | Get random playful message | 60/min |
| GET | /payus/funny | No | Get random funny message | 60/min |
| GET | /payus/tones | No | Get available tones | 60/min |
Success Response:
{
"message": "string",
"tone": "Professional"
}Error Response:
{
"success": false,
"message": "No messages found for the specified criteria.",
"errors": "string"
}Available Tones Response:
{
"success": true,
"message": "Success",
"data": {
"tones": {
"professional": "Professional",
"friendly": "Friendly",
"frank": "Frank",
"funny": "Funny",
"playful": "Playful"
}
}
}Test the API directly from your terminal:
# Get a random message with any tone
curl https://puaas.sticknologic.is-a.dev/payus
# Get a professional tone message
curl https://puaas.sticknologic.is-a.dev/payus/professional
# Get all available tones
curl https://puaas.sticknologic.is-a.dev/payus/tonesFor complete API documentation with interactive examples, visit: https://puaas.sticknologic.is-a.dev/docs
Want to run your own instance? It's lightweight and simple to set up.
Choose one of the following:
- Option 1 (Recommended for Beginners): Docker & Docker Compose
- Option 2 (Advanced Users): PHP 8.3+, Composer 2.x, MySQL/SQLite
Step 1: Clone the repository
git clone https://github.com/sticknologic/payus-as-a-service.git
cd payus-as-a-serviceStep 2: Set up environment files
cp .env.example .env
cp sample.env.db .env.dbStep 3: Build and start Docker containers
docker compose build
docker compose up -dStep 4: Install PHP dependencies
docker compose run --rm app composer installStep 5: Generate application security key
docker compose run --rm app php artisan key:generateStep 6: Set up database with sample messages (includes 1,500 messages across all tones)
docker compose run --rm app php artisan migrate:fresh --seed --forceStep 7: Run tests to verify everything works
docker compose run --rm app ./vendor/bin/pestStep 8: Access your API
- API:
http://localhost:9006/payus - Documentation:
http://localhost:9006/docs
Step 1: Clone and install dependencies
git clone https://github.com/sticknologic/payus-as-a-service.git
cd payus-as-a-service
composer installStep 2: Configure environment
cp .env.example .env
php artisan key:generateStep 3: Set up database (SQLite by default - easiest option)
touch database/database.sqlite
php artisan migrate:fresh --seed --forceStep 4: Run tests to verify
./vendor/bin/pestStep 5: Start the development server
php artisan serveStep 6: Access your API
- API:
http://localhost:8000/payus - Documentation:
http://localhost:8000/docs
| Code | Description |
|---|---|
| 200 | Success |
| 201 | Resource created |
| 204 | No content |
| 400 | Bad request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not found |
| 422 | Validation error |
| 429 | Too many requests |
| 500 | Server error |
laravel-api-kit/
├── app/
│ ├── Actions/
│ ├── DTOs/
│ ├── Http/
│ │ ├── Controllers/
│ │ │ └── Api/
│ │ │ ├── ApiController.php # Base controller with ApiResponse
│ │ │ └── V1/ # Version 1 controllers
│ │ │ └── PayUsController.php
│ │ ├── Requests/
│ │ │ └── GetMessageRequest
│ │ └── Resources/ # API Resources
│ │ └── MessageResource.php
│ ├── Models/
| | ├── Message.php
│ │ └── User.php
│ ├── Providers/
│ │ └── AppServiceProvider.php # Rate limiting config
│ ├── Services/ # Business logic services
│ └── Traits/
│ └── ApiResponse.php # Standardized responses
├── config/
│ ├── apiroute.php # API versioning config
│ ├── cors.php # CORS settings
│ ├── sanctum.php # Token auth config
│ └── scramble.php # API docs config
├── database/* # Migrations and seeder
├── resources/views/
│ └── welcome.blade.php # Home
├── routes/
│ ├── api.php # API routes entry point
│ └── web.php
├── tests/
│ └── Feature/
│ └── PayUsTest.php # API tests
├── docker-compose.yml
├── Dockerfile
├── CLAUDE.md # AI assistant instructions
└── messages.json # 1500 messages (300 messages per tone)
View all available API routes:
docker compose run --rm app php artisan route:listClear all caches (useful after config changes):
docker compose run --rm app php artisan optimize:clearRun code quality checks (Pint, Rector, PHPStan, Tests):
docker compose run --rm app composer testGenerate IDE helper files (improves autocomplete in your editor):
docker compose run --rm app php artisan ide-helper:generate
docker compose run --rm app php artisan ide-helper:models -NExport OpenAPI specification to file:
docker compose run --rm app php artisan scramble:exportKey .env variables for self-hosting:
# Application Settings
APP_NAME="PayUs-as-a-Service"
APP_ENV=local # Use 'production' for live deployment
APP_DEBUG=true # Set to 'false' in production
APP_URL=http://localhost:9006 # Your API URL
# Database (SQLite for development - easiest option)
DB_CONNECTION=sqlite
DB_DATABASE=/var/www/database/database.sqlite
# For MySQL/PostgreSQL (recommended for production)
# DB_CONNECTION=mysql
# DB_HOST=mysql
# DB_PORT=3306
# DB_DATABASE=payus_db
# DB_USERNAME=your_username
# DB_PASSWORD=your_password
# API Configuration
API_VERSION_STRATEGY=uri
API_DEFAULT_VERSION=latest
# Rate Limiting (requests per minute per IP)
API_RATE_LIMIT=60- Set
APP_ENV=productionandAPP_DEBUG=falsein.env - Configure a production database (MySQL/PostgreSQL recommended)
- Set
APP_URLto your actual domain (e.g.,https://api.yourdomain.com) - Review and adjust CORS settings in
config/cors.php - Adjust rate limiting in
config/apiroute.phpbased on your needs - Set up Redis for caching (optional but recommended)
- Configure queue workers for background jobs (if needed)
- Enable HTTPS/SSL certificates
- Set up proper monitoring and logging
Your docker-compose.yml already includes Nginx for production use.
Step 1: Update .env and .env.db with production settings
Step 2: Build and start containers
docker compose up -d --buildStep 3: Your API will be available on port 9006
Step 4: Point your reverse proxy (Caddy/Nginx) to the container
Example Caddy configuration:
api.yourdomain.com {
reverse_proxy localhost:9006
}
Example Nginx configuration:
server {
listen 80;
server_name api.yourdomain.com;
location / {
proxy_pass http://localhost:9006;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}Here are some projects made by our BRAVE developers that integrate PayUs-as-a-Service to deliver their dismay, despair, and disappointment via past-due invoice messages:
- Your Project Here? If you're using PayUs-as-a-Service in your project, open a pull request to be featured here!
We welcome contributions! Here's how you can help:
Step 1: Fork the repository
Step 2: Create your feature branch
git checkout -b feature/amazing-featureStep 3: Make your changes and test them
composer testStep 4: Commit your changes
git commit -m 'Add amazing feature'Step 5: Push to the branch
git push origin feature/amazing-featureStep 6: Open a Pull Request
- Add more message variations to
messages.json - Improve documentation
- Add new language translations
- Fix bugs or improve performance
- Add new API features or tone categories
Created with a broken heart and torn wallet by STICKnoLOGIC
This project is open-sourced software licensed under the MIT license.
- Laravel - The PHP Framework
- Laravel-API-Kit - The laravel Boiler Plate
- spatie/laravel-query-builder - Query Building
- spatie/laravel-data - Data Transfer Objects
- dedoc/scramble - API Documentation
- Pest PHP - Testing Framework
Need help? Here are your options:
- 📚 Interactive API Docs: https://puaas.sticknologic.is-a.dev/docs
- 📖 Wiki & Guides: GitHub Wiki
- 🐛 Bug Reports: GitHub Issues
- 💬 Discussions: GitHub Discussions
- ❓ Questions: Open a discussion
