A React-based registration form for the TEDI onboarding process that submits data directly to Google Sheets. Built with Vite and TEDI Design System components.
- Simple registration form with 4 fields:
- Nimi (Name)
- Projekt (Project)
- Projektimeeskond, kellele vaja Figma litsentse (Team members needing Figma license)
- Built with TEDI Design System components
- Direct integration with Google Sheets
- Responsive design
- Form validation
- Deployable to GitHub Pages
- Node.js (v18 or higher)
- npm
- Google account with access to Google Sheets and Google Apps Script
npm install- Go to Google Sheets
- Create a new spreadsheet for TEDI Onboarding registrations
- Copy the Spreadsheet ID from the URL:
https://docs.google.com/spreadsheets/d/SPREADSHEET_ID_HERE/edit
- Go to Google Apps Script
- Click "New Project"
- Copy the contents of
google-apps-script.jsinto the editor - Update the
SPREADSHEET_IDconstant with your spreadsheet ID - Click "Deploy" > "New deployment"
- Settings:
- Type: Web App
- Execute as: Me
- Who has access: Anyone
- Click "Deploy"
- Copy the Web App URL (it will look like:
https://script.google.com/macros/s/.../exec)
- Copy
.env.exampleto.env:cp .env.example .env
- Open
.envand add your Google Apps Script Web App URL:VITE_GOOGLE_SCRIPT_URL=https://script.google.com/macros/s/.../exec
Run the development server:
npm run devThe application will be available at http://localhost:5173
npm run buildThe built files will be in the dist directory.
- Create a new repository on GitHub
- Initialize git in your project (if not already done):
git init git add . git commit -m "Initial commit"
- Add your GitHub repository as remote:
git remote add origin https://github.com/YOUR_USERNAME/tedi-onboarding.git
- Push to GitHub:
git branch -M main git push -u origin main
-
Update
vite.config.jswith your repository name:base: '/your-repo-name/',
-
Deploy to GitHub Pages:
npm run deploy
-
Enable GitHub Pages:
- Go to your repository settings
- Navigate to "Pages"
- Source: Select "gh-pages" branch
- Click "Save"
Your form will be available at: https://YOUR_USERNAME.github.io/tedi-onboarding/
For GitHub Pages deployment, you need to set the environment variable during build:
-
Create a
.env.productionfile:VITE_GOOGLE_SCRIPT_URL=https://script.google.com/macros/s/.../exec -
Or set it in your GitHub Actions workflow if using CI/CD.
Security Note: Environment variables prefixed with VITE_ are exposed in the client-side code. Since this is a public form, this is acceptable. However, never include sensitive credentials.
After deploying the Google Apps Script:
- Open the Apps Script editor
- Select the
testSetupfunction from the dropdown - Click "Run"
- Check the execution log to verify the setup
- Check your Google Sheet - it should have a new sheet named "Registrations" with headers
All frequently updated content (dates and links) is centralized in content.config.js in the project root. This makes it easy to maintain without touching the application code.
To update the available onboarding session dates:
export const ONBOARDING_DATES = [
{
id: 'date1',
label: 'Teisipäev, 20. jaanuar 2026 kell 10:00',
value: 'Teisipäev, 20. jaanuar 2026 kell 10:00'
},
// Add or modify dates as needed
];To update TEDI related links:
export const TEDI_LINKS = [
{
url: 'https://tedi.ee',
label: 'TEDI avalehekülg'
},
// Add or modify links as needed
];tedi-onboarding/
├── src/
│ ├── App.tsx # Main form component
│ ├── App.css # Styles
│ └── main.tsx # Entry point
├── .env.example # Environment variable template
├── content.config.js # Content configuration (dates, links)
├── google-apps-script.js # Google Apps Script code
├── vite.config.js # Vite configuration
└── package.json # Dependencies
- Verify the Google Apps Script is deployed as "Anyone" can access
- Check that the Web App URL in
.envis correct - Open browser console to see any error messages
- Verify the Google Apps Script has the correct Spreadsheet ID
- The form uses
mode: 'no-cors'which is necessary for Google Apps Script - This means we can't read the response, but the data will still be saved
- Ensure the
basepath invite.config.jsmatches your repository name - Verify GitHub Pages is enabled in repository settings
- Check that the
gh-pagesbranch exists after runningnpm run deploy
This project is part of the TEDI Design System initiative.
For issues related to TEDI Design System components, visit: