Closed henilp105 closed 1 year ago
This PR sets up all the user login crud functions and the docker container with flask , nginx and mongodb.
Thanks and Regards, Henil
CC @awvwgk @fortran-lang/admins @fortran-lang/fpm @arteevraina @minhqdao @perazz
I have also added search , upload package , user main home page in this PR.
Thanks for the review and Sure sir, I have patched the login and signup templates. @everythingfunctional
Thanks, @henilp105. A few suggestions for the route layout:
/signup
, /login
, /logout
, /reset-password
, /forgotpassword
): Consider putting them under /auth/*
root, i.e. /auth/signup
, /auth/login
, etc. It will make a more readable API./forgotpassword
-> /forgot-password
for consistency with /reset-password
./<username>/*
-> /users/<username>/*
. More RESTful and avoid clashes with top-level routes (if any).GET:/search/<query>
to be GET:/packages
where different query parameters allow you to search for a subset of packages. GET:/packages
without query parameters should return all packages in the registry.POST:/<username>/upload
for uploading a package, POST:/packages
is more restful and seems more natural to me.In summary, something like this:
/auth
:
GET,POST:/auth/login
GET,POST:/auth/signup
POST:/auth/logout
POST:/auth/forgot-password
POST:/auth/reset-password
/users
:
GET:/users
GET:/users/<username>
/packages
:
GET:/packages
: Get all packagesGET:/packages?query=<query-string>
: Filter packages by query stringGET:/packages/<package-id>
: Get a specific packagePOST:/packages
: Create a new packagePUT:/packages/<package-id>
: Update/edit an existing packageSome of these endpoints may be out of scope for this PR.
Thanks alot for the review, I will surely patch suggestions. @milancurcic
@arteevraina sure, I will be integrating the suggestions into the issues soon.
@milancurcic I could not get the use of
GET:/users
, we already have GET:/users/<username>
, we would not want to show the name/details of all the users in a registry, it would be both computationally intensive and privacy concerning, have I misunderstood the use/significance of this route. GET:/packages
, we would not want to show all the packages in the registry at once, it would be computationally intensive, may be we could rate limit it to some n packages at once.I had also been considering we should have some labels like trending packages, new releases section on /
route.GET
request for the users
route does make sense.For both routes, it definitely makes sense to paginate them, as you are correct, you don't want to be querying and sending the whole set of either. The behavior and queries for the pagination are pretty common, so should be easy to find in tutorials and docs. It usually makes sense to include query parameters in the URL like /users?page=3&sorted_by=joined&search_string=somebody
This PR sets up all the user login crud functions and the docker container with flask , nginx and mongodb.
Thanks and Regards, Henil
CC @awvwgk @fortran-lang/admins @fortran-lang/fpm