Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
3bddaf4
Customize Tingaroo IDE: default Uno, upload mode, branding, and deplo…
basheerbk Aug 12, 2026
49a7a53
Add cloud compile and browser Web Serial upload for Uno/ESP32.
basheerbk Aug 24, 2026
57cb121
Add MakerUno and MakerEsp32 device support with Serial Monitor
basheerbk Sep 3, 2026
1919cfc
Redesign blocks: 5 simplified categories, device-only toolbox, new pa…
basheerbk Sep 3, 2026
10099a5
Hide Program Mode toggle — device-only IDE, always upload mode
basheerbk Sep 3, 2026
015eea6
Hide Upload Firmware button (device-only IDE)
basheerbk Sep 3, 2026
b47cd25
Apply Tingaroo block colour overrides so rendered blocks match palette
basheerbk Sep 4, 2026
8e00ea4
Hide language selector and lock UI to English
basheerbk Sep 7, 2026
6fa1fb7
Add TinkerBit marketing landing at / and move IDE to /ide
basheerbk Sep 7, 2026
9909788
Point TinkerBit site and compile CORS at tinkerbit.io
basheerbk Sep 7, 2026
f258001
Rebrand user-facing OpenBlock strings to TinkerBit
basheerbk Sep 8, 2026
a0cebb5
Add Lucide-style icons to all toolbox categories.
basheerbk Sep 8, 2026
90efbc7
Gate the IDE behind Google Sign-In and warn on unsupported upload bro…
basheerbk Sep 9, 2026
4d5bfb5
Ship React landing/login and Clarity identify, tags, and product events.
basheerbk Sep 9, 2026
223d744
Replace landing placeholders with real TinkerBit product photos.
basheerbk Sep 10, 2026
5931afe
Pin hero copy left and replace the RJ11 demo with a product photo.
basheerbk Sep 10, 2026
a916d63
Fix Beginner Studio white screen (regeneratorRuntime + keep esptool o…
basheerbk Sep 12, 2026
f21c6c9
Align Beginner Studio and Maker ESP32 pins with the RJ11 schematic.
basheerbk Sep 16, 2026
820e688
Replan Beginner kit catalog and close RFID, BLE, and L293D gaps.
basheerbk Sep 18, 2026
4292867
Harden D5 HC-SR04 wiring so Echo stays INPUT and avoids heating.
basheerbk Sep 18, 2026
59b88b8
Use ESP32Servo and swap D5 Trig/Echo pins for the kit cable.
basheerbk Sep 18, 2026
596d456
Add Beginner serial monitor, I2C HW-605, and MD dual-motor pin map.
basheerbk Sep 18, 2026
1611bed
Add module serial logs and harden HW-605 I2C init.
basheerbk Sep 18, 2026
cae8bce
Add DHT/MQ-2 print blocks and fix DHT sampling.
basheerbk Sep 18, 2026
ea0fed6
Fix DHT11 Celsius reads with ESP32 bit-bang sampling.
basheerbk Sep 18, 2026
6ae274e
Harden DHT11 reads for ESP32 one-wire timing.
basheerbk Sep 18, 2026
05c6950
Add 4-channel relay module on the MD jack.
basheerbk Sep 18, 2026
33028be
Stabilize MQ-2 gas readings with ADC averaging.
basheerbk Sep 18, 2026
20479e7
Treat soil moisture as capacitive (dry = high ADC).
basheerbk Sep 18, 2026
8462827
Print capacitive soil moisture as 0–100 percent.
basheerbk Sep 18, 2026
7fe40a6
Show soil raw ADC and GPIO so pin mismatches are obvious.
basheerbk Sep 18, 2026
a1a1fe6
Mirror Beginner kit modules into Advanced Maker ESP32 blocks.
basheerbk Sep 21, 2026
39bb212
Use LED board artwork icon; add LED brightness, laptop-safe ESP32 upl…
basheerbk Oct 24, 2026
2a3162e
Show LED as real module artwork plugged into its board jack.
basheerbk Oct 24, 2026
da2fcbe
Rework landing page: waitlist with Upstash, privacy and 404 pages, SE…
basheerbk Oct 26, 2026
b61d983
Add 3D Build view: restyled board, WebGL scene with three.js and a CS…
basheerbk Oct 28, 2026
3fad1b1
Beginner Studio: switch Build view to the RJ11 hub board with exporte…
basheerbk Oct 30, 2026
1322ff1
Add project-based edge AI guide for teachers (docs/EDGE_AI_PROJECTS.md).
basheerbk Oct 30, 2026
c90a6e9
Redesign homepage: purple grid brand tokens, section components, inli…
basheerbk Oct 30, 2026
9c87157
Move compile to the new EC2 host (13.127.144.30); add TinkerBit Cloud…
basheerbk Nov 1, 2026
b8e65bc
Compile over HTTPS via api.tinkerbit.io; clearer TinkerBit Cloud erro…
basheerbk Nov 1, 2026
6fd4606
Cloud: heartbeat keeps sensorless boards online; acks count as presence
basheerbk Nov 1, 2026
c39ba1b
Beginner Studio: account menu with avatar and sign-out (shared-comput…
basheerbk Nov 4, 2026
8c412d3
Beginner Studio: guided Cloud wizard with live checklist and QR code
basheerbk Nov 4, 2026
82facd0
Beginner Studio: IoT button opens a Cloud page with setup and live bo…
basheerbk Nov 4, 2026
7ab6a5e
Beginner Studio: sensor kit parts, colour shelf icons and new kit boa…
basheerbk Nov 4, 2026
896e0af
Beginner Studio: IoT Dashboard with a board list beside the dashboard
basheerbk Nov 5, 2026
094479d
Checkpoint: Edge AI, multiple part copies, kit specs doc, Advanced ki…
basheerbk Nov 6, 2026
807580d
MicroPython prototype: TinkerBit library, Stage B firmware sources, s…
basheerbk Nov 7, 2026
5b9b677
Beginner Studio: MicroPython on the TinkerBit firmware, Cloud over /c…
basheerbk Nov 7, 2026
6d5a691
MicroPython: port RFID, HC-05, BLE and heartbeat
basheerbk Nov 7, 2026
0311449
Beginner Studio: serial monitor Start restarts the board
basheerbk Nov 12, 2026
56efade
Docs: MicroPython section in ARCHITECTURE.md, compile backend plan, C…
basheerbk Nov 20, 2026
ccb6a5e
Lock Advanced mode; plan the full MicroPython migration
basheerbk Nov 20, 2026
9b09f8c
IoT redesign part 1: TinkerBit Cloud in the brand look, controls first
basheerbk Nov 20, 2026
0f79e0d
IoT redesign part 2: Studio Cloud page is one checklist; each project…
basheerbk Nov 20, 2026
c15b25a
IoT redesign part 3: name dashboard switches and sliders in Studio
basheerbk Nov 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 17 additions & 0 deletions .claude/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"version": "0.0.1",
"configurations": [
{
"name": "tinkerbit-dev",
"runtimeExecutable": "npx",
"runtimeArgs": ["cross-env", "NODE_OPTIONS=--openssl-legacy-provider", "webpack-dev-server", "--host", "127.0.0.1"],
"port": 8601
},
{
"name": "iot-api-dev",
"runtimeExecutable": "npx",
"runtimeArgs": ["cross-env", "AUTH_DISABLED=1", "IOT_BROKER_MODE=none", "npm", "--prefix", "services/iot-api", "start"],
"port": 20114
}
]
}
17 changes: 17 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Google OAuth (Web application client)
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

# 32+ character random secret used to sign session cookies
AUTH_SECRET=

# Public site origin (no trailing slash)
# Production: https://www.tinkerbit.io
# Local vercel dev: http://127.0.0.1:3000
AUTH_BASE_URL=https://www.tinkerbit.io

# Local only: set to 1 to skip Google login outside Vercel production
# AUTH_DISABLED=1

# Microsoft Clarity project ID (Settings → Overview in clarity.microsoft.com)
CLARITY_ID=
4 changes: 4 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Auth helpers for local checks (no Google secrets required)
AUTH_SECRET=local-dev-secret-at-least-32-chars-long
AUTH_BASE_URL=http://127.0.0.1:3000
AUTH_DISABLED=1
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
node_modules/*
build/*
dist/*
module-test/*
prototypes/micropython/*
src/beginner-studio/components/module-icons/module-icons.js
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,12 @@ Makefile text eol=lf
README text eol=lf
TRADEMARK text eol=lf

# Server deploy files run on Linux
*.sh text eol=lf
*.mjs text eol=lf
*.conf text eol=lf
*.service text eol=lf
*.timer text eol=lf
*.example text eol=lf

# Use CRLF for Windows-specific file types
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,23 @@ npm-*
# Build
/build
/dist
/.generated
/.opt-in

# Generated translation files
/translations
/locale

.vercel

# Secrets / local keys
MakerShop.pem
*.pem
.env
.env.local
.env.*.local

# Local recovery helpers
scripts/recover-from-transcript.js
scripts/apply-strreplace.js
scripts/recover-report.json
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
9 changes: 9 additions & 0 deletions .vercelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MakerShop.pem
*.pem
scripts/recover-from-transcript.js
scripts/apply-strreplace.js
scripts/recover-report.json
serial_monitor_integration.md
build-log.txt
.git
node_modules
596 changes: 596 additions & 0 deletions ARCHITECTURE.md

Large diffs are not rendered by default.

Binary file added ARCHITECTURE.pdf
Binary file not shown.
748 changes: 748 additions & 0 deletions animated/rj11-hub-widget.html

Large diffs are not rendered by default.

737 changes: 737 additions & 0 deletions animated/rj11-hub_1.html

Large diffs are not rendered by default.

148 changes: 148 additions & 0 deletions api/auth/callback.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
import {
OAUTH_STATE_COOKIE,
SESSION_COOKIE,
SESSION_MAX_AGE_SEC,
clearCookie,
createSessionToken,
getAuthBaseUrl,
isAuthDisabled,
logAuthEvent,
parseCookies,
sanitizeNextPath,
serializeCookie
} from '../../lib/auth/session.mjs';

function redirectLogin (res, errorCode) {
const q = errorCode ? `?error=${encodeURIComponent(errorCode)}` : '';
res.statusCode = 302;
res.setHeader('Location', `/login${q}`);
res.setHeader('Cache-Control', 'no-store');
res.end();
}

export default async function handler (req, res) {
if (req.method !== 'GET') {
res.statusCode = 405;
res.end('Method Not Allowed');
return;
}

if (isAuthDisabled()) {
res.statusCode = 302;
res.setHeader('Location', '/choose');
res.end();
return;
}

const clientId = process.env.GOOGLE_CLIENT_ID;
const clientSecret = process.env.GOOGLE_CLIENT_SECRET;
if (!clientId || !clientSecret || !process.env.AUTH_SECRET) {
logAuthEvent('callback_misconfigured');
redirectLogin(res, 'config');
return;
}

const query = req.query || {};
if (query.error) {
logAuthEvent('callback_google_error', {error: String(query.error)});
redirectLogin(res, 'denied');
return;
}

const code = query.code;
const state = query.state;
if (!code || !state) {
logAuthEvent('callback_missing_params');
redirectLogin(res, 'invalid');
return;
}

const cookies = parseCookies(req.headers.cookie);
const rawState = cookies[OAUTH_STATE_COOKIE];
let stored = null;
try {
stored = rawState ? JSON.parse(Buffer.from(rawState, 'base64url').toString('utf8')) : null;
} catch (err) {
stored = null;
}

if (!stored || !stored.state || stored.state !== state) {
logAuthEvent('callback_state_mismatch');
res.setHeader('Set-Cookie', clearCookie(OAUTH_STATE_COOKIE));
redirectLogin(res, 'invalid');
return;
}

const next = sanitizeNextPath(stored.next);
const baseUrl = getAuthBaseUrl(req);
const redirectUri = `${baseUrl}/api/auth/callback`;

let tokenJson;
try {
const tokenRes = await fetch('https://oauth2.googleapis.com/token', {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
code: String(code),
client_id: clientId,
client_secret: clientSecret,
redirect_uri: redirectUri,
grant_type: 'authorization_code'
})
});
tokenJson = await tokenRes.json();
if (!tokenRes.ok || !tokenJson.access_token) {
logAuthEvent('callback_token_exchange_failed');
redirectLogin(res, 'invalid');
return;
}
} catch (err) {
logAuthEvent('callback_token_exchange_error');
redirectLogin(res, 'invalid');
return;
}

let profile;
try {
const profileRes = await fetch('https://openidconnect.googleapis.com/v1/userinfo', {
headers: {Authorization: `Bearer ${tokenJson.access_token}`}
});
profile = await profileRes.json();
if (!profileRes.ok || !profile.sub) {
logAuthEvent('callback_profile_failed');
redirectLogin(res, 'invalid');
return;
}
} catch (err) {
logAuthEvent('callback_profile_error');
redirectLogin(res, 'invalid');
return;
}

let sessionToken;
try {
sessionToken = await createSessionToken({
sub: profile.sub,
email: profile.email || '',
name: profile.name || profile.email || 'User',
picture: profile.picture || ''
});
} catch (err) {
logAuthEvent('callback_session_failed');
redirectLogin(res, 'config');
return;
}

logAuthEvent('callback_success', {sub: profile.sub});
res.statusCode = 302;
res.setHeader('Set-Cookie', [
serializeCookie(SESSION_COOKIE, sessionToken, {
maxAge: SESSION_MAX_AGE_SEC,
httpOnly: true
}),
clearCookie(OAUTH_STATE_COOKIE)
]);
res.setHeader('Location', next);
res.setHeader('Cache-Control', 'no-store');
res.end();
}
61 changes: 61 additions & 0 deletions api/auth/google.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import {randomBytes} from 'crypto';
import {
OAUTH_STATE_COOKIE,
STATE_MAX_AGE_SEC,
getAuthBaseUrl,
isAuthDisabled,
logAuthEvent,
sanitizeNextPath,
serializeCookie
} from '../../lib/auth/session.mjs';

export default async function handler (req, res) {
if (req.method !== 'GET') {
res.statusCode = 405;
res.end('Method Not Allowed');
return;
}

if (isAuthDisabled()) {
res.statusCode = 302;
res.setHeader('Location', sanitizeNextPath(req.query && req.query.next));
res.end();
return;
}

const clientId = process.env.GOOGLE_CLIENT_ID;
const clientSecret = process.env.GOOGLE_CLIENT_SECRET;
if (!clientId || !clientSecret || !process.env.AUTH_SECRET) {
logAuthEvent('google_start_misconfigured');
res.statusCode = 503;
res.setHeader('Content-Type', 'text/html; charset=utf-8');
res.end('<!doctype html><title>Auth unavailable</title><p>Sign-in is not configured yet. Set GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, and AUTH_SECRET.</p>');
return;
}

const next = sanitizeNextPath(req.query && req.query.next);
const state = randomBytes(24).toString('hex');
const statePayload = Buffer.from(JSON.stringify({state, next}), 'utf8').toString('base64url');
const baseUrl = getAuthBaseUrl(req);
const redirectUri = `${baseUrl}/api/auth/callback`;

const params = new URLSearchParams({
client_id: clientId,
redirect_uri: redirectUri,
response_type: 'code',
scope: 'openid email profile',
state,
access_type: 'online',
prompt: 'select_account'
});

logAuthEvent('google_start');
res.statusCode = 302;
res.setHeader('Set-Cookie', serializeCookie(OAUTH_STATE_COOKIE, statePayload, {
maxAge: STATE_MAX_AGE_SEC,
httpOnly: true
}));
res.setHeader('Location', `https://accounts.google.com/o/oauth2/v2/auth?${params.toString()}`);
res.setHeader('Cache-Control', 'no-store');
res.end();
}
29 changes: 29 additions & 0 deletions api/auth/logout.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import {
SESSION_COOKIE,
clearCookie,
isAuthDisabled,
logAuthEvent
} from '../../lib/auth/session.mjs';

export default async function handler (req, res) {
if (req.method !== 'POST' && req.method !== 'GET') {
res.statusCode = 405;
res.end('Method Not Allowed');
return;
}

logAuthEvent('logout');
res.setHeader('Set-Cookie', clearCookie(SESSION_COOKIE));
res.setHeader('Cache-Control', 'no-store');

if (req.method === 'GET') {
res.statusCode = 302;
res.setHeader('Location', '/login');
res.end();
return;
}

res.statusCode = 200;
res.setHeader('Content-Type', 'application/json');
res.end(JSON.stringify({ok: true, disabled: isAuthDisabled()}));
}
39 changes: 39 additions & 0 deletions api/auth/me.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import {
isAuthDisabled,
readSessionFromRequest
} from '../../lib/auth/session.mjs';

export default async function handler (req, res) {
if (req.method !== 'GET') {
res.statusCode = 405;
res.end('Method Not Allowed');
return;
}

res.setHeader('Cache-Control', 'no-store');
res.setHeader('Content-Type', 'application/json');

if (isAuthDisabled()) {
res.statusCode = 200;
res.end(JSON.stringify({
authenticated: true,
disabled: true,
user: {sub: 'dev', email: 'dev@localhost', name: 'Dev', picture: ''}
}));
return;
}

const user = await readSessionFromRequest(req);
if (!user) {
res.statusCode = 401;
res.end(JSON.stringify({authenticated: false}));
return;
}

res.statusCode = 200;
res.end(JSON.stringify({
authenticated: true,
disabled: false,
user
}));
}
Loading