Open-Source FastAPI-MSSQL API Integration
Budget: $250 – $750 USD
FastAPI + MSSQL Middleware API Setup (Open-Source)
Objective
Build an open-source (MIT or Apache-2.0 licensed) FastAPI middleware API that connects to my existing MSSQL database, can be tested with Postman, and runs securely on Windows. The deliverable should include source code, documentation, and a compiled .exe for Windows.
Scope
Database Connection & Infrastructure
Connect to MSSQL using pyodbc or SQLAlchemy (ODBC Driver 18).
All configuration values stored in a .env file (server, DB, user, password, port, secret token).
Auto-generated Swagger/OpenAPI docs using FastAPI.
Proper CORS configuration (allowing only specified origins).
Security
Bearer Token Authorization (Authorization: Bearer <TOKEN>) required.
Parameterized queries to prevent SQL injection.
(Optional) Rate limiting and IP allowlisting.
Clear error handling and logging.
Required Endpoints
GET /health → Basic health check.
GET /db-health → Verifies MSSQL connectivity (requires token).
GET /stok/{code} → Returns a sample record from the STOK table.
POST /sql → Executes whitelisted named queries or stored procedures. Examples:
"name": "GetStokByCode", "params": {"code_like": "77%"}
"name": "GetInvoiceDetailByBLKODU", "params": {"invoice_blkodu": 25027}
(Optional) POST /SetStokFiyat → Updates stock prices with logging.
Packaging & Deployment
Build a PyInstaller .exe for Windows.
Provide instructions (or scripts) to run it as a Windows Service (e.g., using NSSM).
(Optional) Include a Dockerfile for container deployment.
Documentation & Testing
README.md explaining setup, environment variables, running instructions, and troubleshooting.
Provide a Postman Collection and Environment file with ready-to-use sample requests.
Include minimal test scenarios for acceptance.
Deliverables
Full source code in a Git repository or ZIP.
.env.example file.
Postman collection and environment files.
Compiled .exe with service installation instructions.
License file (MIT or Apache-2.0).
Demo verification that endpoints work on my environment.
Acceptance Criteria
GET /health returns { "ok": true }.
GET /db-health returns { "db_ok": true } with a valid DB connection.
GET /stok/{code} returns correct data or { "found": false } if not found.
POST /sql executes only whitelisted queries and returns proper data or 400 if the name is invalid.
Swagger UI is available and functional.
Postman requests run successfully without changes (after setting environment variables).
Environment
Windows 10,11 or Windows Server.
Python 3.11+.
MSSQL database accessible over IP and port (may require TrustServerCertificate=true).
Skills Required
Strong knowledge of FastAPI, Python, and MSSQL.
Experience with Windows deployment (PyInstaller, Windows Services).
Familiarity with security best practices and documentation.
Budget & Timeline
Budget: 300 USD.
Timeline: 3–7 days for setup.
How to Apply
Share 1–2 similar projects you’ve completed (or brief descriptions).
Outline your proposed approach (architecture, security, testing) in 4–6 bullet points.
Provide your estimated timeline and total cost.
Include any clarifying questions about the schema, table names, or sample data.
Objective
Build an open-source (MIT or Apache-2.0 licensed) FastAPI middleware API that connects to my existing MSSQL database, can be tested with Postman, and runs securely on Windows. The deliverable should include source code, documentation, and a compiled .exe for Windows.
Scope
Database Connection & Infrastructure
Connect to MSSQL using pyodbc or SQLAlchemy (ODBC Driver 18).
All configuration values stored in a .env file (server, DB, user, password, port, secret token).
Auto-generated Swagger/OpenAPI docs using FastAPI.
Proper CORS configuration (allowing only specified origins).
Security
Bearer Token Authorization (Authorization: Bearer <TOKEN>) required.
Parameterized queries to prevent SQL injection.
(Optional) Rate limiting and IP allowlisting.
Clear error handling and logging.
Required Endpoints
GET /health → Basic health check.
GET /db-health → Verifies MSSQL connectivity (requires token).
GET /stok/{code} → Returns a sample record from the STOK table.
POST /sql → Executes whitelisted named queries or stored procedures. Examples:
"name": "GetStokByCode", "params": {"code_like": "77%"}
"name": "GetInvoiceDetailByBLKODU", "params": {"invoice_blkodu": 25027}
(Optional) POST /SetStokFiyat → Updates stock prices with logging.
Packaging & Deployment
Build a PyInstaller .exe for Windows.
Provide instructions (or scripts) to run it as a Windows Service (e.g., using NSSM).
(Optional) Include a Dockerfile for container deployment.
Documentation & Testing
README.md explaining setup, environment variables, running instructions, and troubleshooting.
Provide a Postman Collection and Environment file with ready-to-use sample requests.
Include minimal test scenarios for acceptance.
Deliverables
Full source code in a Git repository or ZIP.
.env.example file.
Postman collection and environment files.
Compiled .exe with service installation instructions.
License file (MIT or Apache-2.0).
Demo verification that endpoints work on my environment.
Acceptance Criteria
GET /health returns { "ok": true }.
GET /db-health returns { "db_ok": true } with a valid DB connection.
GET /stok/{code} returns correct data or { "found": false } if not found.
POST /sql executes only whitelisted queries and returns proper data or 400 if the name is invalid.
Swagger UI is available and functional.
Postman requests run successfully without changes (after setting environment variables).
Environment
Windows 10,11 or Windows Server.
Python 3.11+.
MSSQL database accessible over IP and port (may require TrustServerCertificate=true).
Skills Required
Strong knowledge of FastAPI, Python, and MSSQL.
Experience with Windows deployment (PyInstaller, Windows Services).
Familiarity with security best practices and documentation.
Budget & Timeline
Budget: 300 USD.
Timeline: 3–7 days for setup.
How to Apply
Share 1–2 similar projects you’ve completed (or brief descriptions).
Outline your proposed approach (architecture, security, testing) in 4–6 bullet points.
Provide your estimated timeline and total cost.
Include any clarifying questions about the schema, table names, or sample data.