1212import rignore
1313import typer
1414from httpx import Client
15- from pydantic import BaseModel
15+ from pydantic import BaseModel , EmailStr , TypeAdapter
1616from rich .text import Text
1717from rich_toolkit import RichToolkit
1818from rich_toolkit .menu import Option
@@ -385,6 +385,60 @@ def _setup_environment_variables(toolkit: RichToolkit, app_id: str) -> None:
385385 progress .log ("Environment variables set up successfully!" )
386386
387387
388+ def _waitlist_form (toolkit : RichToolkit ) -> None :
389+ from rich_toolkit .form import Form
390+
391+ toolkit .print (
392+ "We're currently in private beta. If you want to be notified when we launch, please fill out the form below." ,
393+ tag = "waitlist" ,
394+ )
395+
396+ toolkit .print_line ()
397+
398+ email = toolkit .input (
399+ "Enter your email:" ,
400+ required = True ,
401+ validator = TypeAdapter (EmailStr ),
402+ )
403+
404+ toolkit .print_line ()
405+
406+ if toolkit .confirm (
407+ "Do you want to get access faster by giving us more information?" ,
408+ tag = " 🚀 " ,
409+ ):
410+ toolkit .print_line ()
411+ form = Form ("Waitlist form" , style = toolkit .style )
412+
413+ form .add_input ("name" , label = "Name" , placeholder = "John Doe" )
414+ form .add_input ("organization" , label = "Organization" , placeholder = "Acme Inc." )
415+ form .add_input ("team" , label = "Team" , placeholder = "Team A" )
416+ form .add_input ("role" , label = "Role" , placeholder = "Developer" )
417+ form .add_input ("location" , label = "Location" , placeholder = "San Francisco" )
418+ form .add_input (
419+ "how_do_you_plan_to_use_fastapi_cloud" ,
420+ label = "How do you plan to use FastAPI Cloud?" ,
421+ placeholder = "I'm building a web app" ,
422+ )
423+ form .add_input ("secret_code" , label = "Secret code" , placeholder = "123456" )
424+
425+ result = form .run ()
426+
427+ toolkit .print_line ()
428+
429+ # fake timer
430+ with toolkit .progress ("Sending your request..." ):
431+ time .sleep (2 )
432+
433+ import os
434+
435+ os .system ("open raycast://confetti" )
436+
437+ toolkit .print_line ()
438+
439+ toolkit .print ("Thank you for your interest in FastAPI Cloud! 🚀" )
440+
441+
388442def deploy (
389443 path : Annotated [
390444 Union [Path , None ],
@@ -401,17 +455,14 @@ def deploy(
401455 """
402456
403457 with get_rich_toolkit () as toolkit :
404- toolkit .print_title ("Starting deployment" , tag = "FastAPI" )
405- toolkit .print_line ()
406-
407458 if not is_logged_in ():
408- toolkit .print (
409- "No credentials found. Use [blue]`fastapi login`[/] to login." ,
410- tag = "auth" ,
411- )
459+ _waitlist_form (toolkit )
412460
413461 raise typer .Exit (1 )
414462
463+ toolkit .print_title ("Starting deployment" , tag = "FastAPI" )
464+ toolkit .print_line ()
465+
415466 path_to_deploy = path or Path .cwd ()
416467
417468 app_config = get_app_config (path_to_deploy )
0 commit comments