An open API service indexing awesome lists of open source software.

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

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/)