Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

vubaone/fakeapi

Repository files navigation

πŸš€ Fake API

A lightweight PHP mock API service with encrypted storage and a modern web interface.

Perfect for frontend development, API prototyping, and testing without backend dependencies.

✨ Features

  • Modern Web UI β€” Clean, responsive dashboard for managing APIs
  • AES-256 Encryption β€” All data encrypted at rest
  • Zero Database β€” File-based storage, no setup required
  • Key Isolation β€” Each API key has its own encrypted storage
  • Instant Setup β€” Just drop files and go

πŸ“¦ Installation

git clone https://github.com/vubaone/fakeapi.git
cd fakeapi

Requirements: PHP 7.0+, Apache with mod_rewrite

πŸš€ Quick Start

Try it Online (No Installation Required)

Don't want to host it yourself? Use the live demo:

πŸ‘‰ https://fakeapi.vuba.one/tool.php

Just enter your API key and start creating mock APIs instantly!

Self-Hosted

  1. Open tool.php in your browser
  2. Enter any key (e.g., myproject)
  3. Create your first mock API!

πŸ“‘ API Usage

Get Response

# Self-hosted
curl "http://localhost/fakeapi/get.php?name=users&key=mykey"
# Live demo
curl "https://fakeapi.vuba.one/get.php?name=users&key=mykey"

Save Response

# Self-hosted
curl -X POST http://localhost/fakeapi/save.php \
 -d "name=users&key=mykey&response={\"id\":1,\"name\":\"John\"}"
# Live demo
curl -X POST https://fakeapi.vuba.one/save.php \
 -d "name=users&key=mykey&response={\"id\":1,\"name\":\"John\"}"

Delete Response

# Self-hosted
curl "http://localhost/fakeapi/delete.php?name=users&key=mykey"
# Live demo
curl "https://fakeapi.vuba.one/delete.php?name=users&key=mykey"

πŸ”§ Configuration

Edit private.php to change the secret key:

$secret_key = "your-secret-key";

⚠️ Important: Change the default secret key before deploying!

πŸ“ Project Structure

fakeapi/
β”œβ”€β”€ tool.php # Web dashboard
β”œβ”€β”€ get.php # GET endpoint
β”œβ”€β”€ save.php # POST endpoint 
β”œβ”€β”€ delete.php # DELETE endpoint
β”œβ”€β”€ private.php # Encryption & helpers
β”œβ”€β”€ sample.php # Sample data generator
β”œβ”€β”€ .htaccess # Security & routing
└── data/ # Encrypted storage (auto-created)

πŸ”’ Security

  • AES-256-CBC encryption with derived keys
  • Atomic file locking for data integrity
  • XSS/Injection protection via .htaccess
  • Direct file access blocked

πŸ“ Response Format

// Success
{ "error_code": 0, "error_message": "success" }
// Error
{ "error_code": 1, "error_message": "Description" }

🀝 Contributing

Pull requests welcome! Feel free to open issues for bugs or feature requests.

πŸ“„ License

MIT License β€” use it however you want!

About

A lightweight PHP mock API service with encrypted storage and a modern web interface.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /