A backend service for the Hydra for Reddit app. Using a custom server will unlock all Hydra Pro features for free. If you have the knowhow to get this set up, please consider contributing your skills to the project!
- 🔔 Reddit message monitoring with push notifications
- 📱 Mobile app integration via Expo push notifications
- 💳 Subscription management with RevenueCat
- 🤖 AI-powered features using Groq API
- 📊 Admin dashboard for monitoring and management
- 🗄️ SQLite database with Drizzle ORM
- ⚡ Built with Bun for fast performance
- Bun v1.2.5 or higher
- Node.js 18+ (for some build tools)
- A Groq API key for AI features
hydra-server/
├── frontend/ # React + Vite dashboard
├── routes/ # API endpoints
├── services/ # Business logic services
├── middleware/ # Express-style middleware
├── db/ # Database schema and migrations
├── tasks/ # Background task definitions
├── schedules/ # Scheduled job configurations
└── utils/ # Utility functions
git clone https://github.com/dmilin1/hydra-server.git
cd hydra-serverInstall backend dependencies:
bun installInstall frontend dependencies:
cd frontend
bun install
cd ..Create a .env file in the root directory with the following variables (or copy the .env.example file):
GROQ_API_KEY=your_groq_api_key
# You can generate an encryption key with this command `openssl enc -aes-256-cbc -k secret -P -md sha256`
ENCRYPTION_KEY=your_32_character_encryption_key_here
DASHBOARD_PASSWORD=your_secure_dashboard_password
IS_CUSTOM_SERVER=trueImportant Notes:
ENCRYPTION_KEYmust be exactly 32 characters longDASHBOARD_PASSWORDshould be changed for security purposesIS_CUSTOM_SERVER=trueis required to bypass subscription checks
Build the React dashboard:
cd frontend
bun run build
cd ..The built files will be served automatically by the backend server.
bun run startThe server will start on http://localhost:3000
Open your browser and navigate to http://localhost:3000. You'll be prompted to enter the dashboard password (the value of DASHBOARD_PASSWORD from your .env file).
Navigate to Settings => Advanced => Use Custom Server. Enable it and enter the public IP or domain you're hosting the server on without a trailing slash. Hydra will automatically attempt to validate if the server is working. If hosted on a home computer, you will likely need to set up port forwarding and include port 3000 (or whatever external port you chose).
If running on a debian distro the following commands allow the server to auto run on startup:
Create a systemd service file
sudo nano /etc/systemd/system/hydra-server.serviceEnter the following code into the service:
[Unit]
Description=Hydra Server Bun Script
After=network.target
[Service]
User=pi
WorkingDirectory=/home/pi/hydra-server
ExecStart=/home/pi/.bun/bin/bun run start
Restart=always
RestartSec=5
Environment=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/pi/.bun/bin
[Install]
WantedBy=multi-user.targetThen reload and enable the service:
sudo systemctl daemon-reload
sudo systemctl enable hydra-server.serviceThen run the following to start and check the service:
sudo systemctl start hydra-server.service
sudo systemctl status hydra-server.serviceThe service should now auto-start on boot.