How to Handle Live Project without Any Conflicts
Personally, in my first years, I faced many problems when I maintain the live project because it is in production and my team doesn't know how to avoid this. so I give 8 tips here.
1. Maintain code with a version control system with many Branches 2. Split Environment Settings in Application 3. Implement Error Tracking Tools 4. Write Documentation top on your code 5. Don't be Debug in Production and Don't change Current Code Responses Parameters and Data Types. 6. Write Test Cases to Routine Checkup. 7. Implement Code Analysis Libraries. 8. Check Common Security Issues
1. Maintain code with a version control system with many Branches
Version Control System is Developers Frist Choice to Avoid the Conflicts and Risks in the Team.
We Can simply manage to Split our code with Different Branches like Dev, Test, Stage, and Main(Master). so each branch gives advantages to Developers like Developers work on Dev-Branch, Testers do work test branch, and final the Checkup on Stage Branch. if all work fine, then just merge stage to master. so it avoids conflicts when the project in live.
2. Split Environment Settings in Application
And the Second Choice is Split Environment Settings. Generally, it is in application-level modifications. you can simply write environment variables in each environment. so what are environment variables..!! it just projects settings like database details, storage location details, domain access details, and security settings details.
suppose if you work on dev branch use local database settings, and if it is run staging then give database with specific DB details with remote URL, Likewise in the production also same. in each environment, we can give different databases. so it can avoid the problem when we doing on work. suppose if you use buckets, then maintain 4 buckets, or generate dev, test, stage, prod folders in a single bucket.
**NOTE** If you work on a microservices architecture application give environment variables in the system level / Container level. (or ) if you work on a monolithic architecture give it on application level like `dotenv (.env)` etc.
3. Implement Error Tracking Tools
Error Tracking Tools are really very helpful when we maintain projects live. when a specific error raises at a time to the user, then it can alert the developer where the is error raise in our code. so we can easily fix that. Generally, we can face 4xx, 5xx errors at the application level. many error tracking tools available in the current market like Sentry, Aws x-ray, LogRocket, Crashlytics. etc. Personally, I love Sentry to my python, Node.js, Golang apps. this will help when we work on live projects.
4. Write Documentation top on your code
In the project, different developers work in a single codebase. so write applied logics, to-do list notes, and parameter usage, etc in the code comments. it can help when we do teamwork.
if you work alone on the project..don't write anything. it is time-waste..just put in simple comments.
So Basically A Good Documentation will help Developers. Suppose if you Developing RESTApi endpoints then make documentation in postman, swagger, etc. or if you work open-source / Cross-Platform apps then write in markdown files. or if you are lazy, then use third party tools to generate documents like sphinx, mkdocs etc.
5. Don't be Debug in Production and Don't change Current Code Responses Parameters and Data Types.
Most Developers hate the Debug Messages in Production. Because it is really hard to debug in production and risky too. And the security Breaches will happen when we debug in production. So don't debug in production
(unlike if you're a PHP developer, you don't have any alternatives to do this )
So Debug the application in stage level, create the same scenario of production in staging/dev and debug it. after debug, fix the problem and test both two branches, later push into prod branch. if it is at the database level then note SQL queries /use ORM.
And Don't Change Current Responses when you maintain cross-platform apps like desktop and mobile. if you change that, the end side application will down automatically.
6. Write Test Cases to Routine Checkup.
Generally, Developers Don't interest write the test cases but when the testing completed they can take more time to fix the issues. Yes, My Boss Shouted many times when I do silly mistakes (
I am not perfect. I do silly mistakes every day). so when you develop a service just write simple test cases to your side like email working or not, pus notifications working or not, all get requests working or not, any file validations violate the code, uploading/exporting working or not, etc. write test case in each condition with unit tests
like if case A -> return something, if case B -> Return Something, etc. So Test Cases avoid the Conflicts when we maintain on live.
7. Implement Code Analysis Libraries.
Code Analysis Libraries will help improve the quality of code, validate common code style rules, and analyze the mistakes in code, etc. these tools also help write the clean code in your selected language I am a python developer so I am using pylint, pyflakes libraries, etc. so these tools avoid the common mistakes in our code when we maintain on live. Gene
8. Check Common Security Issues
When you maintain the project on live, please check common security issues like Specific user roles permissions, CSRF validations, middleware settings, Media Files protection, Handle Announous requests, etc. so when we avoid common security problems it can improve the project stability. and one more important is don't print messages with data.