This application provides a registration form that sends registration data to a Telegram bot via a Node.js backend server.
- Registration form (AO Interview.html) as the main index page
- Form submission sends data to Telegram bot using credentials from .env file
- Redirects to success page (AO SUCCESS.html) after successful registration
- Docker installed on your system
- Telegram Bot Token and Admin Chat ID
-
Configure Environment Variables in Coolify:
- Go to your application settings in Coolify
- Navigate to Environment Variables section
- Add the following required variables:
TELEGRAM_BOT_TOKEN=your_bot_token_here ADMIN_CHAT_ID=your_chat_id_here PORT=3000 - IMPORTANT: These environment variables MUST be set in Coolify, otherwise registration will fail with "Server configuration error"
-
Deploy the application:
- Push your code to your Git repository
- Coolify will automatically build and deploy using the Dockerfile
- Check the application logs to verify environment variables are set correctly
-
Verify Deployment:
- Check the server logs in Coolify - you should see startup messages indicating whether environment variables are configured
- If variables are missing, you'll see warnings in the logs
Troubleshooting Coolify Deployment:
If you see errors like "Missing required environment variables" in your logs:
-
Check Environment Variables in Coolify:
- Go to your application in Coolify dashboard
- Click on Environment Variables (or Variables tab)
- Verify that both
TELEGRAM_BOT_TOKENandADMIN_CHAT_IDare set - Make sure there are no typos in the variable names (case-sensitive)
- Ensure values don't have extra spaces or quotes
-
Common Issues:
- Variables not set: The server logs will show "
⚠️ WARNING: TELEGRAM_BOT_TOKEN environment variable is not set!" - After adding variables: You MUST redeploy/restart the application for changes to take effect
- Variable names: Must be exactly
TELEGRAM_BOT_TOKENandADMIN_CHAT_ID(case-sensitive)
- Variables not set: The server logs will show "
-
How to Get Your Values:
- TELEGRAM_BOT_TOKEN:
- Message @BotFather on Telegram
- Use
/newbotcommand to create a bot (if you don't have one) - Copy the token provided (looks like:
123456789:ABCdefGHIjklMNOpqrsTUVwxyz)
- ADMIN_CHAT_ID:
- Message @userinfobot on Telegram to get your chat ID
- Or message your bot first, then visit:
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates - Look for the "chat" object and find the "id" field (usually a number like
123456789)
- TELEGRAM_BOT_TOKEN:
-
Verify Deployment:
- Check server startup logs in Coolify
- You should see:
✓ TELEGRAM_BOT_TOKEN is setand✓ ADMIN_CHAT_ID is set - If you see warnings, the variables are not configured correctly
-
Make sure you have a
.envfile in the project root with the following variables:TELEGRAM_BOT_TOKEN=your_bot_token_here ADMIN_CHAT_ID=your_chat_id_here PORT=3000 -
Build and run using Docker Compose:
docker-compose up -d
Or build and run in one command:
docker-compose up --build -d
-
Access the application at
http://localhost:3000
-
Make sure you have a
.envfile in the project root with the following variables:TELEGRAM_BOT_TOKEN=your_bot_token_here ADMIN_CHAT_ID=your_chat_id_here PORT=3000 -
Build the Docker image:
docker build -t ao-interview-app . -
Run the Docker container with .env file:
docker run -d -p 3000:3000 --env-file .env ao-interview-app
Or using environment variables directly (without .env file):
docker run -d -p 3000:3000 \ -e TELEGRAM_BOT_TOKEN=your_bot_token \ -e ADMIN_CHAT_ID=your_chat_id \ -e PORT=3000 \ ao-interview-app
-
Access the application at
http://localhost:3000
Note: If you get a "no configuration file provided: not found" error, make sure:
- The
.envfile exists in the project root directory - The
.envfile has the correct format (no spaces around=) - You're using
--env-file .envwhen running docker, or usingdocker-compose upwhich automatically loads .env
If you want to run the application locally without Docker:
-
Install dependencies:
npm install
-
Create a
.envfile with your Telegram bot credentials -
Start the server:
npm start
AO Interview.html- Main registration form page (served as index)AO SUCCESS.html- Success page shown after registrationserver.js- Express.js backend serverform-handler.js- Client-side form submission handlerpackage.json- Node.js dependenciesDockerfile- Docker configuration.env- Environment variables (Telegram bot credentials)
The registration form collects:
- First Name
- Last Name
- Phone / WhatsApp / Telegram
- AO Leader (dropdown selection)
All form data is sent to the Telegram bot when the user clicks "Register Now".