A Telegram Bot named Samantha, inspired by the film "Her" that leverages Chat-GPT features with OpenAI.
-
Install dependencies:
Make sure you have pnpm installed. Learn more about installing pnpm.
pnpm install
-
Run the database
Since this project uses Prisma ORM. The Postgres database container needs to be running upon the project init to avoid any Prisma connection error.
pnpm db:up
To learn more about running databases using Docker. Checkout the Prisma section.
-
Run the app in dev mode
pnpm start:dev
reset
- To reset your character and bot chat historystart
- To initialize your botmodel
- To show the list of available models and select your model.voice
- To show the list of available speakers.character
- To enter your bot character prompt and select predefined character. To enter custom character prompt, use: e.g./character i am an assistant
profile
- To show your profile system preferences
You can run this project without having Node.js installed on your machine by running it using Docker as a container. You can learn more about Docker here.
Make sure Docker is installed and Docker daemon is running on your machine. You can learn more how to download and setup Docker here.
-
Run the Docker containers using Docker Compose
docker compose up -d --build
-
Stop running containers
docker compose down
You can also run these commands with make
command based on this project's Makefile configuration to avoid memorizing the long docker
commands.
-
Run containers
make docker-run
-
Stop container
make docker-stop
This NestJS starter template comes with Prisma ORM, a modern Node.js and TypeScript ORM that works really well with NestJS. You can check the full official guide to get started with NestJS and Prisma here.
-
Running the database
It only runs Postgres container with Docker Compose
pnpm db:up
-
Create a database migration
Whenever you make any changes in the
schema.prisma
file, you need to create a migration to reflect the changes you made on the schema to the database.To create a migration, simply run this command, then enter the name of the migration. e.g.
add_user_table
pnpm prisma migrate dev
-
Run existing migrations
pnpm db:deploy
-
Generate Prisma Client
It runs the
prisma generate
command under the hood to generate type definitions based on theschema.prisma
schema.pnpm db:generate
-
Run Prisma Studio
It runs the Prisma Studio tools to open Prisma database admin client tools.
pnpm db:studio
This starter template has Jest setup to run unit and integration API tests. Tests are automatically executed on every pull request and push by GitHub Actions CI workflow.
You can run unit tests and e2e tests manually on your machine:
- Run all unit tests
pnpm test
- Run test in watch mode
pnpm test:watch
- Unit test coverage
pnpm test:cov