Skip to content

Commit 5dfe8eb

Browse files
authored
update(Internals): Move post generate success message (#75)
1 parent eef005b commit 5dfe8eb

2 files changed

Lines changed: 20 additions & 18 deletions

File tree

fastapi_forge/__main__.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -129,23 +129,6 @@ def start(
129129

130130
init(project_spec=project_spec, no_ui=no_ui, dry_run=dry_run)
131131

132-
click.secho("\n🎉 Project generated successfully!", fg="green", bold=True)
133-
click.echo("\n🚀 Next steps to get started:\n")
134-
135-
steps = [
136-
("Navigate to your project directory", "cd your_project_name"),
137-
("Start the development environment", "make up # or docker-compose up"),
138-
("(Optional) Run tests", "make test"),
139-
("Access the API documentation", "http://localhost:8000/docs"),
140-
]
141-
142-
for i, (desc, cmd) in enumerate(steps, 1):
143-
click.echo(f"{i}. {desc}:")
144-
click.secho(f" {cmd}", fg="cyan")
145-
146-
click.echo("\n💡 Pro tip: Run 'make help' to see all available commands")
147-
click.secho("\n✨ Happy coding with your new FastAPI project!", fg="magenta")
148-
149132

150133
if __name__ in {"__main__", "__mp_main__"}:
151134
main()

fastapi_forge/core/build.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
from pathlib import Path
33
from time import perf_counter
44

5+
import click
6+
57
from fastapi_forge.logger import logger
68
from fastapi_forge.project_io import ArtifactBuilder, create_fastapi_project_builder
79
from fastapi_forge.schemas import ProjectSpec
@@ -76,7 +78,24 @@ async def build_fastapi_project(
7678
await director.build(spec)
7779

7880
build_time = perf_counter() - start_time
79-
logger.info(f"Project built successfully in {build_time:.2f} seconds.")
81+
logger.info(f"Project build completed in {build_time:.2f} seconds")
82+
83+
click.secho("\n🎉 Project generated successfully !", fg="green", bold=True)
84+
click.echo("\n🚀 Next steps to get started:\n")
85+
86+
steps = [
87+
("Navigate to your project directory", "cd your_project_name"),
88+
("Start the development environment", "make up # or docker-compose up"),
89+
("(Optional) Run tests", "make test"),
90+
("Access the API documentation", "http://localhost:8000/docs"),
91+
]
92+
93+
for i, (desc, cmd) in enumerate(steps, 1):
94+
click.echo(f"{i}. {desc}:")
95+
click.secho(f" {cmd}", fg="cyan")
96+
97+
click.echo("\n💡 Pro tip: Run 'make help' to see all available commands")
98+
click.secho("\n✨ Happy coding with your new FastAPI project!", fg="magenta")
8099

81100
except Exception as error:
82101
logger.error(f"Project build failed: {error}")

0 commit comments

Comments
 (0)