Phase 1: Communications Module - Complete
Backend infrastructure: - PostgreSQL models (users, channels, messages, DMs, files, artifacts) - JWT authentication with password hashing - Auth API (register, login, logout, get user) - Channels API (create, list, join, leave) - Messages API with @grimlock mention detection - AI responds automatically when @mentioned - Background task processing for AI responses Database: - SQLAlchemy ORM models - Alembic ready for migrations - PostgreSQL + Redis in docker-compose Features working: - User registration and login - Create/join public channels - Send messages in channels - @grimlock triggers AI response with channel context - Real-time ready (WebSocket next) Next: WebSocket for real-time updates, frontend interface
This commit is contained in:
@@ -11,8 +11,13 @@ from dotenv import load_dotenv
|
||||
import os
|
||||
|
||||
from api.chat import router as chat_router
|
||||
from api.auth import router as auth_router
|
||||
from api.channels import router as channels_router
|
||||
from api.messages import router as messages_router
|
||||
from core.context_manager import ContextManager
|
||||
from core.ai_client import AIClient
|
||||
from core.database import engine
|
||||
from core.models import Base
|
||||
|
||||
# Load environment variables
|
||||
load_dotenv()
|
||||
@@ -35,6 +40,10 @@ async def lifespan(app: FastAPI):
|
||||
|
||||
logger.info("Starting Grimlock backend...")
|
||||
|
||||
# Create database tables
|
||||
Base.metadata.create_all(bind=engine)
|
||||
logger.info("Database tables created/verified")
|
||||
|
||||
# Initialize context manager
|
||||
context_path = os.getenv("CONTEXT_PATH", "./context")
|
||||
context_manager = ContextManager(context_path)
|
||||
@@ -59,7 +68,7 @@ async def lifespan(app: FastAPI):
|
||||
app = FastAPI(
|
||||
title="Grimlock",
|
||||
description="AI-Native Company Operating System",
|
||||
version="0.1.0",
|
||||
version="0.2.0",
|
||||
lifespan=lifespan
|
||||
)
|
||||
|
||||
@@ -73,6 +82,9 @@ app.add_middleware(
|
||||
)
|
||||
|
||||
# Include routers
|
||||
app.include_router(auth_router, prefix="/api/auth", tags=["auth"])
|
||||
app.include_router(channels_router, prefix="/api/channels", tags=["channels"])
|
||||
app.include_router(messages_router, prefix="/api/channels", tags=["messages"])
|
||||
app.include_router(chat_router, prefix="/api/chat", tags=["chat"])
|
||||
|
||||
@app.get("/")
|
||||
@@ -81,7 +93,8 @@ async def root():
|
||||
return {
|
||||
"status": "online",
|
||||
"service": "Grimlock",
|
||||
"version": "0.1.0"
|
||||
"version": "0.2.0",
|
||||
"features": ["auth", "channels", "messages", "ai"]
|
||||
}
|
||||
|
||||
@app.get("/api/health")
|
||||
@@ -90,7 +103,8 @@ async def health():
|
||||
return {
|
||||
"status": "healthy",
|
||||
"context_loaded": context_manager is not None and context_manager.is_loaded(),
|
||||
"ai_client_ready": ai_client is not None
|
||||
"ai_client_ready": ai_client is not None,
|
||||
"database": "connected"
|
||||
}
|
||||
|
||||
def get_context_manager() -> ContextManager:
|
||||
|
||||
Reference in New Issue
Block a user