This is a complete assessment-ready template:
Run SQL in Hasura → Data → SQL:
backend/sql/001_schema.sql
backend/sql/002_rls.sql
user
)user_id = X-Hasura-User-Id
Tip: In Hasura Insert Preset for
chats.user_id
, setx-hasura-user-id
so clients don’t send user_id.
sendMessage
Create Action in Console:
mutation sendMessage($chat_id: uuid!, $content: String!)
MessageResponse
(id, chat_id, sender, content, created_at)https://<your-n8n-host>/webhook/send-message
user
: allowedImport n8n/chatbot-workflow.json
and set env vars in n8n:
N8N_HASURA_GRAPHQL_URL
, N8N_HASURA_ADMIN_SECRET
N8N_OPENROUTER_API_KEY
, N8N_OPENROUTER_MODEL
Flow:
chat_id
belongs to caller (compare x-hasura-user-id
with chat.user_id)cd frontend
npm i
# Create .env.local with your values
echo "VITE_NHOST_SUBDOMAIN=your-subdomain
VITE_NHOST_REGION=ap-south-1
VITE_HASURA_GRAPHQL_URL=https://<subdomain>.nhost.run/v1/graphql
VITE_HASURA_GRAPHQL_WS=wss://<subdomain>.nhost.run/v1/graphql
VITE_HASURA_ACTION_SENDMESSAGE=sendMessage" > .env.local
npm run dev
frontend
npm run build
dist
Name: Your Name
Contact: 9xxxxxxxxx
Deployed: https://
git init
git add .
git commit -m "feat: nhost/hasura/n8n/openrouter chatbot"
git branch -M main
git remote add origin https://github.com/<you>/chatbot-app.git
git push -u origin main
Run ONE command from the project folder:
bash push.sh
push.bat
It will push to: https://github.com/Chandu207-cmd/chatbot-app.git