A Node.js / Express backend prototype for a social/community-style application.
This project combines several backend concerns in one codebase:
- REST APIs with Express
- MySQL persistence with Sequelize
- real-time communication with Socket.IO
- web push notification subscription support
- user registration, login, and email verification flows
It is best understood as a practical backend prototype rather than a polished production system.
backend_two appears to function as the backend counterpart of the dupia frontend project.
The codebase provides the backend foundation for handling:
- user signup and login
- email verification
- user/account data storage
- posts, chats, and documents
- push notification subscriptions
- real-time event delivery through Socket.IO
The overall structure suggests a social/community application that mixes user relationships, messaging, content, and collaboration features.
This repository is intended to serve the dupia frontend:
- this backend runs Socket.IO on port
4444 - it listens for:
getDocgetAllDocsaddDoceditDoc
The dupia frontend connects to http://localhost:4444 and emits those same exact events through its Angular document service.
That makes the pairing:
dupia = frontend client
backend_two = backend / API / real-time server
In other words, backend_two is not just a random Express experiment — it looks like the service layer behind a broader frontend application.
- Node.js
- Express
- Sequelize
- MySQL
- Socket.IO
- Web Push
- Nodemailer
- CORS / JSON API handling
server.js
Main backend entry point. Sets up Express, CORS, JSON parsing, route registration, database sync, and Socket.IO listeners.
app/models/index.js
Initializes Sequelize and registers the application models.app/models/user.model.js
Defines the user schema.- Additional models include:
- tutorials
- documents
- posts
- chats
- post interactions
- push subscribers
app/controllers/user.controller.js
Handles user creation, login, verification, referral-style ID generation, account lookup, and related user logic.- Push-related controllers handle browser push subscription flows.
- Document and other domain controllers support the real-time and REST layers.
The backend registers multiple route groups, including:
- user routes
- tutorial routes
- document routes
- post routes
- chat routes
- push routes
- subscription routes
app/routes/document.routes.js
Implements Socket.IO document events used by the frontend:getDocgetAllDocsaddDoceditDoc
This is the clearest integration point between backend_two and dupia.
views/public/app.js
Contains browser-side push subscription logic:- notification permission request
- service worker registration
- push subscription creation
- sending subscription data back to the backend
The server exposes multiple application routes and API structures through Express.
User data is stored with Sequelize/MySQL, including fields such as:
- name
- surname
- nickname
- password
- city
- role/permission
- verification status
- reference IDs
- phone
- birth date
- profile image info
- point / generation-style fields
The backend includes logic for:
- generating verification links
- sending verification email through a mail sender abstraction
- marking users as verified
The codebase includes:
- browser-side push subscription registration
- backend subscription endpoints
- web-push-related route structure
Socket.IO is initialized separately from the HTTP API server and used for:
- live updates
- collaborative document handling
- messaging/event-driven features
This is not just a login API or CRUD sample. The codebase tries to support a wider application scope, including:
- user relationships
- content
- chat
- documents
- notifications
This repo is meaningful because it shows a developer trying to build a backend that handles several real product concerns at once rather than only a small tutorial API.
The interesting part is not code polish, but scope:
- authentication / onboarding logic
- persistence
- notification support
- real-time layer
- multiple data models
- application-oriented routing
- clear coupling to a separate frontend project
That makes it more substantial than a basic Express starter project.
- The codebase is rough and not yet cleanly modularized.
- Some files, especially the user controller, are oversized and mix too many responsibilities.
- There are hardcoded values and environment-specific paths that should be externalized.
- Security, configuration management, and production readiness would need significant improvement before real deployment.
- Some naming and architecture decisions reflect active prototyping more than finished backend design.
This project appears intended to run alongside the dupia frontend.
Typical setup idea:
- configure the database
- start the Express backend
- make sure the API server and Socket.IO server are running
- run
dupiaseparately as the frontend client - keep Socket.IO available on port
4444for real-time features
Think of this as:
an early full-featured backend prototype for a social/community web application, built to support the dupia frontend with APIs, persistence, and real-time collaboration
It is stronger as evidence of practical backend experimentation than as a polished production portfolio piece.
- split large controllers into service layers
- move secrets and environment-specific values into configuration
- document all route groups clearly
- add setup instructions and database bootstrapping notes
- improve folder organization and naming consistency
- add authentication / authorization notes explicitly
- include example API requests
- document the frontend integration contract with
dupia
backend_two is a meaningful backend prototype that combines:
- Express REST APIs
- MySQL persistence via Sequelize
- Socket.IO real-time support
- push-notification subscription flow
- user/account verification logic
- multi-model application design
It is best understood as the backend side of a broader social/community application prototype, paired with the dupia frontend.