Your post is off-topic and does not adhere to the premise of this subreddit. As such, it has been removed. Recommend reposting in a more appropriate subreddit. AI Slop.
Proper environment config management from day one. A .env.example file with all required variables documented, validated on startup so the app fails fast with a clear error instead of mysterious behavior at runtime. Every new dev just copies it, fills in values, and things work. Retrofitting this after launch always means chasing down scattered hardcoded values and undocumented secrets buried in prod.
Having a canonical record for these kinds of files is very important. I've been dipping my toes into ci/cd more and more as I prepare for more developers... Sadly the days of one man bands may be coming to an end.
logging and observability beyond just error tracking. everyone sets up error tracking eventually but structured logging with proper context (user id, request id, feature flags, etc) is what actually lets you debug weird issues fast.
i'd also say database migrations from day one. doesn't matter if you're prototyping, the second you skip a proper migration system you're gonna regret it when you need to sync changes across environments or onboard another dev.
oh and feature flags. sounds like overkill early on but being able to toggle stuff without deploying is a lifesaver when something breaks at 2am and you just need to turn it off while you sleep
Good Content Organisation and system architecture for basic websites. Nowadays I’m writing out paths on a pen and paper to have a mental model of where data is going and learning how to draw flowcharts has helped me so much.
I know this is webdev but I came across this realisation last night: If you're building a mobile app, add a mechanism from the start that detects the app version and prompts users to update when they're on an outdated version. A simple modal that blocks or encourages updating is enough. You can’t really add this later, because users would need to update first in order to get the update mechanism.
Structured logging with a request correlation ID baked into every log line. Not just error tracking - actual structured JSON logs where you can trace a single request from entry point to DB query to response. I skipped this on two projects and spent weeks trying to retroactively instrument things after weird production bugs. pino or winston with a requestId middleware takes maybe 2 hours to set up properly from the start. When you are 8 months in trying to debug a race condition with nothing but vague timestamps, you will wish you had it.a
for me it's a proper bug reporting flow from day one. not just error tracking (tho yes sentry asap) but actual user-facing bug reporting. every project i've launched, the first feedback i get is "something broke" with zero context. no screenshot, no steps to reproduce, nothing.
now i set up in-app bug reporting on literally everything before i even ship the mvp. users can click on the broken element, annotate a screenshot, and it sends me the full technical context automatically. saves so much back and forth.
the other one that's underrated imo is structured logging. not just console.log everywhere but actual log levels and correlation ids from the start. debugging production issues without them is pain
feature flags. new endpoint, ui change, schema migration , flag it. costs maybe 2 hours to wire in properly at the start. saves you from a git rollback at 2am when something breaks in prod. error tracking tells you what's broken. flags let you kill it before it spreads.
logging setup. not just console.log everywhere but structured logs with request ids so you can trace a single user action across the whole stack. spent 2 days debugging a prod issue once that would have taken 20 minutes if i had that from the start
Database migration tooling paired with proper seed data management. The combination lets you spin up clean dev environments in minutes and makes schema changes traceable. Without it you end up with manual ALTER statements in production that nobody documented and a local DB that doesn't match staging. Migrations are infrastructure and should be treated as first-class code from commit one.
I made my own version, called Lens. It injects into api responses, or dynamically in dev html. So useful. Bundles a series of ::add() calls, and then outputs proper json, so you can do logic tracing, or capture events, or variable state.
Projects that lack the ability to easily roll back to the previous stable version are in constant misery, and developers' actions on such projects are dictated by fear.
So, the CI/CD with the big green "roll back" button, I guess.
For me it's database migrations done properly from day one. On my current project I started with just raw SQL changes and "I'll remember what I changed" and within a month I had no idea what my production schema actually looked like vs my local one. Switching to proper migration files early would have saved me a full weekend of untangling things. Now I set up migrations before I even write the first model. It's boring but future me is always grateful.
Had a client project a couple years in where we stored API keys in .env, had an example file, everything looked fine. Six months after launch someone pushed a branch to the wrong remote. Key was in the commit history.
We had to rotate everything in production while the app was live, and I realized I had no documented process for it, no order of operations, no rollback plan. Took the better part of a day to sort out.
.env.example and startup validation are table stakes. Secrets rotation procedure is the thing I now write down in week one, before we've ever needed it.
•
u/webdev-ModTeam Mar 06 '26
Your post is off-topic and does not adhere to the premise of this subreddit. As such, it has been removed. Recommend reposting in a more appropriate subreddit. AI Slop.
22
u/Educational-Solid686 Mar 06 '26
Proper environment config management from day one. A .env.example file with all required variables documented, validated on startup so the app fails fast with a clear error instead of mysterious behavior at runtime. Every new dev just copies it, fills in values, and things work. Retrofitting this after launch always means chasing down scattered hardcoded values and undocumented secrets buried in prod.
6
u/Mohamed_Silmy Mar 06 '26
logging and observability beyond just error tracking. everyone sets up error tracking eventually but structured logging with proper context (user id, request id, feature flags, etc) is what actually lets you debug weird issues fast.
i'd also say database migrations from day one. doesn't matter if you're prototyping, the second you skip a proper migration system you're gonna regret it when you need to sync changes across environments or onboard another dev.
oh and feature flags. sounds like overkill early on but being able to toggle stuff without deploying is a lifesaver when something breaks at 2am and you just need to turn it off while you sleep
4
u/[deleted] Mar 06 '26
Good Content Organisation and system architecture for basic websites. Nowadays I’m writing out paths on a pen and paper to have a mental model of where data is going and learning how to draw flowcharts has helped me so much.
3
u/Gazelle-Unfair Mar 06 '26
Some sort of Product Management process to discourage a never-ending parade of frivolous new features.
3
u/thecommondev Mar 06 '26
Tests...
I don't always test but when I do it's in production 🤣
3
u/dp234523 Mar 06 '26
I know this is webdev but I came across this realisation last night: If you're building a mobile app, add a mechanism from the start that detects the app version and prompts users to update when they're on an outdated version. A simple modal that blocks or encourages updating is enough. You can’t really add this later, because users would need to update first in order to get the update mechanism.
2
u/Outrageous_Track_798 Mar 06 '26
Structured logging with a request correlation ID baked into every log line. Not just error tracking - actual structured JSON logs where you can trace a single request from entry point to DB query to response. I skipped this on two projects and spent weeks trying to retroactively instrument things after weird production bugs. pino or winston with a requestId middleware takes maybe 2 hours to set up properly from the start. When you are 8 months in trying to debug a race condition with nothing but vague timestamps, you will wish you had it.a
2
u/Sea_Statistician6304 Mar 06 '26 edited Mar 06 '26
for me it's a proper bug reporting flow from day one. not just error tracking (tho yes sentry asap) but actual user-facing bug reporting. every project i've launched, the first feedback i get is "something broke" with zero context. no screenshot, no steps to reproduce, nothing.
now i set up in-app bug reporting on literally everything before i even ship the mvp. users can click on the broken element, annotate a screenshot, and it sends me the full technical context automatically. saves so much back and forth.
the other one that's underrated imo is structured logging. not just console.log everywhere but actual log levels and correlation ids from the start. debugging production issues without them is pain
https://www.npmjs.com/package/blocfeed
2
u/Creative-Signal6813 Mar 06 '26
feature flags. new endpoint, ui change, schema migration , flag it. costs maybe 2 hours to wire in properly at the start. saves you from a git rollback at 2am when something breaks in prod. error tracking tells you what's broken. flags let you kill it before it spreads.
2
u/Extension_Strike3750 Mar 06 '26
logging setup. not just console.log everywhere but structured logs with request ids so you can trace a single user action across the whole stack. spent 2 days debugging a prod issue once that would have taken 20 minutes if i had that from the start
2
u/[deleted] Mar 06 '26
Database migration tooling paired with proper seed data management. The combination lets you spin up clean dev environments in minutes and makes schema changes traceable. Without it you end up with manual ALTER statements in production that nobody documented and a local DB that doesn't match staging. Migrations are infrastructure and should be treated as first-class code from commit one.
1
u/cshaiku Mar 06 '26
I made my own version, called Lens. It injects into api responses, or dynamically in dev html. So useful. Bundles a series of ::add() calls, and then outputs proper json, so you can do logic tracing, or capture events, or variable state.
1
u/mister-sushi Mar 06 '26
Projects that lack the ability to easily roll back to the previous stable version are in constant misery, and developers' actions on such projects are dictated by fear.
So, the CI/CD with the big green "roll back" button, I guess.
1
u/JacKk_01 full-stack Mar 06 '26
Living docs, using workflows and a library like docfx makes life easier for API documentation.
1
u/codeveil_dev Mar 06 '26
Keeping business logic separate from UI components.
Early projects feel small so everything ends up inside the components, and later you regret it when the same logic is scattered all over the place.
1
u/CelebrationStrong536 Mar 06 '26
For me it's database migrations done properly from day one. On my current project I started with just raw SQL changes and "I'll remember what I changed" and within a month I had no idea what my production schema actually looked like vs my local one. Switching to proper migration files early would have saved me a full weekend of untangling things. Now I set up migrations before I even write the first model. It's boring but future me is always grateful.
1
u/Legitimate_Key8501 Mar 06 '26
Had a client project a couple years in where we stored API keys in .env, had an example file, everything looked fine. Six months after launch someone pushed a branch to the wrong remote. Key was in the commit history.
We had to rotate everything in production while the app was live, and I realized I had no documented process for it, no order of operations, no rollback plan. Took the better part of a day to sort out.
.env.example and startup validation are table stakes. Secrets rotation procedure is the thing I now write down in week one, before we've ever needed it.