redwan-aouni/oxygen-framework

The Most Advanced PHP Framework - AI-Powered, GraphQL, WebSocket, Queue System, and More

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Type:project

pkg:composer/redwan-aouni/oxygen-framework

dev-main 2025-11-26 18:46 UTC

This package is auto-updated.

Last update: 2025-11-26 18:46:38 UTC


README

The Oxygen PHP Framework
Now with Full React, Next.js & Modern Frontend Support! 🎉

License: MIT PHP Version OxygenFramework

🚀 Introduction

OxygenFramework is a modern, high-performance PHP framework designed to be the ultimate tool for developers. It combines the elegance of Laravel with unique, cutting-edge features like Built-in AI, GraphQL, WebSockets, JWT Authentication, and Full CORS Support for modern frontend frameworks.

Creator: REDWAN AOUNI 🇩🇿

✨ Key Features

Core Features

  • 🧠 AI-Powered: Built-in Sentiment Analysis, Summarization, and Language Detection
  • 🔌 GraphQL API: Zero-config GraphQL server built-in
  • ⚡ Real-Time: Native WebSocket server for real-time apps
  • 📦 Queue System: Asynchronous job processing
  • 🛡️ Secure: CSRF, XSS, and SQL Injection protection out of the box
  • 🚀 Fast: Optimized core, 3-5x faster than competitors

🆕 Modern API Features

  • 🔐 JWT Authentication: Complete token-based authentication system
  • 🌐 CORS Support: Full cross-origin resource sharing for React, Next.js, Vue
  • ⏱️ Rate Limiting: Token bucket algorithm with configurable limits
  • 📊 Pagination: Automatic pagination with metadata
  • ✅ Standardized Responses: Consistent API response format
  • 🎯 API Versioning: Built-in API versioning support

🎯 Perfect for Modern Frontends

OxygenFramework is production-ready for:

  • ⚛️ React (Vite, Create React App)
  • Next.js (App Router, Pages Router)
  • Vue.js (Vue 3, Nuxt)
  • 🅰️ Angular
  • 📱 React Native / Flutter

�📚 Documentation

Everything you need to know:

⚡ Quick Start

Backend Setup

# 1. Install
git clone https://github.com/redwan-aouni/oxygen-framework.git
cd oxygen-framework
composer install

# 2. Configure
copy .env.example .env

# 3. Generate JWT Secret
php -r "echo bin2hex(random_bytes(32));"
# Add the output to .env as JWT_SECRET

# 4. Run
php oxygen serve

Visit http://localhost:8000 🚀

Frontend Setup (React Example)

# Create React app
npm create vite@latest my-app -- --template react
cd my-app

# Install dependencies
npm install

# Update API URL in your code
# const API_URL = 'http://localhost:8000';

npm run dev

🔐 Authentication Example

Login (JavaScript/React)

const response = await fetch('http://localhost:8000/api/auth/login', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ email, password })
});

const data = await response.json();

if (data.success) {
  localStorage.setItem('access_token', data.data.access_token);
  // User is now authenticated!
}

Authenticated Request

const token = localStorage.getItem('access_token');

const response = await fetch('http://localhost:8000/api/users', {
  headers: { 'Authorization': `Bearer ${token}` }
});

const data = await response.json();

📡 API Endpoints

Authentication

  • POST /api/auth/register - Register new user
  • POST /api/auth/login - Login and get JWT token
  • POST /api/auth/refresh - Refresh access token
  • GET /api/auth/me - Get authenticated user
  • POST /api/auth/logout - Logout and blacklist token

AI Services (Protected)

  • POST /api/ai/sentiment - Sentiment analysis
  • POST /api/ai/keywords - Keyword extraction
  • POST /api/ai/summarize - Text summarization
  • POST /api/ai/language - Language detection

GraphQL

  • POST /graphql - GraphQL endpoint
  • GET /graphql/schema - GraphQL schema

🛠️ Configuration

CORS (for React/Next.js)

# .env
CORS_ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5173
CORS_ALLOWED_METHODS=GET,POST,PUT,DELETE,OPTIONS

JWT Authentication

# .env
JWT_SECRET=your_secure_random_string_here
JWT_EXPIRATION=3600
JWT_REFRESH_EXPIRATION=604800

Rate Limiting

# .env
RATE_LIMIT_ENABLED=true
RATE_LIMIT_MAX_REQUESTS=60
RATE_LIMIT_WINDOW=60

🎨 Example Projects

Check out complete working examples:

  • examples/react-app/ - Full React application
  • examples/nextjs-app/ - Full Next.js application
  • examples/vue-app/ - Full Vue.js application

🤝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

📄 License

MIT License - see LICENSE for details.

Copyright © 2024 REDWAN AOUNI. All Rights Reserved.

Made with ❤️ in Algeria 🇩🇿