A real-time one-to-one chat app built with Svelte, Express, and Socket.io, now with persisted user accounts and admin user management.
| Layer | Technology |
|---|---|
| Frontend | Svelte 4, Vite, Socket.io-client |
| Backend | Node.js, Express, Socket.io |
| Auth | bcryptjs, jsonwebtoken |
| Data | SQLite (better-sqlite3), Drizzle ORM + Drizzle Kit |
| Testing | Playwright |
git clone <repo-url>
cd svelte-messenger
npm install
Copy environment defaults:
cp .env.example .env
On Windows PowerShell:
Copy-Item .env.example .env
See .env.example for all options.
PORT: backend port (default 4000)JWT_SECRET: JWT signing key (required in production)ALLOWED_ORIGINS: comma-separated CORS origins for frontend URLsDATABASE_URL: SQLite file path (default ./messenger.db)Run frontend and backend in separate terminals.
Terminal 1 (frontend Vite dev server):
npm run dev
Terminal 2 (backend API + Socket.io server):
npm run start
By default:
npm run db:generate
npm run db:push
npm run db:migrate
npm run db:studio
npm test
├── server.ts # Express API + Socket.io backend
├── drizzle.config.ts # Drizzle Kit config
├── src/
│ ├── db/
│ │ ├── index.ts # Drizzle database client
│ │ └── schema.ts # Database schema
│ ├── App.svelte # Root app shell
│ ├── types.ts # Shared frontend types
│ └── components/
│ ├── Auth.svelte
│ ├── ChatBuddies*.svelte
│ └── AdminPanel.svelte
└── tests/ # Playwright tests