Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DooiLabs/FastApps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastApps

image 39

The python framework for ChatGPT apps

PyPI Python PyPI Downloads License
CI Status Code style: black Ruff GitHub Stars


📚 Documentation: https://www.fastapps.org/

👥 Community: Join Our Discord


Quick Start

# 0. Set virtual environment (recommended)
python -m venv .venv
source .venv/bin/activate # Mac/Linux
.venv\Scripts\Activate.ps1 # Windows PowerShell

# 1. Install
pip install fastapps

# 2. Create project (includes example widget + auto npm install)
fastapps init my-app

# 3. Run
cd my-app
fastapps dev

That's it! Your example widget is now running at a public URL. On first run, you'll need an ngrok auth token (free).

Test App

Option A: Test on MCPJam Inspector

Add your public URL + /mcp to ChatGPT: Example: https://xyz.ngrok-free.app/mcp

npx @mcpjam/inspector@latest

Option B: Test on ChatGPT

Add your public URL + /mcp to ChatGPT's "Settings > Connectors": Example: https://xyz.ngrok-free.app/mcp

Creating More Widgets

fastapps create another-widget

Editing Your Widget

You only need to edit these 2 files:

server/tools/my_widget_tool.py - Backend Logic

from fastapps import BaseWidget, Field, ConfigDict
from pydantic import BaseModel
from typing import Dict, Any

class MyWidgetInput(BaseModel):
    model_config = ConfigDict(populate_by_name=True)
    name: str = Field(default="World")

class MyWidgetTool(BaseWidget):
    identifier = "my-widget"
    title = "My Widget"
    input_schema = MyWidgetInput
    invoking = "Processing..."
    invoked = "Done!"
    
    widget_csp = {
        "connect_domains": [],      # APIs you'll call
        "resource_domains": []      # Images/fonts you'll use
    }
    
    async def execute(self, input_data: MyWidgetInput) -> Dict[str, Any]:
        # Your logic here
        return {
            "name": input_data.name,
            "message": f"Hello, {input_data.name}!"
        }

widgets/my-widget/index.jsx - Frontend UI

import React from 'react';
import { useWidgetProps } from 'fastapps';

export default function MyWidget() {
  const props = useWidgetProps();
  
  return (
    <div style={{
      padding: '40px',
      textAlign: 'center',
      background: '#4A90E2',
      color: 'white',
      borderRadius: '12px'
    }}>
      <h1>{props.message}</h1>
      <p>Welcome, {props.name}!</p>
    </div>
  );
}

That's it! These are the only files you need to write.


Contributing

We welcome contributions! Please see our contributing guidelines:

Quick Start for Contributors

# Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/FastApps.git
cd FastApps

# Install development dependencies
pip install -e ".[dev]"

# Install pre-commit hooks
pip install pre-commit
pre-commit install

# Make changes and ensure they pass checks
black .
ruff check --fix .
pytest

# Submit a pull request

License

MIT © Dooi Labs

Links

About

⚡ The fast, Pythonic way to build ChatGPT Apps

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 5