Add real backend: JWT auth, SQLite user storage, server-side file uploads#5
Draft
Add real backend: JWT auth, SQLite user storage, server-side file uploads#5
Conversation
Co-authored-by: codenimar <119526795+codenimar@users.noreply.github.com> Agent-Logs-Url: https://github.com/codenimar/blebetalo/sessions/f2c68aaf-6892-4839-bf5e-4cd1ba021cfd
Copilot
AI
changed the title
[WIP] Add working login functionality with database storage
Add real backend: JWT auth, SQLite user storage, server-side file uploads
Mar 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Login was entirely frontend-simulated with no persistence. This adds a Node.js/Express backend with real auth, a SQLite database, and authenticated file uploads.
Backend (
server/)server/index.js— Express API with:POST /api/auth/register/POST /api/auth/login— bcrypt-hashed passwords, JWT (7-day) responseGET /api/auth/me— token validation for session restorePOST /api/upload— multer-based image/audio upload (20 MB limit, mime-type validated), stored underserver/uploads/, recorded in DBusers,uploads) auto-created viabetter-sqlite3express-rate-limit(20 req/15 min auth, 10 req/min upload)JWT_SECRETenv var is unset whenNODE_ENV=productionFrontend
Login.js— Login/Register tabs; calls real API via axios; stores JWT inlocalStorage; surfaces server error messagesApp.js— Restores session on mount viaGET /api/auth/me; clears JWT on logout; removed Google-login stubAdminPanel.js— POSTs files to/api/uploadwith ******; shows local blob preview immediately while upload completes asyncConfig
package.json:"proxy": "http://localhost:5000",npm run devviaconcurrently,npm run server.gitignore: excludesserver/uploads/andserver/blebetalo.dbnpm run dev # Express on :5000 + React on :3000⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.