💬 Um app de chat em React Native com integração com ChatGPT usando SSE (Server-Sent Events), proporcionando respostas em tempo real.
- Interface simples de chat
- Streaming de resposta com SSE (Server Sent Events)
- Integração com a OpenAI API
- Pronto para personalizações e testes
react.native.3.webm
Para rodar este projeto, siga os seguintes passos:
git clone https://github.com/macielrsf/react-native-gpt
cd react-native-gpt
yarn install
Crie um arquivo .env na raiz do projeto.
No arquivo .env, adicione sua chave da OpenAI API com o seguinte formato:
OPENAI_API_KEY=your-api-key-here
Você pode obter sua chave da API da OpenAI em https://platform.openai.com/signup.
Agora, você pode rodar o projeto com:
yarn start
Isso abrirá o Expo Dev Tools no navegador. A partir dele, você pode:
Escanear o QR Code com o aplicativo Expo Go no seu celular (disponível na App Store e Google Play).
Executar no simulador:
Pressione i para abrir no simulador iOS (apenas no macOS com Xcode instalado)
Pressione a para abrir no emulador Android (requer Android Studio configurado)
Dica: também é possível rodar yarn android ou yarn ios diretamente, se preferir abrir o app emulador via terminal.
Este projeto está sob a licença MIT. Veja o arquivo LICENSE para mais detalhes.
💬 A React Native chat app with ChatGPT integration using SSE (Server-Sent Events), providing real-time responses.
- Simple chat interface
- Response streaming with SSE (Server Sent Events)
- Integration with OpenAI API
- Ready for customizations and testing
react.native.3.webm
To run this project, follow these steps:
git clone https://github.com/macielrsf/react-native-gpt
cd react-native-gpt
yarn install
Create a .env file in the root of the project.
In the .env file, add your OpenAI API key with the following format:
OPENAI_API_KEY=your-api-key-here
You can get your OpenAI API key at https://platform.openai.com/signup.
Now, you can run the project with:
yarn start
This will open Expo Dev Tools in the browser. From there, you can:
Scan the QR Code with the Expo Go app on your phone (available on the App Store and Google Play).
Run in the simulator:
Press i to open in the iOS simulator (only on macOS with Xcode installed)
Press a to open in the Android emulator (requires Android Studio configured)
Tip: You can also run yarn android or yarn ios directly, if you prefer to open the emulator app via terminal.
This project is under the MIT license. See the LICENSE file for more details.