diff --git a/.gitignore b/.gitignore index 1262b41..8b7c2d8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +# Ignore VS Code settings +.vscode/ # Logs logs *.log @@ -35,4 +37,11 @@ venv/ env/ ENV/ venv.bak/ -pycache/ \ No newline at end of file +pycache/ + +# Environment files +.env +backend/.env + +#next.js +.next/ diff --git a/backend/README.md b/backend/README.md new file mode 100644 index 0000000..666559c --- /dev/null +++ b/backend/README.md @@ -0,0 +1,3 @@ +# Backend + +Project backend structure and setup instructions. diff --git a/backend/app/__init__.py b/backend/app/__init__.py new file mode 100644 index 0000000..2839885 --- /dev/null +++ b/backend/app/__init__.py @@ -0,0 +1 @@ +# app package init diff --git a/backend/app/api/__init__.py b/backend/app/api/__init__.py new file mode 100644 index 0000000..04823ca --- /dev/null +++ b/backend/app/api/__init__.py @@ -0,0 +1 @@ +# api package init diff --git a/backend/app/api/routes/__init__.py b/backend/app/api/routes/__init__.py new file mode 100644 index 0000000..8ebd595 --- /dev/null +++ b/backend/app/api/routes/__init__.py @@ -0,0 +1 @@ +# routes package init diff --git a/backend/app/core/__init__.py b/backend/app/core/__init__.py new file mode 100644 index 0000000..eebe93b --- /dev/null +++ b/backend/app/core/__init__.py @@ -0,0 +1 @@ +# core package init diff --git a/backend/app/core/config.py b/backend/app/core/config.py new file mode 100644 index 0000000..64ba7f2 --- /dev/null +++ b/backend/app/core/config.py @@ -0,0 +1,12 @@ +# Configuration settings for FastAPI app +from pydantic_settings import BaseSettings + +class Settings(BaseSettings): + database_url: str + ai_api_key: str + + model_config = { + "env_file": ".env" + } + +settings = Settings() diff --git a/backend/app/db/__init__.py b/backend/app/db/__init__.py new file mode 100644 index 0000000..691cef1 --- /dev/null +++ b/backend/app/db/__init__.py @@ -0,0 +1 @@ +# db package init diff --git a/backend/app/db/database.py b/backend/app/db/database.py new file mode 100644 index 0000000..f55fa7c --- /dev/null +++ b/backend/app/db/database.py @@ -0,0 +1 @@ +# Database connection setup diff --git a/backend/app/main.py b/backend/app/main.py new file mode 100644 index 0000000..1b0dad4 --- /dev/null +++ b/backend/app/main.py @@ -0,0 +1,18 @@ +from fastapi import FastAPI +from fastapi.middleware.cors import CORSMiddleware +import os + +app = FastAPI(title="Inpact Backend", version="0.1.0") + +# --- CORS Setup (so frontend can talk to backend) --- +app.add_middleware( + CORSMiddleware, + allow_origins=os.getenv("ALLOWED_ORIGINS", "http://localhost:3000").split(","), + allow_credentials=True, + allow_methods=["*"], + allow_headers=["*"], +) + +@app.get("/") +def root(): + return {"message": "Welcome to Inpact Backend 🚀"} diff --git a/backend/app/models/__init__.py b/backend/app/models/__init__.py new file mode 100644 index 0000000..654e47b --- /dev/null +++ b/backend/app/models/__init__.py @@ -0,0 +1 @@ +# models package init diff --git a/backend/env_example b/backend/env_example new file mode 100644 index 0000000..a56d896 --- /dev/null +++ b/backend/env_example @@ -0,0 +1,6 @@ +# Example environment file for backend + +DATABASE_URL=postgresql://user:password@localhost:5432/inpactdb +AI_API_KEY=your-ai-api-key-here + +ALLOWED_ORIGINS=http://localhost:3000 diff --git a/backend/requirements.txt b/backend/requirements.txt new file mode 100644 index 0000000..da081ce --- /dev/null +++ b/backend/requirements.txt @@ -0,0 +1,23 @@ +annotated-doc==0.0.3 +annotated-types==0.7.0 +anyio==4.11.0 +black==25.9.0 +click==8.3.0 +fastapi==0.120.3 +h11==0.16.0 +idna==3.11 +mypy_extensions==1.1.0 +packaging==25.0 +pathspec==0.12.1 +platformdirs==4.5.0 +pydantic==2.12.3 +pydantic-settings>=2.0.3 +pydantic_core==2.41.4 +python-dotenv==1.2.1 +pytokens==0.2.0 +ruff==0.14.3 +sniffio==1.3.1 +starlette==0.49.1 +typing-inspection==0.4.2 +typing_extensions==4.15.0 +uvicorn==0.38.0