Skip to content
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

Very good desing! appreciate it! #27

Open
UlasSAYGINIM opened this issue Jun 25, 2023 · 10 comments
Open

Very good desing! appreciate it! #27

UlasSAYGINIM opened this issue Jun 25, 2023 · 10 comments

Comments

@UlasSAYGINIM
Copy link

hi,
it is very good desing and implementation of user system api.
i wonder that if we want to add web version, how we can add it?

thank you.

@KPMGE
Copy link
Owner

KPMGE commented Jun 25, 2023

Hi, thank you!

So, if you wanna use this API in a web application, you could call its routes directly.

you can find all of them in the documentation along with instructions on how to execute the API.

lemme know if you got any issues.

@UlasSAYGINIM
Copy link
Author

thank you for response. i just wonder that implementation of web page with html engine render.
to consume api , i need to use javascript or similar technology. but i am looking for implementing web side of clean architecture.
because i like the design of your understanding. folder structure seems more understandable. some people use different folder structure and it is not easy to follow the code. i think clean arch need better understandable folder structure for all people.

@UlasSAYGINIM
Copy link
Author

when i looked the code, you use routeadapter only sends JSON. i couldnt decide which way is better for clean architecture principle to make ports moduler like plugable.

@UlasSAYGINIM
Copy link
Author

because when i look your desing. it seems that another framework like gin or other can be implemented because of clean arch.

@KPMGE
Copy link
Owner

KPMGE commented Jun 26, 2023

Hey. I see your point.

So, indeed switching to another plugin like gin would be easy given the clean arch implemented. In your case, if I got that right, you wanna serve a static page directly, right?

If that's the case, I think you can create some new functions on the presentation layer for serving those pages. Those functions should implement the controller interface. After that, you could create a new adapter that serves the page instead of taking the JSON data.

lemme know if you think that's a good approach.
thank you.

@UlasSAYGINIM
Copy link
Author

UlasSAYGINIM commented Jun 26, 2023

firstly i want to use your structure for gofiber template. in fact i am interested in creating clean architecture login system with privacy like encrypting some information and hashing some others. in order to do that i am trying to understand how can i change your structure or make new files to get web pages for gofiber framework first. my second concern is another person can change this structures to adopt another framework, so we will have open source login system with JWT and cookies. these are things in my mind. first of all , i think i need to change gofiber routes or adding new routes like your routes will be /api/something/id and my web routes will be /singuppage, / loginpage , /forgotpasswordpage etc. i think generating another fiber routes will be ok for web page rendering. maybe sending http response is not ideal. i could not decide yet.

@UlasSAYGINIM
Copy link
Author

you project is wonderful for only api system. not compatible for web page rendering. if we may add it , it can be best clean architecture example

@KPMGE
Copy link
Owner

KPMGE commented Jun 26, 2023

That's quite an interesting use case for this project. Indeed, when I did it I was not concerned with web compatibility, but as you said, creating new routes for serving the web pages could be a solution. As I said, I made an abstraction over a controller. So you could create some structs on the presentation layer that implement that same interface and create an adapter for them. I'll think more about that when I get more time, maybe I'll try to implement it just to see how it goes.

Anyways, thank you for your comments, and lemme know if you get any other ideas.

@UlasSAYGINIM
Copy link
Author

UlasSAYGINIM commented Jun 27, 2023

thank you for information and good comments. i will create something based on your work or structure and i will let you know about updates. you created different controller implementation, making new main implementation is very good idea for me.
and controller has httprequest and response in this case you seperated web framework from main application in very good way. i did not see this kind of seperation. other implementations i saw, you need to change web or api side completely with new implementation but yours it is basic for api. all framework uses common things such as httprequet and response so, changing fraremwork to another web framework easier than others.
see you soon. thank you for cooperation. have a great week.

@UlasSAYGINIM
Copy link
Author

may i ask why you used custom validator for api presentation side. inside of entity section. you used asaskevich/govalidator but in api side you used another custom validation. is there any special reason?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants