Install the following before running the server:
Node.js20 or newerpnpmGit
Recommended package manager: pnpm
This repository currently contains both pnpm-lock.yaml and package-lock.json, but the project hooks use pnpm, so use pnpm for local development.
From the project root:
pnpm installProject root:
Sagol360ManagementServer/
Start the development server:
pnpm devThe server should start on:
http://localhost:3000
Swagger API documentation should be available at:
http://localhost:3000/api-docs
After running pnpm dev, open:
http://localhost:3000
Expected response:
Hello Express + TypeScript (MVC)
You can also test it from the terminal:
curl http://localhost:3000Compile the TypeScript source into dist/:
pnpm buildRun the compiled server:
pnpm startProduction start command:
node dist/index.jsThe server uses environment variables for configuration. Create a local .env file based on
.env.example:
CORS_ORIGIN=http://localhost:5173
PORT=3000
MONGO_URI=mongodb://127.0.0.1:27017/sagol360managementserverCORS_ORIGIN is required. In production, set it to the deployed frontend origin.
Do not commit real secrets to Git.
The project has mongoose installed and includes an example Mongoose model:
src/models/exampleModel.mongoose.ts
However, in the currently checked-in source, the server does not connect to MongoDB during startup.
Current behavior:
- No active
mongoose.connect(...)call runs fromsrc/index.ts - MongoDB is not required to start the current server
- The existing endpoint
/returns a static example response
If a feature branch adds real database-backed modules, make sure MongoDB is running and configure:
MONGO_URI=mongodb://127.0.0.1:27017/sagol360managementserversrc/
app.ts Express app setup, middleware, routes, Swagger
index.ts Server entry point
controllers/ Request handlers
routes/ API route definitions
services/ Business logic
models/ Mongoose models
middleware/ Express middleware
utils/ Shared utilities
db/ Local example JSON data