Hacker News new | ask | show | jobs
by syed123 3298 days ago
Based on the website and code base i have, i just want a rough estimate..are we talking 2 weeks, 2 months or 6 months here to rebuild in a new language? does it provide any advantage that the code was already written and api's work etc in the other language? trying to see if something can be reused or is it gonna be a total build from scatch new website..
1 comments

> does it provide any advantage that the code was already written and api's work etc in the other language

If you build your models to be an exact fit with your current data, yes.

> Based on the website and code base i have, i just want a rough estimate..are we talking 2 weeks, 2 months or 6 months here to rebuild in a new language?

That's like asking a consultant for a time estimate when they don't know all the details. Factors include:

- How much python you know already

- How long does it take for you to grasp the fundamentals of virtual environments, packages, importing, etc.

> trying to see if something can be reused or is it gonna be a total build from scatch new website..

- Good point: If you end up keeping old API's running on the PHP side and just migrating the HTML stuff first, or only. That is a shortcut to get going faster.

- How much templating you have to do. But I think you can do that in maybe (2 Weeks). Django templates are easy to learn and you can extend from a common base.

- Database models. I think you should try the inspectdb thing ASAP as a trial to see how easy it is to display any data from your current schema. Be sure to use a copy (or sample) of your prod data in a separate staging database though. You could do that tonight. Getting everything (relations and all) to map perfectly (ORM -> your current db schema) could take a couple of weeks to get perfect. Use this 'managed = False': https://docs.djangoproject.com/en/1.11/howto/legacy-database...

- Development hosting: I recommend trying out Heroku. The deployment is straight forward. But outside of that you're going to have to wrap your brain around how to deploy it. nginx + uwsgi + supervisor is a common combo if you're doing it right on the server.

- Business logic: Most of this is done inside your views. This could take a month or so.

Since django is a big framework and these things work in tandem, it could be 3-6 months. Remember to build it in parallel so the PHP site can continue to be maintained if needed. And create a staging database that's based off your production schema with some sample data in there.

Also while you do this, you're going to continually get faster as you gain mastery with python.

For a speed boost, you can continue to keep API's running in PHP while you convert other stuff over first.

wow..excellent advice. You made me day and week!!