Back to Reelit
30 Challenges

Reelit

Every challenge I faced while building Reelit, documented.

30 Total Challenges
3 months to build
15 Technologies
#1

PostgreSQL Was Using the Wrong Hostname

Problem

My backend tried connecting to PostgreSQL using localhost, which does not work for container-to-container communication.

Fix

I changed the hostname to the Docker service name db.

Lesson Learned

Inside Docker Compose, services should communicate using service names, not localhost.

#2

Docker Containers Could Not Find Each Other

Problem

Even after using db, I got could not translate host name "db" to address.

Fix

I found that the containers were not connected to the same Docker network and recreated them correctly.

Lesson Learned

Correct hostnames only work when containers actually share a network.

#3

SQLAlchemy Models Used Different Base Classes

Problem

Only some database tables were being created because different models were using different Base classes.

Fix

I moved every model to one shared Base from app.database.

Lesson Learned

All related SQLAlchemy models need to share the same declarative Base.

#4

Database Models and Actual Tables Went Out of Sync

Problem

The backend expected fields like is_creator, but those columns did not exist in PostgreSQL.

Fix

I added the missing columns and synchronized the schema.

Lesson Learned

Updating a model does not automatically update an existing database.

#5

Ports Were Already in Use

Problem

Ports 5432, 6379, and 8000 were sometimes occupied by old services or Docker processes.

Fix

I identified and stopped the conflicting processes.

Lesson Learned

A server startup failure is not always a code problem. Sometimes the port is simply busy.

#6

Redis Connection Kept Failing

Problem

I got errors like Error 10061 connecting to localhost:6379.

Fix

I checked whether Redis was actually running and corrected the hostname for each environment.

Lesson Learned

Connection issues can come from both a dead service and incorrect configuration.

#7

Docker Failed Because of Permissions

Problem

On Linux, Docker commands failed with permission errors while accessing the Docker daemon.

Fix

I added the user to the Docker group and refreshed the session.

Lesson Learned

Installing Docker is not enough; the current user also needs permission to access it.

#8

Docker Images and Cache Became Corrupted

Problem

I faced errors like No such image: sha256... and ContainerConfig.

Fix

I cleaned stale images, containers, volumes, and rebuilt everything.

Lesson Learned

Sometimes the application code is fine and the Docker environment itself is broken.

#9

Google Sign-In Failed with ApiException: 10

Problem

Google login completely failed because the signing configuration did not match Firebase.

Fix

I generated the SHA fingerprints, added them to Firebase, and downloaded a fresh google-services.json.

Lesson Learned

Google Sign-In depends heavily on correct SHA fingerprints and OAuth configuration.

#10

Google Login Worked but the User Was Not Saved

Problem

Firebase authentication succeeded, but no user appeared in my PostgreSQL database.

Fix

I explicitly called my backend Google login flow after Firebase authentication.

Lesson Learned

Firebase login and backend user creation are two separate steps.

#11

Google Login Returned Backend Errors

Problem

At different points, Google login returned 404 because the endpoint was missing and 500 because my User model received an invalid is_active field.

Fix

I added the missing endpoint and aligned user creation with the actual SQLAlchemy model.

Lesson Learned

Authentication can fail even after Google succeeds because the backend contract is still wrong.

#12

Tokens Expired or Were Missing from Requests

Problem

Uploads and protected endpoints failed with 401 Unauthorized or Invalid or expired token.

Fix

I corrected the Authorization: Bearer <token> header and improved re-authentication and token handling.

Lesson Learned

Authentication is not finished after login; every protected request needs valid token handling.

#13

Firebase Was Not Initialized Before Use

Problem

The app crashed with No Firebase App '[DEFAULT]' has been created.

Fix

I initialized Firebase before accessing authentication services.

Lesson Learned

SDK initialization order matters.

#14

Profile Updates Looked Successful but Did Not Save

Problem

I changed the user's name in the app, but the old name kept appearing.

Fix

I found a mismatch between the Flutter request and FastAPI endpoint and standardized the update flow around the correct JSON body.

Lesson Learned

Frontend and backend must agree exactly on payload structure.

#15

User State Was Duplicated Across Providers

Problem

ProfileProvider and ReelitAuthProvider both stored user data, which caused stale values and synchronization bugs.

Fix

I simplified the architecture and moved toward one source of truth.

Lesson Learned

Duplicating the same state in multiple places creates hard-to-track bugs.

