Refactor project structure and implement new features
- Removed unused security module and updated import paths. - Enhanced OpenAI client with streaming capabilities for chat completions. - Added new backend API endpoints for health check (ping). - Established a new FastAPI application with CORS configuration. - Created a new Appshell component for the frontend with navigation links. - Integrated SVG icons and improved styling for the Appshell component. - Implemented memory management for conversation history using PostgreSQL. - Developed abstract classes for AI agents and models, with OpenAI integration. - Added encryption utilities for secure data handling.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
# backend/api/endpoints/ping.py
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@router.get("/ping")
|
||||
async def ping():
|
||||
return {"message": "pong"}
|
||||
@@ -0,0 +1,7 @@
|
||||
# backend/api/router.py
|
||||
|
||||
from fastapi import APIRouter
|
||||
from backend.api.v1.endpoints import ping
|
||||
|
||||
router = APIRouter()
|
||||
router.include_router(ping.router, prefix="/api/v1")
|
||||
@@ -0,0 +1,24 @@
|
||||
# backend/main.py
|
||||
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from backend.api.v1.router import router
|
||||
|
||||
app = FastAPI(
|
||||
title="Fitz Backend",
|
||||
description="API para interacción con el frontend y ejecución de tareas",
|
||||
version="0.1.0"
|
||||
)
|
||||
|
||||
# Configuración de CORS
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["http://localhost:5173"], # Solo permite tu frontend local
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
|
||||
# Incluye las rutas de tu API
|
||||
app.include_router(router)
|
||||
Reference in New Issue
Block a user