Backend service for the Solvro Bot, built with NestJS.
Before you begin, ensure you have met the following requirements:
- Node.js: v18 or higher recommended.
- npm: usually comes with Node.js.
- PostgreSQL: You can run this locally or via Docker.
- Active Discord Bot Application: You need a token from the Discord Developer Portal.
- Google Cloud Console Project: For Google Drive integration (OAuth2 credentials).
git clone <repository-url>
cd backend-solvro-bot-core-v2npm install-
Copy the example environment file to a new file named
.env:cp .env.example .env
-
Open
.envand fill in the required values:-
Server Configuration:
NODE_ENV:developmentPORT: Port to run the server on (default:3000).
-
Database:
DATABASE_URL: Your PostgreSQL connection string.
Format:postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=public
-
Discord Integration:
DISCORD_TOKEN: Your Discord Bot Token.DISCORD_DEVELOPMENT_GUILD_ID: (Optional) ID of a specific guild for development/testing commands.
-
External Services:
TRANSCRIBER_URL: URL to the transcription service (e.g.,http://localhost:3001).
-
Google Integration (Drive & Auth):
GOOGLE_CLIENT_ID: From Google Cloud Console.GOOGLE_CLIENT_SECRET: From Google Cloud Console.GOOGLE_REDIRECT_URI: Your callback URL (e.g.,http://localhost:3000/google/callback).GOOGLE_REFRESH_TOKEN: Access token for offline access (can be obtained via OAuth flow).GOOGLE_DRIVE_FOLDER_ID: ID of the folder where files should be stored.
-
GitHub Integration:
GITHUB_WEBHOOK_SECRET: Secret used to verify GitHub webhooks.
-
Office Camera:
OFFICE_CAMERA_IMAGE_PATH: (Optional) Directory where office camera images are stored (default:./uploads/office-camera).
-
Ensure your PostgreSQL database is running, then generate the Prisma client and run migrations:
# Generate Prisma Client
npx prisma generate
# Run migrations to set up the database schema
npx prisma migrate dev# development
npm run start
# watch mode
npm run start:dev
# production mode
npm run start:prod# unit tests
npm run test
# e2e tests
npm run test:e2e
# test coverage
npm run test:covNest is MIT licensed.