https://github.com/martishin/speechpal-server
Server code for speechpal.co, responsible the telegram bot and report functionalities
https://github.com/martishin/speechpal-server
arrow-kt flyway jooq kotlin kotlin-coroutines mongodb postgresql r2dbc spring-boot spring-webflux telegram-bot
Last synced: 10 months ago
JSON representation
Server code for speechpal.co, responsible the telegram bot and report functionalities
- Host: GitHub
- URL: https://github.com/martishin/speechpal-server
- Owner: martishin
- Created: 2023-06-24T22:12:29.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-25T13:02:17.000Z (over 2 years ago)
- Last Synced: 2025-09-06T01:33:36.098Z (10 months ago)
- Topics: arrow-kt, flyway, jooq, kotlin, kotlin-coroutines, mongodb, postgresql, r2dbc, spring-boot, spring-webflux, telegram-bot
- Language: Kotlin
- Homepage: https://speechpal.co/
- Size: 277 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SpeechPal Server
This repository hosts the backend code for the [SpeechPal](https://www.speechpal.co/) service, responsible the telegram bot and report functionalities.
## 📌 Features
- **Telegram Bot**: Interact with the SpeechPal service directly through Telegram. Check the bot [here](https://t.me/SpeechPalBot).
- **Reports**: Access comprehensive reports about speech analysis. See a [sample report](https://www.speechpal.co/reports/AgAEOQAC0ZJASw).
## 🚀 Running Locally
### Prerequisites
1. **Telegram Bot Token**: Obtain a token for your Telegram bot. See the [instructions](https://help.openai.com/en/articles/4936850-where-do-i-find-my-secret-api-key).
2. **OpenAI API Key**: You'll need this key to access OpenAI functionalities. [Here's how](https://help.openai.com/en/articles/4936850-where-do-i-find-my-secret-api-key) to get it.
3. **Databases**: Make sure you have PostgreSQL and MongoDB running locally. You can use Docker or any other method to start these services.
### Starting the server
1. In the root of the project, create a `.env` file with the following content:
```
export BOT_TOKEN={YOUR_BOT_TOKEN}
export OPENAI_API_KEY={YOUR_OPENAI_API_KEY}
export OPENAI_ORG={YOUR_OPENAI_ORG}
export MONGO_DB_CONNECTION={YOUR_MONGO_DB_CONNECTION}
export MONGO_DB_DATABASE={YOUR_MONGO_DB_DATABASE}
export POSTGRESQL_DB_CONNECTION={YOUR_POSTGRESQL_DB_CONNECTION}
export POSTGRESQL_DB_USERNAME={YOUR_POSTGRESQL_DB_USERNAME}
export POSTGRESQL_DB_PASSWORD={YOUR_POSTGRESQL_DB_PASSWORD}
```
Replace placeholders (like {YOUR_BOT_TOKEN}) with your actual values.
2. Load your environment variables:
`source .env`
3. To start the server, run:
`./gradlew bootRun`
## ⚙️ Technologies Used
- [Kotlin](https://kotlinlang.org/) with [coroutines](https://kotlinlang.org/docs/coroutines-overview.html)
- [Gradle](https://gradle.org/)
- [Spring WebFlux](https://docs.spring.io/spring-framework/reference/web/webflux.html)
- [PostgreSQL](https://www.postgresql.org/)
- [MongoDB](https://www.mongodb.com/)
- [Spring Data R2DBC](https://spring.io/projects/spring-data-r2dbc)
- [Arrow-KT](https://arrow-kt.io/)
- [Flyway](https://flywaydb.org/)
- [Jooq](https://www.jooq.org/)
- [Testcontainers](https://testcontainers.com/)
- [Telegram API client](https://github.com/kotlin-telegram-bot/kotlin-telegram-bot)
- [OpenAI API client](https://github.com/aallam/openai-kotlin)
- [Docker](https://www.docker.com/)
- [Detekt](https://detekt.dev/)
