{"id":42716662,"url":"https://github.com/aluyapeter/nexus","last_synced_at":"2026-01-29T15:39:59.726Z","repository":{"id":327816416,"uuid":"1110905110","full_name":"aluyapeter/nexus","owner":"aluyapeter","description":"Nexus is a fintech backend demonstration which features secure Google authentication (OAuth2), idempotent payment processing with Paystack, and real-time transaction updates via cryptographic webhooks.","archived":false,"fork":false,"pushed_at":"2025-12-06T10:31:37.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-09T13:35:16.001Z","etag":null,"topics":["fastapi","oauth2","paystack-api","python3","webhooks"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aluyapeter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-05T22:52:16.000Z","updated_at":"2025-12-06T21:50:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/aluyapeter/nexus","commit_stats":null,"previous_names":["aluyapeter/nexus"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/aluyapeter/nexus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aluyapeter%2Fnexus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aluyapeter%2Fnexus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aluyapeter%2Fnexus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aluyapeter%2Fnexus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aluyapeter","download_url":"https://codeload.github.com/aluyapeter/nexus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aluyapeter%2Fnexus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28880338,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T10:31:27.438Z","status":"ssl_error","status_checked_at":"2026-01-29T10:31:01.017Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fastapi","oauth2","paystack-api","python3","webhooks"],"created_at":"2026-01-29T15:39:59.063Z","updated_at":"2026-01-29T15:39:59.719Z","avatar_url":"https://github.com/aluyapeter.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nexus: Google OAuth2 \u0026 Paystack Integration\n\nNexus is a robust fintech backend demonstration built with **FastAPI**. It features secure Google authentication (OAuth2), idempotent payment processing with **Paystack**, and real-time transaction updates via cryptographic webhooks.\n\n## 🚀 Features\n\n* **Authentication:** Google OAuth2 (Authorization Code Flow) with HTTP-only Cookies.\n* **Payments:** Paystack integration with idempotent transaction initiation.\n* **Webhooks:** Secure signature verification (HMAC SHA512) for payment status updates.\n* **Database:** PostgreSQL with SQLAlchemy ORM and Alembic migrations.\n* **Testing:** Full integration testing suite using `pytest` and SQLite.\n* **Frontend:** Minimalist dashboard for user interaction.\n\n---\n\n## 🛠️ Prerequisites\n\n* Python 3.10+\n* PostgreSQL (Local installation OR Docker)\n* Paystack Account (Test Keys)\n* Google Cloud Console Project (OAuth Credentials)\n\n---\n\n## 🔑 Environment Setup\n\nCreate a `.env` file in the root directory:\n\n```ini\n# Database\nDATABASE_URL=postgresql://nexus_user:nexus_password@localhost:5432/nexus_db\n\n# Google Auth\nGOOGLE_CLIENT_ID=your_google_client_id\nGOOGLE_CLIENT_SECRET=your_google_client_secret\nGOOGLE_REDIRECT_URI=http://localhost:8000/auth/google/callback\n\n# Paystack\nPAYSTACK_SECRET_KEY=sk_test_your_paystack_secret\n\n# Security\nSECRET_KEY=your_random_secret_string\nALGORITHM=HS256\nACCESS_TOKEN_EXPIRE_MINUTES=30\nENVIRONMENT=development\n```\n\n## 🏃 Option A: Running Locally (No Docker)\n\nIf you prefer to run directly on your machine, follow these steps.\n\n### 1. Database Setup\nYou must have PostgreSQL running locally.\n\n```bash\n# (Linux/WSL) Install Postgres\nsudo apt update \u0026\u0026 sudo apt install postgresql postgresql-contrib\n\n# Switch to postgres user\nsudo -i -u postgres\n\n# Create User and DB\npsql -c \"CREATE USER nexus_user WITH PASSWORD 'nexus_password';\"\npsql -c \"CREATE DATABASE nexus_db OWNER nexus_user;\"\nexit\n```\n\n## 2. Install Dependencies\n```bash\n\n# Create virtual environment\npython3 -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n\n# Install libraries\npip install -r requirements.txt\n```\n\n## 3. Run Migrations\nInitialize the database tables.\n\n```bash\nalembic upgrade head\n```\n\n## 4. Start the Server\n\n```bash\nuvicorn app.main:app --reload\n``` \n### Access the app at: http://localhost:8000/auth/google\n\n## 🐳 Option B: Running with Docker (Recommended)\nThis method handles the database and application environment automatically.\n\nEnsure Docker Desktop is running.\n\nBuild and run:\n\n```bash\ndocker compose up --build\n```\n### Access the app at: http://localhost:8000/auth/google\n\n## 🧪 Running Tests\nTests use an in-memory SQLite database, so they work without a running Postgres instance.\n\nLocal (with venv active):\n\n```bash\npytest -v\n```\n\nVia Docker:\n```bash\ndocker compose exec web pytest -v\n```\n\n## 📚 API Endpoints\n\n| Method | Endpoint | Description |\n| :--- | :--- | :--- |\n| **GET** | `/auth/google` | Initiates Google OAuth2 login flow. |\n| **GET** | `/users/me` | Returns current user details (Requires Cookie). |\n| **POST** | `/payments/paystack/initiate` | Starts a transaction. Body: `{\"amount\": 5000}` (Kobo). |\n| **GET** | `/payments/{ref}/status` | Checks transaction status. |\n| **POST** | `/payments/paystack/webhook` | Receives Paystack updates (Verifies Signature). |","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faluyapeter%2Fnexus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faluyapeter%2Fnexus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faluyapeter%2Fnexus/lists"}