Skip to content
sp.@sujalpatelcoder
All notes
Under the hood

A file upload is only the beginning.

The systems behind S-Drive: storage, access control, caching, and keeping an eye on what is running.

sp.Sujal Patel··2 min read

S-Drive is a cloud storage project for saving and sharing files. The interface is built with React, while an Express backend connects the pieces behind it.

The interesting part of a storage app starts after the upload button. Where does the file live? Who can access it? What happens when requests get expensive? How do you see what the service is doing?

Give each piece a clear job

The project uses AWS S3 for file storage and CloudFront for content delivery. MongoDB holds application data, while Redis supports caching and session management.

Those tools serve different purposes. Keeping a file’s bytes separate from application records lets the backend manage information about a file without treating every request as a file transfer.

Access is part of the product

S-Drive includes role-based access control, input validation, and rate limiting. A good storage interface needs a clear answer to “who can open this?” just as much as “where did I save it?”

Here’s a deliberately small example of that distinction:

typescript
type AccessContext = {  userId: string;  ownerId: string;  role: "member" | "admin";};
function canManageFile(context: AccessContext) {  return context.userId === context.ownerId ||    context.role === "admin";}

This is an illustrative rule. A production sharing system also needs to account for its own permission model, including shared access and revoked links.

Shipping includes observing

The project uses Docker, with Prometheus and Grafana for monitoring. Deployment makes a service available; monitoring helps make its behavior visible.

Storage, access, caching, and observability can feel like separate subjects. In a working product, they meet in every request. That’s the part of full-stack development I keep coming back to: connecting the screen to the systems that make it useful.

Explore my other work, or say hello.

ANOTHER NOTE

Your money shouldn’t need a connection.