By the end of this guide you will have a fully operational ApiSquare instance running on Vercel: a Telegram bot that accepts appointment bookings from your customers, a Vercel KV store persisting all reservations, and an admin dashboard you can log into from any browser. The entire setup — from cloning the repo to receiving your firstDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/shadownrx/apisquare/llms.txt
Use this file to discover all available pages before exploring further.
/start message — takes under 15 minutes.
Clone the repository
Clone ApiSquare and install its dependencies:The project uses Next.js 16 with the App Router. All source files live under
app/, and the webhook handler is at app/api/webhook/route.ts.Create a Telegram bot
ApiSquare needs a bot token from Telegram’s official bot management account:
- Open Telegram and search for @BotFather.
- Send
/newbotand follow the prompts — choose a display name and a unique username ending inbot. - BotFather will reply with your bot token in the format
123456789:ABCDefGhIJKlmNoPQRstuVWXyz. - Copy that token — you will use it as
TELEGRAM_TOKENin the next step.
Set environment variables
Create a
.env.local file at the root of the project with the following variables:KV_REST_API_URL and KV_REST_API_TOKEN are available from the Storage tab of your Vercel project after you create a KV database. See the Environment Variables reference for the full list of supported variables.Deploy to Vercel
Deploy the project to a production Vercel environment:Vercel detects the Alternatively, set them through the Settings → Environment Variables panel in the Vercel dashboard, then redeploy.
nextjs framework automatically (configured in vercel.json). Before or after deploying, add the environment variables to Vercel so the production build can read them:Register the Telegram webhook
Tell Telegram to forward all bot updates to your deployment. Pass your Vercel app URL as the first argument:On success you will see:The script reads
TELEGRAM_TOKEN from .env automatically (via dotenv). Make sure your .env.local variables are also present in a .env file, or export TELEGRAM_TOKEN to your shell before running the script.Verify it works
Once the webhook is registered, run three quick checks to confirm everything is wired together correctly: 1. Test the Telegram bot Open Telegram, find your bot by its username, and send/start. The bot should immediately reply with the main menu:
https://your-app.vercel.app/admin in your browser and log in with the ADMIN_USERNAME and ADMIN_PASSWORD you configured. You should land on the reservations overview.
During local development (
npm run dev), ApiSquare automatically falls back to in-memory storage when KV_REST_API_URL and KV_REST_API_TOKEN are absent from the environment. You can test the full booking flow locally without any KV credentials — just keep in mind that all data is lost when the dev server restarts.