hummingbird-project / hummingbird

Lightweight, flexible HTTP server framework written in Swift
Apache License 2.0
1.13k stars 53 forks source link

Onboarding wizard feedback #578

Open trevor-e opened 3 days ago

trevor-e commented 3 days ago

Hey, been following along and am excited for this project. I gave it a spin on and had some feedback for the onboarding/new project process, figured it made sense to group it all here.

  1. Compared to other frameworks, it was a bit unexpected that we clone a template repo, run a command, and then it spits out a new sub-repo. It took me a second to realize what was happening. I figure there are eventual plans to do this fully within a CLI, just wanted to point out my confusion.
  2. Enter your package name: package name is such an overloaded term I thought it was asking for a bundle ID. Maybe it could be phrased as "Swift Package name" to be unambiguous.
  3. Some of the console output seemed distracting, like it just printed out ~/dev/hummingbird-template a few times.
  4. It would be great if the console output used colors to separate some of the information.
  5. Enter the folder created and run 'swift run' to build and run your server. coupled with my confusion earlier about how this creates a sub-directory with the scaffolded project, I was thinking "what folder"? Could it explicitly tell me which folder to open?
  6. Then open 'localhost:8080' on your web browser. I don't think the CLI needs to say this since swift run already outputs this too.
  7. When I run swift run it actually outputs [HummingbirdCore] Server started and listening on 127.0.0.1:8080, it would be nice if it said localhost:8080 for consistency. VSCode also seems to stumble trying to CMD+click opening 127.0.0.1:8080 into the browser so it would probably work better with localhost like other frameworks use.

Other than that everything worked! Excited to follow along.

adam-fowler commented 3 days ago

Hey, been following along and am excited for this project. I gave it a spin on and had some feedback for the onboarding/new project process, figured it made sense to group it all here.

  1. Compared to other frameworks, it was a bit unexpected that we clone a template repo, run a command, and then it spits out a new sub-repo. It took me a second to realize what was happening. I figure there are eventual plans to do this fully within a CLI, just wanted to point out my confusion.

If you run the configure.sh command without any parameters it should edit the template in place. I have to play with this a little to get it right.

  1. Enter your package name: package name is such an overloaded term I thought it was asking for a bundle ID. Maybe it could be phrased as "Swift Package name" to be unambiguous.

Fair point

  1. Some of the console output seemed distracting, like it just printed out ~/dev/hummingbird-template a few times.

Yes this could be cleaned up

  1. It would be great if the console output used colors to separate some of the information.

👍

  1. Enter the folder created and run 'swift run' to build and run your server. coupled with my confusion earlier about how this creates a sub-directory with the scaffolded project, I was thinking "what folder"? Could it explicitly tell me which folder to open?

👍

  1. Then open 'localhost:8080' on your web browser. I don't think the CLI needs to say this since swift run already outputs this too.

The two addresses being printed out are different addresses. When I say open localhost:8080 that is the address your web client should open as that is where the server is running.

The address being printed out when you run the server is the address the server is listening on. Because you are running both client and server on the same machine they happen to be the same. But the server could also be listening on 0.0.0.0:8080, which indicates it will accept clients from any address.

  1. When I run swift run it actually outputs [HummingbirdCore] Server started and listening on 127.0.0.1:8080, it would be nice if it said localhost:8080 for consistency. VSCode also seems to stumble trying to CMD+click opening 127.0.0.1:8080 into the browser so it would probably work better with localhost like other frameworks use.

Using a host name for your listen address has performance impacts and should not be encouraged.

Other than that everything worked! Excited to follow along.

Thank you for taking your time to put your thoughts down. Hopefully we can get this right over time.

trevor-e commented 2 days ago

1: You're right, looking through my shell history I aborted the first configure and then tried again by adding the package name but can't remember why. 😅

6: I think at least formatting the address as http://localhost:8080 will make it CMD+Clickable in the terminal.

7: That makes sense. In my head I was comparing against Ktor which outputs:

2024-10-03 10:15:30.034 [main] INFO  Application - Application started in 0.329 seconds.
2024-10-03 10:15:30.139 [main] INFO  Application - Responding at http://localhost:8080

Thank you for taking your time to put your thoughts down. Hopefully we can get this right over time.

No problem! If you turn any of these suggestions into Issues I'm happy to take a stab at some of them while I play around with this some more.