Skip to content

Batteries-included backend that works with any stack.

License

Notifications You must be signed in to change notification settings

ChrisPdgn/Conduit

 
 

Repository files navigation


logo

The only Backend you'll ever need. Written in NodeJS, works with any stack

CodeFactor Badge Latest SemVer Release Commit Activity Discord Server

Conduit Platform

Conduit is a NodeJS-based Self-Hosted backend, that aims to cut down development times by providing ready-made modules that offer common functionality out of the box, and allowing maximum flexibility to add custom functionality.

Check out our docs here: Documentation
Wanna see what comes next: Roadmap
Help us make Conduit great: Contribute
Learn more: Website

Features ✔️

  • Transports: REST, GraphQL, WebSockets (via Socket.io) and gRPC
  • Database support for MongoDB and PostgreSQL
  • In-memory database through Redis
  • All functionalities and routes available both as REST and GraphQL endpoints
  • CMS module to create and edit schemas from the admin panel and also add custom logic through the "custom endpoints" functionality
  • Swagger docs and GraphQL explorer with full route documentation
  • Authentication system with JWT and 2FA, supporting ServiceAccounts/API keys as well as local(username/password or email/password), oAuth(Facebook, Google, Twitch)
  • Basic security built-in with Client Id/secret for all requests, rate limiting and Helmet.
  • Emails with template support
  • SMS for 2FA or plain SMS send
  • Storage using S3, GCS and Azure Blob Storage
  • Chat
  • Forms for basic form submission and email forwarding
  • Conduit SDK can be used to add new modules or custom services
  • so much more

Requirements ⚡

  • NodeJS >= 16 or Docker
  • MongoDB or PostgreSQL
  • Desire to create something awesome

Quickstart

This script uses docker compose to spin up some basic modules for you to test.

source <(curl -s https://getconduit.dev/bootstrap)

Open http://localhost:8080 to check the admin panel (username: admin, password: admin)

Your application API will be on http://localhost:3000
Your administration API will be on http://localhost:3030

Check out Swagger on: /swagger and /admin/swagger
Check out GraphQL on /graphql

Running from source 🔨

yarn
npx lerna run build
REDIS_HOST=localhost REDIS_PORT=6379 yarn --cwd ./packages/core start
CONDUIT_SERVER=0.0.0.0:55152 SERVICE_URL=0.0.0.0:55165 DB_CONN_URI=mongodb://localhost:27017 yarn --cwd ./modules/database start

Then repeat the following step for every additional module you wish to bring online, specifying any additional env vars.

CONDUIT_SERVER=0.0.0.0:55152 SERVICE_URL=0.0.0.0:PORT yarn --cwd ./modules/MODULE start

Environment Variables 📃

Core:

Variable Description Required Example
REDIS_HOST Redis Address True localhost
REDIS_PORT Redis Port True 6379
ADMIN_HTTP_PORT Port to be used by admin REST and GrahpQL APIs False 3030
ADMIN_SOCKET_PORT Port to be used by admin WebSockets API False 3030
GRPC_PORT Port to be used by the gRPC server False 55152
MASTER_KEY Master Secret False M4ST3RK3Y
GRPC_KEY Specifying a secret enables gRPC signed request protection False someRandomSecret
SERVICE_MONITOR_INTERVAL_MS Service discovery monitor interval in ms (default: 30000) False 5000
SERVICE_RECONN_RETRIES Reconnection attempts before removal of offline services (default: 5) False 5
SERVICE_RECONN_INIT_MS Initial delay for linear backoff reconnection to offline services in ms (default: 250) False 125
DEBUG__DISABLE_SERVICE_REMOVAL Prevent removal of offline services False true

Database

Variable Description Required Example Default
DB_CONN_URI DB Connection URI False postgres://conduit:pass@localhost:5432/conduit mongodb://localhost:27017
DB_TYPE DB Engine Type False postgres mongodb

Generic module env variables are also supported, with required ones being obligatory.

Router

Variable Description Required Example
CLIENT_HTTP_PORT Port to be used by application REST and GrahpQL APIs False 3000
CLIENT_SOCKET_PORT DPort to be used by application WebSockets API False 3001

Generic module env variables are also supported, with required ones being obligatory.

Generic Module

Variable Description Required Example
CONDUIT_SERVER Conduit Core's address and port True 0.0.0.0:55152
SERVICE_URL This should be where this service listens on. If behind a LB it should point to the LB's IP/DNS False 0.0.0.0:55190
GRPC_PORT Port to be used by the gRPC server False 55190
GRPC_KEY Specifying a secret enables gRPC signed request protection (use across modules) False someRandomSecret

About

Batteries-included backend that works with any stack.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.4%
  • Other 1.6%