Post

FastAPI Document Storage Service

FastAPI Document Storage Service

Repository

For running this project and documentation, visit the GitHub repo: fastapi-document-storage-service

Demo Video

If the embedded video doesn’t load, you can watch the demo directly on YouTube

Overview

A FastAPI service for per-user document storage with JWT authentication, S3-compatible storage, and AWS cloud deployment. Users can register, authenticate, and manage their documents through a RESTful API with presigned URLs for secure file access.

What I Built

RESTful API with FastAPI for user authentication and document management. JWT-based authentication system with secure token handling Per-user document storage with unique filename enforcement. Presigned URL generation for secure file downloads and complete AWS cloud infrastructure with automated CI/CD pipeline. API documentation with OpenAPI/Swagger integration (this part was generated by FastAPI).

Technologies Used

  • Backend - Python, FastAPI, SQLAlchemy, Alembic
  • Database - PostgreSQL (AWS RDS)
  • Storage - S3-compatible object storage
  • Authentication - JWT tokens
  • Cloud - AWS (ECS Fargate, ECR, ALB, WAF, S3, RDS)
  • DevOps - Docker, GitHub Actions CI/CD
  • Testing - Pytest, LocalStack for S3 testing

Key Features

  • Secure Document Isolation - Per-user document storage with unique filename enforcement
  • JWT Authentication - Token-based authentication for all API endpoints
  • Presigned URLs - Automatic generation for secure file downloads
  • DDoS Protection - Rate limiting and security via AWS WAF
  • Automated Deployment - CI/CD pipeline with container registry
  • API Documentation - Comprehensive testing suite and OpenAPI docs
  • Scalable Architecture - Cost-effective cloud infrastructure

What I Learned

I learned how to integrate different AWS services together to deploy a secure RESTful API, cloud architecture design, FastAPI development, implementing CI/CD pipelines with automated testing. Database design and migration management with SQLAlchemy/Alembic and security considerations for remote file storage. I also learned how to optimise cost when it comes to deploying applications using the cloud.

This post is licensed under CC BY 4.0 by the author.