fileO is a simple cloud storage backend built with FastAPI that supports uploading, listing, and deleting files (images, videos, documents). It can run in Local Mode (your laptop) or Cloud Mode (AWS Lambda + S3 + DynamoDB + API Gateway).
Runs FastAPI on your machine.
- Files are uploaded to AWS S3
- Metadata is written to DynamoDB
- The server runs normally using Uvicorn
Start locally:
uvicorn main:app --reloadRefer to Cloud Setup
Runs inside AWS Lambda using Mangum.
- Triggered by API Gateway
- Same endpoints, same behavior
- No server or VM needed
Health check.
Authenticates the user.
Body:
emailpassword
Returns:
- JWT token
Checks token and returns logged-in user.
Header:
Authorization: Bearer <token>
Generates S3 presigned URLs to upload files directly from the browser.
Body:
- List of files (name + MIME type)
Returns:
- Presigned S3 URLs
- S3 keys stored in DynamoDB
Returns all files uploaded by the user.
Header:
Authorization: Bearer <token>
Each item includes:
docIds3KeyfileTypemimeTypeuploadedAt
Deletes the file from S3 and DynamoDB.
Header:
Authorization: Bearer <token>
BUCKET_NAME=your-s3-bucket
DDB_TABLE=your-dynamodb-table
JWT_SECRET=your-secret-key
TOKEN_EXPIRE_MINUTES=43200
AWS_REGION=ap-south-1AWS_ACCESS_KEY_ID=your-local-access-key
AWS_SECRET_ACCESS_KEY=your-local-secret-key(Cloud Mode uses IAM Role instead — no keys needed.)
- Use bucket name from
.env - No public access required (presigned URLs work privately)
Table name = DDB_TABLE.
Keys:
- Partition Key →
userId(String) - Sort Key →
uploadedat(Number)
- Zip your project and dependencies
- Upload to Lambda
- Set environment variables from
.env(without AWS keys) - Add API Gateway → HTTP API
IAM role must include:
AmazonS3FullAccessAmazonDynamoDBFullAccess
(or custom minimal role)
- Install dependencies:
pip install -r requirements.txt-
Create
.envfile with AWS keys included. -
Run FastAPI server:
uvicorn main:app --reload- Access:
http://localhost:8000
- Remove AWS keys from
.env - Deploy Lambda + API Gateway
- Set environment variables
- Access the cloud API URL:
https://<api-id>.execute-api.ap-south-1.amazonaws.com
Set the API base URL based on mode:
Local Mode:
const API_BASE = "http://localhost:8000";Cloud Mode:
const API_BASE = "https://<api-id>.execute-api.ap-south-1.amazonaws.com";