I'm in dire need of some help. My background is from python, js and ruby, with using frameworks to provide good structure.
A potential client has an internal app which does quite a bit of stuff. This means there are multiple functions, and a lot of code. The project is written in php, which I don't have much knowledge about.
They want more features!
The app was written by a former employee. He is unavailable and the code base is not documented. I've started looking at the files, and apart from being structured in different folders, there is a major lack of it.
The code itself mixes SQL-queries, logic and html in the same blocks of code. There are tons long if / else if statements, and as far as I am concerned, noone has ever thought about restructuring and refactoring, it just looks like patches sewn on again, and again, and again. It's all vanilla php. The app is also communicating with a printer. I have not figured out where or how it does that.
This app belongs to a company in growth. And it looks like more companies in the same building will be using it as well.
As I can see it, I have two options.
Lock myself inside a room, get it under version control, and go through every single line of code and try to figure out what it does, till I get to a point where I'm able to refactor and write new, maintainable features on top of it. Hopefully I won't kringe to death.
Write a new app the proper way. Get all specs from the client, and use newer, and better technologies than vanilla php. I'm thinking maybe a MERN-stack for a snappy experience. Maybe write the printer functionality in python, if JS won't cut it.
Because the client wants the ability to scale the app, I believe a full rewrite is the best way to go about this.
In regard of my lacking php skills, I don't think I'll do the job without the rewrite. From my experience reading code in multiple languages, I don't believe anyone else is going to touch this code base either.
Does anyone have any experience with this type of dilemma?