-
Notifications
You must be signed in to change notification settings - Fork 145
Add Multi-Step Create Proposal Dialog with Three Architectural Solutions #243
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
base: main
Are you sure you want to change the base?
Changes from all commits
c3d581b
edebc89
ad9d70b
b1eb51f
1f3fa9d
13e8aa4
14a7aa5
90f649e
1a27acb
a39b53f
8e7eefa
d9c925b
8d63898
12d4273
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: Docker Build and Test | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, develop ] | ||
| pull_request: | ||
| branches: [ main, develop ] | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Build Backend | ||
| run: | | ||
| cd Backend | ||
| docker build -t inpactai-backend:test . | ||
|
|
||
| - name: Build Frontend | ||
| run: | | ||
| cd Frontend | ||
| docker build -t inpactai-frontend:test . | ||
|
|
||
| - name: Start services | ||
| run: | | ||
| docker compose up -d | ||
| sleep 30 | ||
|
|
||
| - name: Check backend health | ||
| run: | | ||
| curl -f http://localhost:8000/ || exit 1 | ||
|
|
||
| - name: Check frontend health | ||
| run: | | ||
| curl -f http://localhost:5173/ || exit 1 | ||
|
|
||
| - name: Show logs on failure | ||
| if: failure() | ||
| run: | | ||
| docker compose logs | ||
|
|
||
| - name: Cleanup | ||
| if: always() | ||
| run: | | ||
| docker compose down -v |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| __pycache__ | ||
| *.pyc | ||
| *.pyo | ||
| *.pyd | ||
| .Python | ||
| *.so | ||
| .env | ||
| .venv | ||
| env/ | ||
| venv/ | ||
| ENV/ | ||
| .git | ||
| .gitignore | ||
| .pytest_cache | ||
| .coverage | ||
| htmlcov/ | ||
| dist/ | ||
| build/ | ||
| *.egg-info/ | ||
| .DS_Store | ||
| *.log |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| user=postgres | ||
| password=your_postgres_password | ||
| host=your_postgres_host | ||
| port=5432 | ||
| dbname=postgres | ||
| GROQ_API_KEY=your_groq_api_key | ||
| SUPABASE_URL=your_supabase_url | ||
| SUPABASE_KEY=your_supabase_key | ||
| GEMINI_API_KEY=your_gemini_api_key | ||
| YOUTUBE_API_KEY=your_youtube_api_key | ||
| REDIS_HOST=redis | ||
| REDIS_PORT=6379 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| FROM python:3.10-slim | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| gcc \ | ||
| libpq-dev \ | ||
| curl \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| COPY requirements.txt . | ||
| RUN pip install --no-cache-dir -r requirements.txt | ||
|
|
||
| COPY . . | ||
|
|
||
| EXPOSE 8000 | ||
|
|
||
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| FROM python:3.10-slim AS builder | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| gcc \ | ||
| libpq-dev \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| COPY requirements.txt . | ||
| RUN pip install --no-cache-dir --user -r requirements.txt | ||
|
|
||
| FROM python:3.10-slim | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| libpq5 \ | ||
| && rm -rf /var/lib/apt/lists/* \ | ||
| && groupadd -r appuser && useradd -r -g appuser appuser | ||
|
|
||
| COPY --from=builder /root/.local /root/.local | ||
| COPY . . | ||
|
|
||
| RUN chown -R appuser:appuser /app | ||
|
|
||
| USER appuser | ||
|
|
||
| ENV PATH=/root/.local/bin:$PATH | ||
|
|
||
| EXPOSE 8000 | ||
|
|
||
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,25 +18,37 @@ | |
| import uuid | ||
| from datetime import datetime, timezone | ||
|
|
||
| # Load environment variables | ||
| load_dotenv() | ||
| url: str = os.getenv("SUPABASE_URL") | ||
| key: str = os.getenv("SUPABASE_KEY") | ||
| supabase: Client = create_client(url, key) | ||
|
|
||
| url: str = os.getenv("SUPABASE_URL", "") | ||
| key: str = os.getenv("SUPABASE_KEY", "") | ||
|
|
||
| if not url or not key or "your-" in url: | ||
| print("β οΈ Supabase credentials not configured. Some features will be limited.") | ||
| supabase = None | ||
|
Comment on lines
+26
to
+28
|
||
| else: | ||
| try: | ||
| supabase: Client = create_client(url, key) | ||
| except Exception as e: | ||
| print(f"β Supabase connection failed: {e}") | ||
|
||
| supabase = None | ||
|
|
||
| # Define Router | ||
| router = APIRouter() | ||
|
|
||
| # Helper Functions | ||
| def generate_uuid(): | ||
| return str(uuid.uuid4()) | ||
|
|
||
| def current_timestamp(): | ||
| return datetime.now(timezone.utc).isoformat() | ||
|
|
||
| # ========== USER ROUTES ========== | ||
| def check_supabase(): | ||
| if not supabase: | ||
| raise HTTPException(status_code=503, detail="Database service unavailable. Please configure Supabase credentials.") | ||
|
|
||
| @router.post("/users/") | ||
| async def create_user(user: UserCreate): | ||
| check_supabase() | ||
| user_id = generate_uuid() | ||
| t = current_timestamp() | ||
|
|
||
|
|
||
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.
Print statement may execute during import.