run-llama / create-llama

The easiest way to get started with LlamaIndex
MIT License
1.05k stars 135 forks source link

Simplify FastAPI fullstack template by include frontend code and a build script #423

Closed leehuwuj closed 2 days ago

leehuwuj commented 1 week ago

Summary by CodeRabbit

Release Notes

coderabbitai[bot] commented 1 week ago

Walkthrough

The pull request introduces significant changes to the application setup process, particularly in how ports are referenced and the installation logic is executed. The externalPort parameter has been renamed to port, affecting multiple files. The backend installation is now always executed, while frontend installation is conditional based on the framework. Test files have been updated to reflect these changes, simplifying conditions for executing tests. Additionally, several utility functions and middleware have been added or modified to enhance the application's functionality and error handling.

Changes

File Change Summary
create-app.ts Renamed externalPort to port. Simplified backend installation logic and adjusted frontend directory creation. Removed commented-out README copy code.
e2e/shared/multiagent_template.spec.ts Updated appType assignment and modified conditions for skipping tests based on templateFramework.
e2e/shared/streaming_template.spec.ts Changed appType assignment and removed externalPort. Updated skip conditions for tests based on templateFramework.
e2e/utils.ts Made externalPort optional in RunCreateLlamaOptions. Simplified application start waiting logic to use only port.
helpers/devcontainer.ts Simplified renderDevcontainerContent logic by removing frontend parameter and streamlining command settings.
helpers/env-variables.ts Renamed externalPort to port in createBackendEnvFile function.
helpers/run-app.ts Updated return type of createProcess to Promise<void>, simplified runReflexApp and runApp functions for better error handling.
helpers/types.ts Renamed externalPort to port in InstallTemplateArgs.
helpers/typescript.ts Updated conditional logic for installing TypeScript dependencies.
index.ts Removed --external-port option; updated usage of --port. Refined handling of data sources.
questions/questions.ts Simplified framework selection logic in askProQuestions.
templates/types/streaming/fastapi/README-template.md Updated instructions for running the development server and production commands.
templates/types/streaming/fastapi/gitignore Added static/ directory to .gitignore.
templates/types/streaming/fastapi/main.py Modified middleware setup and static file mounting logic based on environment.
templates/types/streaming/fastapi/pyproject.toml Added new scripts for dev, prod, and build; added rich dependency.
templates/types/streaming/fastapi/run.py Introduced functions for managing frontend and backend servers, enhancing error handling.
e2e/python/resolve_dependencies.spec.ts Removed externalPort from options in tests.
e2e/shared/extractor_template.spec.ts Renamed frontendPort and backendPort to appPort. Removed externalPort from function call.
e2e/typescript/resolve_dependencies.spec.ts Removed externalPort from runCreateLlama function call.
questions/types.ts Modified QuestionResults type to include externalPort.
.changeset/popular-dryers-check.md Introduced a patch for improving deployment workflow for Python templates.
templates/types/streaming/fastapi/app/middlewares/frontend.py Added FrontendProxyMiddleware class for proxying requests to a frontend server.
templates/components/agents/python/blog/README-template.md Updated commands for running development and production servers.
templates/components/agents/python/financial_report/README-template.md Updated commands for running development and production servers.
templates/components/agents/python/form_filling/README-template.md Updated commands for running development and production servers.
templates/types/streaming/fastapi/app/config.py Added STATIC_DIR constant for dynamic static directory configuration.
templates/.gitignore Deleted .gitignore, removing entries for ignored files.
templates/README-fullstack.md Deleted README for fullstack project setup.

Possibly related PRs

Suggested reviewers

Poem

In the meadow, changes bloom,
Ports renamed, dispelling gloom.
With each line, the code does dance,
Simplified paths, a developer's chance.
From backend calls to frontend cheer,
A brighter setup, drawing near! 🐇✨


📜 Recent review details **Configuration used: .coderabbit.yaml** **Review profile: CHILL**
📥 Commits Reviewing files that changed from the base of the PR and between ae45d601aa54cbe02e6ca8a1b7c5db391796e79d and 8079ba4b45c1bb58891c1a8da77fe2411cf0671d.
📒 Files selected for processing (2) * `templates/.gitignore` (0 hunks) * `templates/README-fullstack.md` (0 hunks)
💤 Files with no reviewable changes (2) * templates/.gitignore * templates/README-fullstack.md

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
🪧 Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit , please review it.` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (Invoked using PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. ### Other keywords and placeholders - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. - Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description. - Add `@coderabbitai` anywhere in the PR title to generate the title automatically. ### Documentation and Community - Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit. - Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
changeset-bot[bot] commented 1 week ago

🦋 Changeset detected

Latest commit: 8079ba4b45c1bb58891c1a8da77fe2411cf0671d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------------ | ----- | | create-llama | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

keesvanbemmel commented 19 hours ago

Is there a reason the pro option to generate a nextjs frontend when choosing express framework backend has been removed?

marcusschiesser commented 11 hours ago

yes, it simplifies the code generator, you can still generate one nextjs frontend and one express backend separately