New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring backend #627
Comments
@vaibhavsingh97 @ParthS007 @gabru-md what are your views? |
This article provides some nice workflow for modularizing flask app: |
@djmgit I have a proposed plan for the same. We will need to completely re write the codebase in order to ensure proper functioning and flow. |
@gabru-md yes sure |
@djmgit Yes, I agree, I had added the same in my proposal too. We can definitely do this, and make this app modularize. For backend Service we can use PostgreSQL or any other NoSQL database. |
@djmgit You mean creating routers and controllers?? |
routers where the endpoints shall be written and controllers where the specific control for a particular endpoint be there. |
Also I was thinking maybe we can make badgeyay more asynchronous using libs like tornado.Please give me your feedback. |
@vaibhavsingh97 Since at this stage, the size of main.py is not that big, also we do not have models and serializers to deal with right now, do we really need to create a separate branch? Just asking :) I have no problem with creating one. |
@djmgit I totally agree with you and I have proposed somewhat similar to it.
What's your view @djmgit ? |
@ParthS007 we definitely need to rewrite the frontend, as presently the entire frontend code in written in two huge .hbs files. We need to use ember components which is the desired development flow with ember I suppose. We can discuss about frontend in a separate issue. |
@djmgit I don't think that we need to create a new branch as in future it may cause conflicts. |
@gabru-md @vaibhavsingh97 @ParthS007 once this issue is done, that is the backend codebase is refactored, we can go forward with the other important stuff deciding a database, creating an auth system, deciding db schemas required for various APIs etc. |
ok @djmgit 👍 |
ok @djmgit , One Parent issue for both frontend or backend with tasks will be good. |
@djmgit Can I take the issue, I will open sub-issue and claim it. I will help in modularizing the current backend code |
@vaibhavsingh97 I guess (from above comments) @gabru-md has also got some plans for this issue. It would be great if you both could collaborate on this, if possible :) |
Yeah, sure 😊
…On Tue 24 Apr, 2018, 1:30 PM Deepjyoti Mondal, ***@***.***> wrote:
@vaibhavsingh97 <https://github.com/vaibhavsingh97> I guess (from above
comments) @gabru-md <https://github.com/gabru-md> has also got some plans
for this issue. It would be great if you both could collaborate on this, if
possible :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#627 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AITVakkQTZtCDKT1sbkmbbuUFuzDYQJNks5trtuKgaJpZM4TVdIM>
.
|
I would like to send a test PR for the same @djmgit . |
Adds Blueprint Folder. This contains the new Refractored Code seperated into folders like controllers, models and utils. I will send multiple PRs to setup the Blueprint folder. Meanwhile we can add functionality to the current codebase. Cheers!
Please go ahead @gabru-md , great 👍 |
@gabru-md please go ahead |
So @ParthS007 and ME will work on modularising the backend along with refractoring it. By the time other changes are being made to the current API, we will make them stable into the Modularised API and get it working sideways 👍 |
Adds Blueprint Folder. This contains the new Refractored Code seperated into folders like controllers, models and utils. I will send multiple PRs to setup the Blueprint folder. Meanwhile we can add functionality to the current codebase. Cheers!
Count me in too @gabru-md |
can be closed |
<!-- Add the issue number that is fixed by this PR (In the form Fixes #123) --> Fixes #877 #627 #### Checklist - [x] I have read the [Contribution & Best practices Guide](https://blog.fossasia.org/open-source-developer-guide-and-best-practices-at-fossasia) and my PR follows them. - [x] My branch is up-to-date with the Upstream `development` branch. - [x] I have added necessary documentation (if appropriate) ### Preview Link - **Replace XXX with your PR no** - Link to live demo: http://pr-XXX-fossasia-badgeyay.surge.sh #### Changes proposed in this pull request: - Changed Travis Check and Moved API to the backend.
Closing this as we are done with it 👍 |
Presently all the route handlers and app config are presently in a single file : backend/app/main.py. As a result, main.py is already quite big and as more route handlers and other methods will be added, the code will become really hard to maintain owing to the code size. So I guess it is high time now we modularise the APIs.
We can use flask blueprint to distribute the API handlers among different modules. In future when we will be adding models (for database) we can add specific models to corresponding modules rather than keeping all the models in the same place.
Also we can maintain a separate file for config params and then initialise app.config from that file.
This will make the code easy to maintain, also we will be able to reuse stuff.
The text was updated successfully, but these errors were encountered: