Skip to main content

Modern Python Web Framework with Unity Integration

Project description

Gobe Framework

Modern Python Web Framework with Unity Integration

Gobe is a next-generation web framework designed to bridge the gap between web development and game development. Built with modern Python practices, it provides a familiar Django-like experience while preparing for seamless Unity integration.

โœจ Features

๐Ÿš€ Modern Web Development

  • Intuitive CLI - Project scaffolding and management
  • Auto-routing - Convention-based URL routing
  • Hybrid Templates - Django + JSX-style templating
  • Powerful ORM - Type-safe database operations
  • Built-in APIs - REST, GraphQL, and WebSocket support

๐ŸŽฎ Game-Ready Architecture

  • Unity Bridge - Future-ready game engine integration
  • Real-time Communication - WebSocket for live gameplay
  • Game Modules - Specialized components for game logic
  • Scalable Backend - Built for multiplayer games

๐Ÿ›  Developer Experience

  • Hot Reload - Instant development feedback
  • Auto-migrations - Intelligent database schema updates
  • Rich CLI - Comprehensive command-line tools
  • Plugin System - Extensible architecture

๐Ÿš€ Quick Start

Installation

pip install gobe-framework

Create Your First Project

# Create a new Gobe project
gobe create-project my_game_backend

# Navigate to project
cd my_game_backend

# Start development server
gobe serve

Your Gobe application is now running at http://localhost:8000!

๐Ÿ“ Project Structure

my_game_backend/
โ”œโ”€โ”€ gobe_config/          # Configuration files
โ”‚   โ””โ”€โ”€ settings.py
โ”œโ”€โ”€ web_apps/             # Web applications
โ”‚   โ””โ”€โ”€ main/
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ”œโ”€โ”€ models.py     # Database models
โ”‚       โ”œโ”€โ”€ views.py      # Request handlers
โ”‚       โ””โ”€โ”€ api_views.py  # API endpoints
โ”œโ”€โ”€ game_modules/         # Game-specific modules (future)
โ”œโ”€โ”€ shared/               # Shared code
โ”œโ”€โ”€ static/               # Static files (CSS, JS, images)
โ”œโ”€โ”€ templates/            # HTML templates
โ”œโ”€โ”€ api/                  # API configuration
โ””โ”€โ”€ main.py              # Application entry point

๐Ÿ”ง Core Concepts

Models (ORM)

Define your data models with a clean, type-safe API:

from gobe.database.orm import Model
from gobe.database.orm.fields import CharField, IntegerField, DateTimeField

class Player(Model):
    username = CharField(max_length=50, unique=True)
    score = IntegerField(default=0)
    level = IntegerField(default=1)
    created_at = DateTimeField(auto_now_add=True)

# Query your data
players = Player.objects.filter(level__gt=5).order_by('-score')
top_player = Player.objects.get(username='champion')

Views

Handle requests with class-based or function-based views:

from gobe.web.views import View
from gobe.web.routing import get, post

class LeaderboardView(View):
    template_name = 'leaderboard.html'
    
    def get(self, request):
        players = Player.objects.order_by('-score')[:10]
        return self.render(request, {'players': players})

# Or use decorators
@get('/api/players/')
def get_players(request):
    players = Player.objects.all()
    return JsonResponse([p.to_dict() for p in players])

API Development

Build REST APIs effortlessly:

from gobe.api.rest import ModelViewSet
from gobe.api.rest.permissions import IsAuthenticated

class PlayerViewSet(ModelViewSet):
    model = Player
    permission_classes = [IsAuthenticated]
    
    def get_queryset(self):
        return Player.objects.filter(user=self.request.user)

Templates

Use familiar template syntax with modern features:

<!DOCTYPE html>
<html>
<head>
    <title>{{ title }}</title>
</head>
<body>
    <h1>{{ title }}</h1>
    
    {% if players %}
        <ul>
        {% for player in players %}
            <li>{{ player.username }} - Level {{ player.level }}</li>
        {% endfor %}
        </ul>
    {% else %}
        <p>No players found.</p>
    {% endif %}
