Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Consider using uncle bob's clean architecture for Api #116

Closed
imVinayPandya opened this issue Oct 21, 2019 · 6 comments
Closed

Consider using uncle bob's clean architecture for Api #116

imVinayPandya opened this issue Oct 21, 2019 · 6 comments
Labels
Discussion Ideas, feature requests, views on features. Anything which is a discussion.

Comments

@imVinayPandya
Copy link

imVinayPandya commented Oct 21, 2019

Hello there

I am happy that freeCodeCamp has taken this initiative, and i am very glad to contribute in this awesome project. Recently i have come across "uncle bob's clean architecture". I found it very developer friendly and it will help to use TDD (Test Driven Development) process. I am curious that, what kind of Api architecture we will be using in this project?

I am suggesting "uncle bob's clean architecture" for chapter.

Here is video it will give you an idea about this "clear architecture" https://www.youtube.com/watch?v=CnailTcJV_U

@allella
Copy link
Contributor

allella commented Oct 21, 2019

@imVinayPandya the API documentation is being generated by swagger and can be viewed at
https://github.com/freeCodeCamp/chapter/blob/master/api/swagger.json

That came out of #46.

If you'd like to review the current API and make suggestions then #47 and #17 are higher level issues where you might get more attention if offering specific frameworks, tools, or suggestions that help to enforce a clean architecture.

@imVinayPandya imVinayPandya mentioned this issue Oct 22, 2019
7 tasks
@vkWeb vkWeb added the Discussion Ideas, feature requests, views on features. Anything which is a discussion. label Oct 24, 2019
@allella
Copy link
Contributor

allella commented Oct 25, 2019

@imVinayPandya the tech stack is still being tweaked, but the core elements are defined in the README.

Can you provide information in if any of the frameworks being used are significantly lacking in any of the "clean architecture" facets?

Just skipping through the video I got the impression a lot of the suggestion are based around depencency injection and not coupling dependencies and logic. I suspect most modern frameworks, particularly those which allow for testing, have at least the basics covered in this regard.

@allella
Copy link
Contributor

allella commented Nov 14, 2019

@imVinayPandya unless we see specific suggestions then I don't see keeping this issue open.

Are there issues with the current tools which don't follow Uncle Bob's clean architecture? These are popular JS frameworks and tools, so it would seem a lot of best practices would be baked in.

Data Layer -> Postgres w/ Sequelize ORM on top
Frontend -> React or NextJS (comes with NodeJS server API layer option - we can choose to use it or ignore it and use a different ExpressJS backend)
Backend -> Node.js w/ ExpressJS with Swagger for API documentation and (possibly) API contracts

@imVinayPandya
Copy link
Author

Sorry for late reply @allella

The main goal to use uncle bob's architecture is, writing business logic which is not coupled, use node modules/dependencies in a way which is also not coupled(in future easy to replace with other module), put each and every business logic in separate file and write unit and integration testing (which you have already mentioned).

TL;DR Write future proof code.

For example: If we are considering to use Express.js framework, so framework it self does not suggest or provide coding architecture, that developer need to handle it.

Here is github code from that video https://github.com/dev-mastery/comments-api. i just wanted you to look into their code management along with folder and file structure. I hope it will give you a more idea about this architecture.

Bonus Node.js best practice guide https://github.com/goldbergyoni/nodebestpractices

@allella
Copy link
Contributor

allella commented Nov 15, 2019

@imVinayPandya can you commit to following the related code and suggesting these best practices as the project develops?

I'm afraid reminding people to "use best practices" or "build a secure site" is too general for action and someone will need to be looking out for these concerns on an ongoing basis.

I'm not a JS developer so I don't feel I'll be able to properly ensure these best practices are followed, so we could use the help of someone like you with more experience and a passion for making sure the code is written with Uncle Bob's suggestions in mind.

@QuincyLarson
Copy link
Contributor

@imVinayPandya Thanks for your suggestions, @imVinayPandya. If you have more specific suggestions, I invite you to open more granular issues about this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Discussion Ideas, feature requests, views on features. Anything which is a discussion.
Projects
None yet
Development

No branches or pull requests

4 participants