-
Notifications
You must be signed in to change notification settings - Fork 0
🚀 Full Bahá'í Spiritual Quest Solution #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # Vercel ignore - exclude large files and unnecessary items for deployment | ||
| __pycache__/ | ||
| *.pyc | ||
| *.pyo | ||
| *.pyd | ||
| .Python | ||
| env/ | ||
| venv/ | ||
| agent-env/ | ||
|
|
||
| # Large model files | ||
| *.bin | ||
| *.safetensors | ||
| *.json | ||
| *.msgpack | ||
| *.h5 | ||
| *.onnx | ||
|
|
||
| # Cache directories | ||
| .cache/ | ||
| huggingface/ | ||
| transformers_cache/ | ||
|
|
||
| # Logs | ||
| *.log | ||
| logs/ | ||
| server*.log | ||
|
|
||
| # Database files | ||
| *.db | ||
| *.sqlite | ||
| chroma_db/ | ||
|
|
||
| # QA testing files | ||
| qa_screenshots/ | ||
| qa_test_report.json | ||
| playwright-report/ | ||
| test-results/ | ||
|
|
||
| # Mobile node modules | ||
| mobile/node_modules/ | ||
| mobile/.expo/ | ||
|
|
||
| # Large test files | ||
| comprehensive_qa_test.py | ||
| playwright_qa_framework.py | ||
| enhanced_qa_framework.py | ||
| visual_test_engine.py | ||
|
|
||
| # Development tools | ||
| autonomous_launcher.py | ||
| goose_style_config.py | ||
| vercel_deployment_tool.py | ||
|
|
||
| # Static files that should be in frontend | ||
| backend/static/ | ||
| backend/templates/test_*.html | ||
| backend/templates/spiritual_quest.html | ||
| backend/quote_readability_demo.html | ||
|
|
||
| # Documentation (keep README.md) | ||
| AUTONOMOUS_SYSTEM_SUMMARY.md | ||
| BUILD_ACTION_PLAN.md | ||
| backend/QA_FRAMEWORK_README.md | ||
| backend/SYSTEM_OVERVIEW.md | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| #!/usr/bin/env python3 | ||
| """ | ||
| 🌟 Bahá'í Spiritual Quest - Vercel API Endpoint | ||
| Optimized for serverless deployment | ||
| """ | ||
|
|
||
| from fastapi import FastAPI, Request, Form, HTTPException | ||
| from fastapi.responses import HTMLResponse | ||
| from fastapi.templating import Jinja2Templates | ||
| from fastapi.middleware.cors import CORSMiddleware | ||
| import os | ||
| import json | ||
| from datetime import datetime | ||
| from pathlib import Path | ||
|
|
||
| # Initialize FastAPI app | ||
| app = FastAPI(title="Bahá'í Spiritual Quest API") | ||
|
|
||
| # CORS middleware | ||
| app.add_middleware( | ||
| CORSMiddleware, | ||
| allow_origins=["*"], | ||
| allow_credentials=True, | ||
| allow_methods=["*"], | ||
| allow_headers=["*"], | ||
| ) | ||
|
|
||
| # Templates | ||
| templates_dir = Path(__file__).parent.parent / "templates" | ||
| templates = Jinja2Templates(directory=str(templates_dir)) | ||
|
|
||
| # Simple in-memory responses for Vercel deployment | ||
| SPIRITUAL_RESPONSES = [ | ||
| "O Son of Being! Love Me, that I may love thee. If thou lovest Me not, My love can in no wise reach thee.", | ||
| "O Friend! In the garden of thy heart plant naught but the rose of love, and from the nightingale of affection and desire loathe not to turn away.", | ||
| "O Son of Man! For everything there is a sign. The sign of love is fortitude in My decree and patience in My trials.", | ||
| "O Children of Men! Know ye not why We created you all from the same dust? That no one should exalt himself over the other.", | ||
| "O Son of Spirit! Noble have I created thee, yet thou hast abased thyself. Rise then unto that for which thou wast created.", | ||
| "O My Friend! Thou art the daystar of the heavens of My holiness, let not the defilement of the world eclipse thy splendor.", | ||
| "O Son of Being! Thy heart is My home; sanctify it for My descent. Thy spirit is My place of revelation; cleanse it for My manifestation.", | ||
| "O Son of Man! Breathe not the sins of others so long as thou art thyself a sinner. Shouldst thou transgress this command, accursed wouldst thou be, and to this I bear witness.", | ||
| "O Son of Being! How couldst thou forget thine own faults and busy thyself with the faults of others? Whoso doeth this is accursed of Me.", | ||
| "O Son of Being! Seek a martyr's death in My path, content with My pleasure and thankful for that which hath befallen thee, for thus wilt thou abide in prosperity and comfort in the realm of eternity.", | ||
| ] | ||
|
|
||
| @app.get("/", response_class=HTMLResponse) | ||
| async def home(request: Request): | ||
| """Serve the main interface""" | ||
| return templates.TemplateResponse("elegant_bahai_manuscript.html", {"request": request}) | ||
|
|
||
| @app.post("/api/chat") | ||
| async def chat_endpoint(message: str = Form(...)): | ||
| """Simplified chat endpoint for Vercel""" | ||
| try: | ||
| # Simple keyword-based response selection | ||
| message_lower = message.lower() | ||
|
|
||
| if "love" in message_lower: | ||
| response = SPIRITUAL_RESPONSES[0] # Love quote | ||
| elif "friend" in message_lower: | ||
| response = SPIRITUAL_RESPONSES[1] # Friend quote | ||
| elif "son of man" in message_lower: | ||
| response = SPIRITUAL_RESPONSES[2] # Son of Man quote | ||
| elif "noble" in message_lower or "spirit" in message_lower: | ||
| response = SPIRITUAL_RESPONSES[4] # Noble quote | ||
| elif "heart" in message_lower: | ||
| response = SPIRITUAL_RESPONSES[6] # Heart quote | ||
| else: | ||
| # Random spiritual response | ||
| import hashlib | ||
| hash_obj = hashlib.md5(message.encode()) | ||
| hash_int = int(hash_obj.hexdigest(), 16) | ||
| response = SPIRITUAL_RESPONSES[hash_int % len(SPIRITUAL_RESPONSES)] | ||
|
|
||
| return { | ||
| "message": message, | ||
| "response": response, | ||
| "timestamp": datetime.now().isoformat(), | ||
| "source": "The Hidden Words of Bahá'u'lláh" | ||
| } | ||
|
|
||
| except Exception as e: | ||
| raise HTTPException(status_code=500, detail=str(e)) | ||
|
|
||
| @app.get("/api/health") | ||
| async def health_check(): | ||
| """Health check endpoint""" | ||
| return { | ||
| "status": "healthy", | ||
| "service": "Bahá'í Spiritual Quest", | ||
| "timestamp": datetime.now().isoformat() | ||
| } | ||
|
|
||
| # For Vercel serverless deployment | ||
| if __name__ == "__main__": | ||
| import uvicorn | ||
| uvicorn.run(app, host="0.0.0.0", port=8000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ class VercelDeploymentTool: | |
| def __init__(self): | ||
| self.project_root = Path(__file__).parent.parent | ||
| self.backend_dir = Path(__file__).parent | ||
| self.github_username = "yacinewatchandcode" | ||
| self.github_username = "yacinewhatchandcode" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: GitHub Username Typo Causes Deployment FailuresA typo was introduced in the GitHub username, changing |
||
| self.repo_name = "bahai-spiritual-quest" | ||
| self.vercel_project_name = "bahai-spiritual-quest" | ||
|
|
||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Vercel Ignore Excludes Essential JSON Files
The
*.jsonpattern in.vercelignoreis overly broad, excluding all JSON files from deployment instead of just large model files as intended. This prevents necessary configuration files (e.g.,package.json) and data files from being deployed, breaking the application or deployment.