This guide walks you through getting SEAM API running locally — from cloning the repository to making your first authenticated HTTP request with a real JWT token. By the end you will have a working server, a registered user, and a valid token you can use to explore every protected endpoint.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/TheSerchCp/SEAM-API/llms.txt
Use this file to discover all available pages before exploring further.
Clone the repo and install dependencies
Clone the SEAM API repository and install all production and development dependencies with a single command:
npm install pulls every package listed in package.json, including nodemon as a dev dependency for automatic server restarts during development. You do not need to install anything globally.Node.js 18 or later is recommended. SEAM API uses
AsyncLocalStorage (available since Node 12.17) and Express 5, which requires Node 18+.Create the .env file
SEAM API validates required environment variables at startup and throws immediately if any are missing. Create a The variables
.env file at the project root before starting the server:PORT, DB_HOST, DB_USER, DB_PASSWORD, DB_NAME, and JWT_SECRET are required — the server will refuse to start without them. DB_PORT, JWT_EXPIRES_IN, and CORS_ORIGIN are optional and fall back to the defaults shown above.See the Configuration page for the full description of every variable, allowed values, and validation rules.Start the server
Use the dev script during local development. It starts the server with For a production environment where you want the Node.js process to run without the file watcher overhead, use:A successful startup prints the following to stdout:If a required environment variable is missing you will instead see:Fix the
nodemon, which watches for file changes and restarts automatically:.env file and restart.Register a user
With the server running, send a A successful registration returns HTTP The password is hashed with bcrypt before being stored — it is never saved in plaintext and is never returned in any response.
POST request to /api/v1/auth/register to create your first user. The roleId field assigns the user to an existing role in your database:201 Created with the new user’s data:Log in and retrieve your token
Send a The login response includes the JWT, its expiry, the user object, the role-filtered sidebar items, and the permissions assigned to the user’s role:Copy the value of
POST request to /api/v1/auth/login with the credentials you just registered:token — you will pass it in the Authorization header for every subsequent request to a protected endpoint.Make an authenticated request
Pass the token in the A successful response returns HTTP If the token is missing, expired, or malformed, the API returns
Authorization: Bearer header to call any protected endpoint. The following example retrieves the full list of users:200 OK with the users array:401 Unauthorized. If the token is valid but the user’s role does not have permission for the requested URI, the API returns 403 Forbidden.Real-time progress tracking with The server reads
X-Socket-ID — Once your frontend establishes a Socket.IO connection (authenticated with the same JWT), include the socket’s ID in every mutating request using the X-Socket-ID header:X-Socket-ID from the request context and uses it to emit operation:progress events (start → processing → success / error) directly to the exact browser tab that triggered the operation, enabling precise loading-state control on the client.