1 unstable release
0.1.0 | Apr 17, 2023 |
---|
#66 in #chatgpt
15KB
Create ChatGPT App
Create ChatGPT apps with Rust and Rocket.
Create ChatGPT App works on macOS, Windows, and Linux.
If something doesn’t work, please file an issue.
If you have questions or need help, please ask in GitHub Discussions.
Quick Overview
cargo install create-chatgpt-app
create-chatgpt-app my-app
cd my-app
cargo run
Then open http://localhost:8000/ to see your app.
When you’re ready to deploy to production, create a release build with cargo build --release
.
Get Started Immediately
You don’t need to install or configure tools like Rocket or ChatGPT API.
They are preconfigured and hidden so that you can focus on the code.
Create a project, and you’re good to go.
Creating an App
You’ll need to have Rust and Cargo installed on your local development machine. We recommend using the latest stable version. You can use rustup to manage Rust versions.
To create a new app, follow these steps:
cargo install create-chatgpt-app
create-chatgpt-app my-app
It will create a directory called my-app
inside the current folder.
Inside that directory, it will generate the initial project structure:
my-app
├── README.md
├── Cargo.toml
├── src
│ ├── main.rs
│ ├── chatgpt.rs
└── templates
└── index.html.hbs
No configuration or complicated folder structures, only the files you need to build your app.
Once the installation is done, you can open your project folder:
cd my-app
Inside the newly created project, you can run some built-in commands:
cargo run
Runs the app in development mode.
Open http://localhost:8000 to view it in the browser.
The page will automatically reload if you make changes to the code.
You will see the build errors and lint warnings in the console.
cargo build --release
Builds the app for production to the target/release folder.
It correctly optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed.
Contributing
Contributions are welcome! If you'd like to improve Create ChatGPT App or suggest new features, please submit a pull request or create an issue. More information on contributing to the project can be found in the contributing guidelines.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Dependencies
~9–22MB
~343K SLoC