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
- Getting Started Guide
- API Reference
- Tutorials
- Unity Integration (Coming Soon)
๐ค Contributing
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - 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:
- Blog Application - Traditional web development
- REST API - Pure API backend
- Game Backend - Multiplayer game server (Coming Soon)
๐โโ๏ธ Support
Built with โค๏ธ by the Gobe Team
Bridging Web and Game Development
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8cb3fb3cb5fdf4095059e889b3f90e1bf2c7d2bf834c311726d805e2c3d8af70
|
|
| MD5 |
0418e5d883a34b56b1b7e994cc9e9a1c
|
|
| BLAKE2b-256 |
07ca02e3660de2b4c76c4cbadd28c5d3b8ff53af47d66d2c4c3d74d03d520e84
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4d48bc4cc1485139329e5840f895dcd9badb33bad05df5eed971ea1d5dbf319
|
|
| MD5 |
984aeca4f04b73dc9861414e1834b33b
|
|
| BLAKE2b-256 |
fe79c24474dfab88a7498ead3501cb38aa4f8ed31ef958a9a5cfef4b9705c797
|