{"id":28063727,"url":"https://github.com/giveth/giveth-neo4j","last_synced_at":"2025-05-12T12:19:27.817Z","repository":{"id":279059509,"uuid":"929894196","full_name":"Giveth/giveth-neo4j","owner":"Giveth","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-11T18:41:02.000Z","size":18901,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-05-12T12:19:05.379Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Giveth.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}},"created_at":"2025-02-09T16:44:04.000Z","updated_at":"2025-03-11T18:41:06.000Z","dependencies_parsed_at":"2025-02-23T14:42:47.584Z","dependency_job_id":null,"html_url":"https://github.com/Giveth/giveth-neo4j","commit_stats":null,"previous_names":["giveth/giveth-neo4j"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Giveth%2Fgiveth-neo4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Giveth%2Fgiveth-neo4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Giveth%2Fgiveth-neo4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Giveth%2Fgiveth-neo4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Giveth","download_url":"https://codeload.github.com/Giveth/giveth-neo4j/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253736103,"owners_count":21955786,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-05-12T12:19:27.140Z","updated_at":"2025-05-12T12:19:27.808Z","avatar_url":"https://github.com/Giveth.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Giveth Neo4j API\n\nThis project provides a Flask web server that interacts with a Neo4j database. It includes functionality for managing API keys, logging API key usage, and processing user requests to generate and execute Cypher queries.\n\n## 1. Requirements\n\n- Python 3.13+\n- pip\n\n## 2. Installation\n\n1. Install the required packages:\n\n```bash\npip install -r requirements.txt\n```\n\n2. Set up environment variables:\n\n```bash\ncp .env.example .env\n```\n   \n## 3. Running the Main App\n\nThe main application logic is in `src/cypher_query.py`. To run it, you can use the following command:\n\n```bash\npython src/cypher_query.py\n```\n\n## 4. Running the Web Server\n\nTo start the Flask web server, run:\n\n```bash\npython src/server.py\n```\n\nThe server will be available at `http://127.0.0.1:5000/`.\n\n## 5. Adding an API Key\n\nTo add a desired API key, modify the `src/add_api_key.py` file. Replace the placeholder values with your desired user and API key:\n\n```python\ncursor.execute('''\n    INSERT INTO api_keys (user, api_key)\n    VALUES (?, ?)\n''', ('your_user', 'your_unique_api_key'))\n```\nthen run:\n```bash\npython src/add_api_key.py\n```\nIt will add your API key to the local sqlite DB\n\n## 6. Endpoints to use cypher query\n\n### Health Check:\n- **GET** `/`\n- Returns a simple message indicating the server is running.\n\n### Query:\n- **POST** `/query`\n- **Headers:**\n    - `X-API-KEY`: Your API key\n- **Body:**\n  ```json\n  {\n    \"query\": \"your_query\",\n    \"output_format\": \"your_output_format\"\n  }\n  ```\n- Returns the results of the processed query.\n\nThis is the sample curl to use cypher query for your app (replace `your_unique_api_key` with the API key you added in step 5):\n\n```curl\ncurl --location '127.0.0.1:5000/query' \\\n--header 'X-API-KEY: your_unique_api_key' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"query\":\"I want to hear about projects impact kids health\",\n    \"output_format\": \"{project_id, project_title, raised_amount, giv_power, related_chunks: [text]}\"\n}'\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiveth%2Fgiveth-neo4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiveth%2Fgiveth-neo4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiveth%2Fgiveth-neo4j/lists"}