Skip to content

ColmanDevClubORG/Sagol360ManagementServer

Repository files navigation

Sagol360 Management Server

Prerequisites

Install the following before running the server:

  • Node.js 20 or newer
  • pnpm
  • Git

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.

Install Dependencies

From the project root:

pnpm install

Project root:

Sagol360ManagementServer/

Run The Server In Development

Start the development server:

pnpm dev

The server should start on:

http://localhost:3000

Swagger API documentation should be available at:

http://localhost:3000/api-docs

Verify The Server Works

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:3000

Build For Production

Compile the TypeScript source into dist/:

pnpm build

Run the compiled server:

pnpm start

Production start command:

node dist/index.js

Environment Variables

The 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/sagol360managementserver

CORS_ORIGIN is required. In production, set it to the deployed frontend origin.

Do not commit real secrets to Git.

Database Status

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 from src/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/sagol360managementserver

Project Structure

src/
  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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors