{"id":23170632,"url":"https://github.com/DarinelEscobar/FastAPI-Secure-API","last_synced_at":"2025-08-18T07:31:49.105Z","repository":{"id":264714241,"uuid":"894120808","full_name":"DarinelGuillen/FastAPI-Secure-API","owner":"DarinelGuillen","description":"A lightweight FastAPI skeleton for building secure, scalable REST APIs. Includes JWT-based authentication, Google Drive integration using OAuth2, and modular, clean architecture for rapid development.","archived":false,"fork":false,"pushed_at":"2024-12-03T19:49:48.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-03T20:33:56.583Z","etag":null,"topics":["api","asynchronous-programming","backend","crud","fastapi","google-drive","jwt","oauth2","python3","rest-api","scalable-architecture","skeleton","skeleton-application","uvicorn"],"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/DarinelGuillen.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":"2024-11-25T19:41:51.000Z","updated_at":"2024-12-03T19:49:52.000Z","dependencies_parsed_at":"2024-11-26T01:49:29.691Z","dependency_job_id":null,"html_url":"https://github.com/DarinelGuillen/FastAPI-Secure-API","commit_stats":null,"previous_names":["darinelguillen/fastapi-secure-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarinelGuillen%2FFastAPI-Secure-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarinelGuillen%2FFastAPI-Secure-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarinelGuillen%2FFastAPI-Secure-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarinelGuillen%2FFastAPI-Secure-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DarinelGuillen","download_url":"https://codeload.github.com/DarinelGuillen/FastAPI-Secure-API/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230215134,"owners_count":18191400,"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":["api","asynchronous-programming","backend","crud","fastapi","google-drive","jwt","oauth2","python3","rest-api","scalable-architecture","skeleton","skeleton-application","uvicorn"],"created_at":"2024-12-18T04:14:19.948Z","updated_at":"2025-08-18T07:31:43.805Z","avatar_url":"https://github.com/DarinelGuillen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# API Project Documentation\n\n## Overview\nThis API is built with **FastAPI** to manage authentication and perform operations with Google Drive. It includes login functionality, file listing from Google Drive, and uses JWT tokens for secure authentication.\n\n---\n\n## Requirements\n\n- Python 3.11\n- FastAPI\n- Uvicorn\n- Python-dotenv\n- Google-auth libraries\n\n---\n\n## Installation\n\n1. **Clone the Repository**:\n   ```bash\n   git clone https://github.com/your-repo-name.git\n   cd api_project\n   ```\n\n2. **Create a Virtual Environment**:\n   ```bash\n   python3.11 -m venv venv\n   .\\venv\\Scripts\\Activate\n   ```\n\n3. **Install Dependencies**:\n   ```bash\n   pip install -r requirements.txt\n   ```\n   Or manually:\n   ```bash\n   pip install fastapi uvicorn python-dotenv google-auth google-auth-oauthlib google-api-python-client\n   ```\n\n4. **Set Up Environment Variables**:\n   Create a `.env` file in the root directory with the following:\n   ```\n   GOOGLE_CLIENT_ID=your-google-client-id\n   GOOGLE_CLIENT_SECRET=your-google-client-secret\n   SECRET_KEY=your-secret-key\n   ALGORITHM=HS256\n   ACCESS_TOKEN_EXPIRE_MINUTES=30\n   ```\n\n---\n\n## Run the Application\n\nStart the server using Uvicorn:\n```bash\n.\\venv\\Scripts\\Activate\nuvicorn app.main:app --reload\n```\n\nThe API will be accessible at `http://localhost:8000`.\n\n---\n\n## Features\n\n### Authentication\n- **Login Endpoint**: `/auth/login`\n  - Accepts `username` and `password` using `OAuth2PasswordRequestForm`.\n  - Returns a JWT token.\n\n### Google Drive Integration\n- **Authorize**: `/drive/authorize`\n  - Redirects the user to the Google authentication page.\n- **Callback**: `/drive/oauth2callback`\n  - Handles the OAuth2 callback.\n- **List Files**: `/drive/files`\n  - Lists the user’s Google Drive files.\n\n### Example Endpoint\n- `/hello`: Returns a simple JSON response: `{\"message\": \"Hello World\"}`.\n\n---\n\n## Project Structure\n\n```\napi_project/\n├── app/\n│   ├── main.py                 # Entry point for the API\n│   ├── core/\n│   │   ├── config.py           # Configuration and environment variables\n│   │   ├── security.py         # Security-related utilities\n│   ├── models/\n│   │   ├── user.py             # User models\n│   ├── routers/\n│   │   ├── auth.py             # Authentication routes\n│   │   ├── drive.py            # Google Drive routes\n│   ├── schemas/\n│   │   ├── user.py             # Data validation for users\n│   │   ├── drive.py            # Data validation for Drive operations\n│   ├── services/\n│   │   ├── auth.py             # Token generation and verification\n│   │   ├── google_drive.py     # Google Drive API interactions\n│   ├── utils/\n│   │   ├── helpers.py          # Helper utilities\n```\n\n---\n\n## Testing\n\n- Access Swagger UI documentation: [http://localhost:8000/docs](http://localhost:8000/docs)\n- Use ReDoc for API visualization: [http://localhost:8000/redoc](http://localhost:8000/redoc)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDarinelEscobar%2FFastAPI-Secure-API","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDarinelEscobar%2FFastAPI-Secure-API","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDarinelEscobar%2FFastAPI-Secure-API/lists"}