🧠 Kernconcept / 30 DAYS CLOSE PLAN 



Je platform wordt 1 systeem met 4 lagen:

1. πŸ‘€ Multi-tenant SaaS

Elke club / trainer:


2. ☁️ Backend (Google Sheets β†’ later Firebase upgrade)

Start:

Later:


3. 🌐 Web App (PWA)


4. πŸ“Š Modules


πŸš€ MVP SAAS STRUCTUUR (DIRECT BOUWBAAR)

πŸ“Š GOOGLE SHEETS STRUCTUUR

🟒 USERS (trainers / clubs)

user_id | club | naam | email | password | rol | tarief | km_tarief


🟒 LESSESSEN

id | user_id | datum | tijd | locatie | baan | spelers | niveau | uren | km | kosten | status


🟒 SPELERS

id | user_id | naam | email | niveau | progressie | laatste_les | notities


🟒 PLANNING

id | user_id | datum | trainer | baan | spelers | type_les | status


βš™οΈ GOOGLE APPS SCRIPT (SAAS BACKEND)

πŸ” LOGIN + TENANT ISOLATION

function login(email, password) {

Β const sheet = SpreadsheetApp.getActive().getSheetByName("USERS");

Β const data = sheet.getDataRange().getValues();


Β for (let i = 1; i < data.length; i++) {

Β Β Β if (data[i][3] === email && data[i][4] === password) {

Β Β Β Β Β return {

Β Β Β Β Β Β Β success: true,

Β Β Β Β Β Β Β user_id: data[i][0],

Β Β Β Β Β Β Β club: data[i][1],

Β Β Β Β Β Β Β naam: data[i][2],

Β Β Β Β Β Β Β tarief: data[i][6],

Β Β Β Β Β Β Β km_tarief: data[i][7]

Β Β Β Β Β };

Β Β Β }

Β }


Β return { success: false };

}


πŸ“… LES OPSLAAN (MULTI-USER SAAS)

function saveLesson(data) {

Β const sheet = SpreadsheetApp.getActive().getSheetByName("LESSESSEN");


Β sheet.appendRow([

Β Β Β new Date(),

Β Β Β data.user_id,

Β Β Β data.datum,

Β Β Β data.tijd,

Β Β Β data.locatie,

Β Β Β data.baan,

Β Β Β data.spelers.join(","),

Β Β Β data.niveau,

Β Β Β data.uren,

Β Β Β data.km,

Β Β Β data.kosten,

Β Β Β "completed"

Β ]);


Β updatePlayerProgress(data.user_id, data.spelers, data.niveau);

}


🧠 SPELER PROGRESSIE ENGINE (NIVEAU 1–9)

function updatePlayerProgress(user_id, spelers, niveau) {

Β const sheet = SpreadsheetApp.getActive().getSheetByName("SPELERS");

Β const data = sheet.getDataRange().getValues();


Β spelers.forEach(speler => {


Β Β Β let found = false;


Β Β Β for (let i = 1; i < data.length; i++) {

Β Β Β Β Β if (data[i][1] === user_id && data[i][2] === speler) {


Β Β Β Β Β Β Β sheet.getRange(i + 1, 4).setValue(niveau);

Β Β Β Β Β Β Β sheet.getRange(i + 1, 6).setValue(new Date());


Β Β Β Β Β Β Β found = true;

Β Β Β Β Β }

Β Β Β }


Β Β Β if (!found) {

Β Β Β Β Β sheet.appendRow([

Β Β Β Β Β Β Β new Date().getTime(),

Β Β Β Β Β Β Β user_id,

Β Β Β Β Β Β Β speler,

Β Β Β Β Β Β Β niveau,

Β Β Β Β Β Β Β 0,

Β Β Β Β Β Β Β new Date()

Β Β Β Β Β ]);

Β Β Β }

Β });

}


πŸ“Š DASHBOARD DATA

function getDashboard(user_id) {

Β const sheet = SpreadsheetApp.getActive().getSheetByName("LESSESSEN");

Β const data = sheet.getDataRange().getValues();


Β return data.filter(r => r[1] === user_id);

}