</body>
</html>

๐ŸŒ API Support

REST API

# Automatic CRUD endpoints
class GameSessionViewSet(ModelViewSet):
    model = GameSession
    serializer_class = GameSessionSerializer
    
    # GET /api/gamesessions/
    # POST /api/gamesessions/
    # GET /api/gamesessions/{id}/
    # PUT /api/gamesessions/{id}/
    # DELETE /api/gamesessions/{id}/

GraphQL (Coming Soon)

from gobe.api.graphql import ObjectType, Field, GraphQLSchema

class PlayerType(ObjectType):
    username = Field(String)
    score = Field(Int)
    level = Field(Int)

class Query(ObjectType):
    players = Field(List(PlayerType))
    
    def resolve_players(self, info):
        return Player.objects.all()

schema = GraphQLSchema(query=Query)

WebSocket

from gobe.api.websocket import WebSocketHandler

class GameHandler(WebSocketHandler):
    async def on_connect(self, connection):
        await connection.send({'type': 'welcome'})
    
    async def on_message(self, connection, data):
        # Handle real-time game events
        await self.broadcast_to_room(data['room'], {
            'type': 'game_update',
            'data': data
        })

๐ŸŽฏ CLI Commands

Gobe provides a comprehensive CLI for project management:

# Project creation
gobe create-project <name> [--template=basic|api|fullstack]

# App management
gobe add-app <name> [--type=web|api|game]

# Development
gobe serve [--host=127.0.0.1] [--port=8000] [--reload]

# Database operations
gobe migrate [--auto] [--dry-run]

# Production
gobe build [--optimize] [--output=dist]
gobe deploy [--target=docker|heroku|aws]

๐ŸŽฎ Unity Integration (Coming Soon)

Gobe is designed with future Unity integration in mind:

# Game module example
from gobe.unity_bridge import UnityBridge
from gobe.game_modules import GameModule

class MyGameModule(GameModule):
    def setup(self, app):
        # Register Unity message handlers
        self.bridge = UnityBridge()
        self.bridge.on('player_move', self.handle_player_move)
    
    async def handle_player_move(self, data):
        # Process Unity game events
        player = await Player.objects.aget(id=data['player_id'])
        player.position = data['position']
        await player.asave()

๐Ÿ“– Documentation

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿš€ Roadmap

Phase 1: Core Framework โœ…

  • CLI system
  • Project scaffolding
  • ORM and database layer
  • Web views and routing
  • Template engine
  • REST API support

Phase 2: Enhanced APIs

  • GraphQL implementation
  • WebSocket optimization
  • Real-time subscriptions
  • Advanced caching

Phase 3: Unity Bridge

  • Unity C# bridge library
  • Real-time game state sync
  • Asset management integration
  • Multiplayer game templates

Phase 4: Production Ready

  • Performance optimizations
  • Monitoring and analytics
  • Cloud deployment tools
  • Enterprise features

๐Ÿ’ก Examples

Check out our example projects:

๐Ÿ™‹โ€โ™‚๏ธ Support


Built with โค๏ธ by the Gobe Team

Bridging Web and Game Development

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gobe-0.1.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gobe-0.1.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file gobe-0.1.0.tar.gz.

File metadata

  • Download URL: gobe-0.1.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for gobe-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8cb3fb3cb5fdf4095059e889b3f90e1bf2c7d2bf834c311726d805e2c3d8af70
MD5 0418e5d883a34b56b1b7e994cc9e9a1c
BLAKE2b-256 07ca02e3660de2b4c76c4cbadd28c5d3b8ff53af47d66d2c4c3d74d03d520e84

See more details on using hashes here.

File details

Details for the file gobe-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gobe-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for gobe-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d4d48bc4cc1485139329e5840f895dcd9badb33bad05df5eed971ea1d5dbf319
MD5 984aeca4f04b73dc9861414e1834b33b
BLAKE2b-256 fe79c24474dfab88a7498ead3501cb38aa4f8ed31ef958a9a5cfef4b9705c797

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page