This project integrates a SvelteKit application with Google Sheets via the Google Apps Script to create a domain selling platform. Users can submit their offers for a domain through a form, which is then saved to a Google Sheet for easy management and review.
+ Blank
button or + New
button to create a new sheet.Extensions
in the menu bar.Apps Script
from the dropdown menu.function doPost(e) {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var data = JSON.parse(e.postData.contents);
sheet.appendRow([data.name, data.email, data.offer, data.message]);
// Add your real time webhooks here for alerts ex telegram, slack, email, telegram etc as needed.
// Send notification to Telegram
//sendTelegramNotification(`New domain offer received for llm.ing entry received: Name - ${data.name}, Email - ${data.email}, Offer - ${data.offer}, Message - ${data.message}`);
return ContentService.createTextOutput(JSON.stringify({ "result": "success", "data": data }))
.setMimeType(ContentService.MimeType.JSON);
}
// function sendTelegramNotification(message) {
// var token = 'YOUR_TELEGRAM_BOT_TOKEN'; // Replace with your Telegram bot token
// var chatId = 'YOUR_CHAT_ID'; // Replace with your personal chat ID with the bot
// var url = `https://api.telegram.org/bot${token}/sendMessage?chat_id=${chatId}&text=${encodeURIComponent(message)}`;
// try {
// UrlFetchApp.fetch(url);
// } catch (e) {
// Logger.log("Failed to send Telegram notification: " + e.message);
// }
// }
Deploy
> New deployment
.Web app
as the deployment type.Who has access
to Anyone
.Deploy
and copy the provided web app URL.Follow these steps to deploy this project to Cloudflare Pages:
Fork or clone this repository: Start by forking this repository to your GitHub account or cloning it to your local machine.
Sign up or log in to Cloudflare: If you haven't already, sign up for a Cloudflare account or log in.
Create a new project on Cloudflare Pages: Go to the Cloudflare Pages dashboard and click on the 'Click on pages tab'(Workers, Pages will be side-by-side).
Connect your GitHub account: Follow the prompts to connect your GitHub account to Cloudflare Pages if you haven't done so already. This allows Cloudflare Pages to access your repositories.
Select the repository: Choose the repository you forked or cloned for this project.
Configure your project: Set up the build settings for your SvelteKit project. For most SvelteKit projects, the build command is npm run build
and the build output directory is build
. Make sure to set environment variables as required by your project.
Deploy: Click on the 'Save and Deploy' button. Cloudflare Pages will then build and deploy your site.
Set up additional features: Optionally, configure additional features such as custom domains, environment variables, or access restrictions as needed through the Cloudflare dashboard.
Your application is now deployed to Cloudflare Pages! You can access it using the provided URL and connect it to a domain you want to sell.