#16

Categories Could Not Be Selected

Problem

Category cards looked correct but taps did not behave properly with my Selector and GestureDetector setup.

Fix

I reworked the widget structure and used Consumer where broader state updates were required.

Lesson Learned

Performance optimization is useless if interaction becomes unreliable.

#17

Navigation State Became Inconsistent

Problem

Multiple bottom navigation icons appeared highlighted, and at one point I had duplicate navigation bars.

Fix

I corrected selected-index handling and gave navigation one clear owner.

Lesson Learned

Shared navigation should be controlled from one place.

#18

Role Selection Was Skipped After Login

Problem

New users sometimes entered the app directly instead of seeing the creator/user role selection screen.

Fix

I updated AuthWrapper to check the stored onboarding and role state.

Lesson Learned

Being authenticated does not mean onboarding is complete.

#19

Release APK Looked Zoomed In

Problem

The UI looked fine during development but appeared zoomed in in the release APK.

Fix

I traced the issue to Transform.scale and removed it.

Lesson Learned

Debug and release builds can behave differently, so both need real-device testing.

#20

Android Storage Permissions Kept Breaking

Problem

Downloads failed on newer Android versions with errors like PathAccessException: Operation not permitted.

Fix

I added version-aware permission handling and dealt with newer media permissions such as READ_MEDIA_VIDEO.

Lesson Learned

Android storage is not one universal permission anymore; behavior changes across OS versions.

#21

Reels Were Not Saving to the Expected Folder

Problem

Downloads completed, but users could not find the files where expected.

Fix

I corrected the download destination for the device setup I was testing and validated the actual file path.

Lesson Learned

Android file paths should never be assumed without testing on real devices.

#22

Deleted Reels Still Appeared in the App

Problem

Users could delete a video from the gallery, but Reelit still showed it.

Fix

I added file-existence checks and better synchronization with external file changes.

Lesson Learned

A saved file path does not guarantee that the file still exists.

#23

Realme Phones Exposed .trashed Files

Problem

On a Realme device, deleted videos were moved into .trashed files and Reelit treated them as normal reels.

Fix

I filtered .trashed paths and filenames.

Lesson Learned

Real devices expose OEM-specific behavior that emulators may never show.

#24

Thumbnail Generation Was Slow and Sometimes Failed

Problem

Thumbnails were regenerated after every restart, and generation failed if the original video had already been deleted.

Fix

I added SQLite-based persistent caching and file-existence checks.

Lesson Learned

Expensive work should be cached, and local files should always be validated before processing.

#25

Too Many Downloads Slowed Down the Phone

Problem

Starting around 50 downloads together made the app and device unstable.

Fix

I built a controlled queue with maxConcurrentDownloads = 3.

Lesson Learned

More concurrency does not automatically mean more speed.

#26

S3 URLs Returned 403 Forbidden

Problem

The backend returned valid-looking video URLs, but downloads still failed.

Fix

I corrected S3 access configuration and used CloudFront for media delivery where appropriate.

Lesson Learned

A valid URL does not mean the user is authorized to access the file.

#27

S3 Uploads Failed with AccessControlListNotSupported

Problem

Upload requests failed because the code tried to apply an ACL that the bucket configuration did not support.

Fix

I removed the unnecessary ACL parameter.

Lesson Learned

Modern S3 Object Ownership settings can disable ACL-based access completely.

#28

Video Compression Failed Inside Docker

Problem

Compression worked conceptually, but the backend container could not run it because FFmpeg was missing.

Fix

I installed FFmpeg inside the Docker image and rebuilt it.

Lesson Learned

A dependency installed on my laptop does not automatically exist inside a container.

#29

API URLs Were Built Incorrectly

Problem

Some requests became /api/api/auth/login, while others missed /api entirely.

Fix

I centralized API URL construction and followed one convention for base URLs and endpoints.

Lesson Learned

Small inconsistencies in API constants can break entire features.

#30

EC2 Deployment Failed for Reasons Outside the App

Problem

I faced SSH failures because port 22 was missing from the security group, missing dependencies because requirements.txt was incomplete, and server-side environment issues that did not appear locally.

Fix

I corrected EC2 networking rules, restored dependencies, and rebuilt the deployment environment.

Lesson Learned

Deployment is its own engineering layer. Code that works locally can still fail because of infrastructure, permissions, networking, or missing dependencies.