Sign inSign up

jodurpar/dsmongodbapi

By jodurpar

Updated 7 months ago

Mongo general api

Image
0

806

jodurpar/dsmongodbapi repository overview

Generic MongoDB Data Proxy (V2.0)

A high-performance, secure proxy for MongoDB built with Fastify and TypeScript. It features Role-Based Access Control (RBAC), dynamic query parsing, and interactive Swagger documentation.

🚀 Quick Start

1. Pull the image
docker pull jodurpar/dsmongodbapi:latest
2. Run the container

By default, the API listens on port 15240 and connects to mongodb://localhost:27017.

docker run -d \
  --name dsmongodb \
  -p 15240:15240 \
  -e MONGODB_URI="mongodb://your-mongo-host:27017" \
  jodurpar/dsmongodbapi:latest

⚙️ Configuration (Non-Standard Mongo Port)

If your MongoDB instance is running on a non-standard port (e.g., 27018, 27019), you must specify it in the MONGODB_URI environment variable.

Example for Custom Port:
docker run -d \
  --name dsmongodb \
  -p 15240:15240 \
  -e MONGODB_URI="mongodb://host.docker.internal:27018" \
  jodurpar/dsmongodbapi:latest
Environment Variables:
VariableDescriptionDefault
PORTAPI listening port15240
MONGODB_URIMongoDB connection stringmongodb://localhost:27017
MONGODB_DATABASEDefault database nametest
LOG_LEVELLogging level (trace, debug, info, etc.)info

📖 Usage

Once running, access the interactive documentation at: http://localhost:15240/docs

For detailed CRUD examples and coding integration, visit the GitHub Repository.

🧪 Testing

The project includes a suite of unit tests built with Jest to ensure query parsing and connection management accuracy. To run them locally:

npm test

🔐 Security

Ensure you configure your RBAC settings if you intend to use this in production. The proxy requires client-authorization headers for mapped roles.


© 2026 José Durán Pareja. Released under the MIT License.

Tag summary

Content type

Image

Digest

sha256:fdc670b0a

Size

66.7 MB

Last updated

7 months ago

docker pull jodurpar/dsmongodbapi