Skip to content

Commit 8ae59de

Browse files
authored
Merge pull request #2 from 6six7sven/terraform
added iac-terraform
2 parents 228f35f + 6926e4a commit 8ae59de

11 files changed

Lines changed: 288 additions & 2 deletions

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,14 @@ __pycache__
33
uploads/*
44
!uploads/.gitkeep
55
.env
6+
# Local .terraform directories
7+
**/.terraform/*
8+
9+
# .tfstate files (Contains sensitive AWS credentials!)
10+
*.tfstate
11+
*.tfstate.*
12+
13+
# Exclude all .tfvars files
14+
*.tfvars
15+
*.tfvars.json
16+
*tfplan*

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ A FastAPI-based KYC (Know Your Customer) system that automatically extracts stru
55
## Features
66

77
- **JWT Authentication**: Secure endpoint access with token-based authentication
8+
- **High Throughput**: Capable of handling massive concurrent read-requests via FastAPI
9+
- **Low Latency**: Reduced API response latency by offloading document analysis to background workers.
810
- **Async Processing**: Celery task queue for background document analysis
911
- **AWS Textract Integration**: Automatic extraction of ID field data (name, DOB, document number, etc.)
1012
- **S3 Storage**: Secure file upload and storage with presigned URLs
1113
- **PostgreSQL Persistence**: Track KYC task status and results
1214
- **Image Validation**: Support for JPEG, PNG, and WebP formats
15+
- **Infrastructure as Code**: Automated AWS provisioning (RDS, EC2, S3) using Terraform
1316
- **Structured Logging**: Comprehensive logging for debugging and monitoring
1417

1518
## Tech Stack
@@ -20,6 +23,7 @@ A FastAPI-based KYC (Know Your Customer) system that automatically extracts stru
2023
- **Cloud Services**: AWS Textract, S3
2124
- **Authentication**: PyJWT
2225
- **Server**: Uvicorn
26+
- **Infrastructure**: Terraform, Docker
2327

2428
## Project Structure
2529

@@ -36,17 +40,37 @@ A FastAPI-based KYC (Know Your Customer) system that automatically extracts stru
3640
├── db/
3741
│ ├── database.py # Database connection setup
3842
│ └── models.py # SQLAlchemy models
43+
├── terraform/ # Terraform IaC configuration
44+
│ └── main.tf # AWS infrastructure definitions
3945
└── uploads/ # Local upload directory (for development)
4046
```
4147
## Architecture Overview
4248
- **Architecture Diagram**
4349

44-
![Kyc-API Architecture](arch-images/kyc-arch.png)
50+
![Kyc-API Architecture](images/kyc-arch.png)
4551

4652
- **Data Flow Diagram**
4753

48-
![Kyc-API DFD](arch-images/kyc-dfd.jpg)
54+
![Kyc-API DFD](images/kyc-dfd.jpg)
4955

56+
## Live Demo
57+
![GIF](https://github.com/6six7sven/kyc-extraction-api-python-aws-postgresql/blob/terraform/images/api-showcase.gif?raw=true)
58+
59+
## Screenshots
60+
61+
### Swagger/OpenAPI Documentation
62+
![swagger-openapi-doc](images/swagger-openapi-doc.jpg)
63+
64+
### Completed Task Status Example
65+
![task-status-example](images/task-status-example.jpg)
66+
67+
### PostgreSQL Schema
68+
![postgresql-schema](images/schema-diagram.jpg)
69+
70+
### Github Actions Workflow
71+
![github-actions-workflow](images/gh-action-workflow.jpg)
72+
73+
</details>
5074

5175
## Engineering Decisions
5276

images/api-showcase.gif

1.57 MB
Loading

images/gh-action-workflow.jpg

142 KB
Loading

images/schema-diagram.jpg

134 KB
Loading

images/swagger-openapi-doc.jpg

160 KB
Loading

images/task-status-example.jpg

130 KB
Loading

terraform/.terraform.lock.hcl

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)