How liavhv/apinodemssql works
This Node.js/Express Web API demonstrates user registration and JWT login alongside state and municipality catalog management backed by SQL Server. Clients submit JSON requests; registration validates and hashes credentials before storing a user, login verifies them and returns a token, and bearer-token middleware gates the catalog routes. Those routes read and modify states and municipalities through a shared SQL connection helper. The README also documents SQL Server setup and the main endpoint examples. Relationships below follow the sampled route mounting, middleware, and database calls; no separate SQL schema node is inferred from the tree.
Main entry points: index.js Express App · sqlCon.js SQL Connection · registrarUsuario.route.js User Registration · login.route.js User Login
Components 9
API Runtime
- Express App
src/index.js
Identity
- User Registration
src/routes/registrarUsuario.route.js - User Login
src/routes/login.route.js - JWT Guard
src/verificarToken.js
Catalog Data
- State Routes
src/routes/estados.route.js - Municipality Routes
src/routes/municipios.route.js
SQL Persistence
- SQL Connection
src/sqlCon.js - SQL Server
Other components
- API Client
Connections 11
- API Client → Express App: sends HTTP
README.md - Express App → User Registration: mounts route
src/index.js - Express App → User Login: mounts route
src/index.js - Express App → JWT Guard: guards catalog
src/index.js - Express App → State Routes: mounts route
src/index.js - Express App → Municipality Routes: mounts route
src/index.js - User Registration → SQL Connection: gets connection
src/routes/registrarUsuario.route.js - User Login → SQL Connection: gets connection
src/routes/login.route.js - State Routes → SQL Connection: queries database
src/routes/estados.route.js - Municipality Routes → SQL Connection: queries database
src/routes/municipios.route.js - SQL Connection → SQL Server: connects
src/sqlCon.js