LearnSpace: full-stack educational whiteboard platform

Node.js/Express backend + vanilla JS frontend.
Features: real-time collaborative whiteboard (SSE), multi-page support,
LaTeX formulas, shapes/connectors, coordinate systems, number lines,
compass, zoom/pan, Catmull-Rom pencil smoothing, ruler/protractor with
rotation & resize controls, minimap navigation overlay, auto-measurements,
multi-page thumbnails sidebar, PNG export, page templates.
Student/teacher workflows: classes, assignments, library, dashboard.
Mobile responsive. SQLite (better-sqlite3).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Maxim Dolgolyov
2026-04-12 10:10:37 +03:00
commit be4d43105e
204 changed files with 118117 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
const router = require('express').Router();
const { register, login, me, updateProfile } = require('../controllers/authController');
const { authMiddleware } = require('../middleware/auth');
const rateLimit = require('../middleware/rateLimit');
const validate = require('../middleware/validate');
const loginLimiter = rateLimit({ windowMs: 60_000, max: 10, message: 'Слишком много попыток входа, подождите минуту' });
const registerLimiter = rateLimit({ windowMs: 60_000, max: 5, message: 'Слишком много регистраций, подождите минуту' });
const profileLimiter = rateLimit({ windowMs: 60_000, max: 10, message: 'Слишком много запросов, подождите минуту' });
const registerSchema = { body: {
email: { type: 'string', required: true, maxLen: 255, match: /^[^\s@]+@[^\s@]+\.[^\s@]+$/ },
password: { type: 'string', required: true, minLen: 6, maxLen: 128 },
name: { type: 'string', required: true, minLen: 1, maxLen: 100 },
}};
const loginSchema = { body: {
email: { type: 'string', required: true, maxLen: 255 },
password: { type: 'string', required: true, minLen: 1, maxLen: 128 },
}};
const profileSchema = { body: {
name: { type: 'string', minLen: 1, maxLen: 100 },
newPassword: { type: 'string', minLen: 6, maxLen: 128 },
currentPassword: { type: 'string', maxLen: 128 },
}};
router.post('/register', registerLimiter, validate(registerSchema), register);
router.post('/login', loginLimiter, validate(loginSchema), login);
router.get('/me', authMiddleware, me);
router.get('/profile', authMiddleware, me);
router.patch('/profile', authMiddleware, profileLimiter, validate(profileSchema), updateProfile);
module.exports = router;