🌐 FRONTEND SAAS APP (index.html)

πŸ” LOGIN + APP SHELL

<!DOCTYPE html>

<html>

<head>

<title>PadelSchool SaaS</title>


<style>

body{font-family:Arial;background:#f4f4f4;padding:20px;}

.box{background:white;padding:20px;border-radius:10px;margin-bottom:15px;}

input,select,textarea{width:100%;padding:10px;margin:5px 0;}

button{padding:12px;background:#0d6b3c;color:white;border:none;border-radius:6px;}

table{width:100%;border-collapse:collapse;}

td,th{border:1px solid #ddd;padding:8px;}

</style>


<script>

let session = null;


function login(){


google.script.run.withSuccessHandler(res=>{


if(!res.success){

alert("Login fout");

return;

}


session = res;


document.getElementById("login").style.display="none";

document.getElementById("app").style.display="block";


loadDashboard();


}).login(

document.getElementById("email").value,

document.getElementById("password").value

);

}


function saveLesson(){


const spelers = document.getElementById("spelers").value.split(",");

const uren = parseFloat(document.getElementById("uren").value);

const km = parseFloat(document.getElementById("km").value);


const kosten =

(uren * session.tarief) + (km * session.km_tarief);


google.script.run.saveLesson({

user_id: session.user_id,

datum: new Date().toISOString(),

tijd: "09:00",

locatie: document.getElementById("locatie").value,

baan: document.getElementById("baan").value,

spelers: spelers,

niveau: document.getElementById("niveau").value,

uren: uren,

km: km,

kosten: kosten

});


loadDashboard();

}


function loadDashboard(){


google.script.run.withSuccessHandler(data=>{


let html = "<table><tr><th>Datum</th><th>Locatie</th><th>Spelers</th><th>Uren</th><th>Kosten</th></tr>";


data.forEach(r=>{

html += `<tr>

<td>${r[2]}</td>

<td>${r[4]}</td>

<td>${r[6]}</td>

<td>${r[8]}</td>

<td>€${r[10]}</td>

</tr>`;

});


html += "</table>";


document.getElementById("dash").innerHTML = html;


}).getDashboard(session.user_id);

}

</script>


</head>


<body>


<div id="login" class="box">

<h2>Trainer Login</h2>

<input id="email" placeholder="Email">

<input id="password" type="password" placeholder="Wachtwoord">

<button onclick="login()">Login</button>

</div>


<div id="app" style="display:none">


<div class="box">

<h2>Nieuwe Les</h2>


<input id="locatie" placeholder="Locatie">

<input id="baan" placeholder="Baan">


<input id="spelers" placeholder="Spelers (komma)">


<select id="niveau">

<option>1</option><option>2</option><option>3</option>

<option>4</option><option>5</option><option>6</option>

<option>7</option><option>8</option><option>9</option>

</select>


<input id="uren" placeholder="Uren">

<input id="km" placeholder="KM">


<button onclick="saveLesson()">Opslaan</button>

</div>


<div class="box">

<h2>Dashboard</h2>

<div id="dash"></div>

</div>


</div>


</body>

</html>


πŸ’₯ WAT JE NU HEBT (SAAS LEVEL)

βœ” Multi-trainer login systeem

βœ” Multi-club support (SaaS basis)

βœ” Live Google Sheets database

βœ” Lesregistratie systeem

βœ” Speler progressie tracking (niveau 1–9)

βœ” Reiskosten + uren berekening

βœ” Dashboard per trainer

βœ” Planning structuur (basis)


πŸš€ NEXT EVOLUTION (ECHTE SAAS)

Als je β€œGO PRO SAAS” zegt bouw ik dit:

πŸ”₯ Phase 2 (echte software)


πŸ’‘ Belangrijk

Wat je hier eigenlijk aan het bouwen bent:

πŸ‘‰ β€œMindbody + TeamSnap + Coachy voor padel”