tanaypratap / teamtanay.jobchallenge.dev

The web repository for all things #teamtanayjobchallenge
https://2020.teamtanay.jobchallenge.dev
131 stars 429 forks source link

[project] [feedback] [code review] review my project #274

Closed Vishavjeet6 closed 3 years ago

Vishavjeet6 commented 4 years ago

Kindly review my WhatsApp ChatBot to start save the number +1 415 523 8886 and then message "join drop-series". Now you can ask news, movies and do a wiki search GitHub Link - https://github.com/Vishavjeet6/whatsapp-bot

reeversedev commented 4 years ago

Hey @Vishavjeet6 , first of all, kudos to your attempt!

I'd say, you should first improve the readme file on your GitHub for this repository. That will help me and other reviewers to understand the project better and then look at the actual thing happening.

Let me know, if you need any help from my side.

Vishavjeet6 commented 4 years ago

@reeversedev Thanks for the feedback, I have made some changes in README kindly review it.

reeversedev commented 4 years ago

Good job with the Readme. It is super clean.

reeversedev commented 4 years ago

Give me some time, I shall review the application as well. :)

tripsus commented 4 years ago

Hi @Vishavjeet6

Nice work on the chatbot. I like your idea, I haven't tested it yet but plan to test it soon :) Few suggestions.

  1. Can you describe the workflow in little bit more detail. I see that you have list down the components but how do they interaction. A flow chart would be great.
  2. Skimming through the code, I see that you have only on API sms_reply in which internally based on message calls wolfarm, wiki and other api's. In long run it won't be very scalable, please work on refactoring it and for different services.
  3. Coding convention is not consistent I see two major patterns like "fooBar" and "foo_bar", please follow a single convention(preferably second one, as that is python specific convention) it makes it easier to search code when we know method name are written in a single pattern. Check "pyscore"(this give score of the code you have written based on python coding convention, google for more details) of your code.
  4. Some methods are not handling failure scenario's and the ones which are handling are very generic. For example you are using except and not handling particular exception types. It is important because lets say you want to say for user query that no response was found for your query versus there is some intermittent issue with service, since you are using generic catch you will never get to know what kind of failure was it. You should use generic catch but for unexpected error types, known types should be handled explicitly.
  5. DB connection is being created in global context, what if db connection fails in between, we will need a retry logic.
  6. Logging: I see you are using print for logging. Let us add logs to file.

This is a very nice first attempt. Lets work on it to make it better :)

Vishavjeet6 commented 4 years ago

Thanks for detailed feedback I will make changes