Sentinel is a real-time messaging and moderation platform designed to facilitate secure and clean communication. It is composed of several independent services that work together to provide a robust and scalable solution.
The project is organized into the following main directories:
apps/: Contains the core applications of the Sentinel platform.api/: The RESTful API service for handling user authentication, channel management, and message persistence.gateway/: The WebSocket gateway responsible for real-time communication between clients and the backend services.worker/: A background worker service for processing tasks like message moderation and event handling.
packages/: Contains shared libraries and utilities used across different applications.common/: A package for shared types, constants, and event definitions.
infra/: Contains infrastructure-related configurations, such as Docker files and orchestration.docs/: Documentation files related to the project architecture, moderation flow, and other aspects.
To get started with the Sentinel project, follow these steps:
- Node.js (v20 or higher recommended)
- npm or Yarn (npm is used in the examples)
- Docker and Docker Compose (for running local databases and services)
-
Clone the repository:
git clone https://github.com/your-repo/sentinel.git cd sentinel -
Install dependencies for each application and package:
# For the API application cd apps/api npm install cd ../.. # For the Gateway application cd apps/gateway npm install cd ../.. # For the Worker application cd apps/worker npm install cd ../.. # For the Common package cd packages/common npm install cd ../../..
Each application can be run independently.
The API service handles user authentication, channel management, and message persistence.
cd apps/api
npm run dev # For development with hot-reloading
# Or
npm start # For production buildThe Gateway service manages WebSocket connections for real-time communication.
cd apps/gateway
npm run dev # For development with hot-reloading
# Or
npm start # For production buildThe Worker service processes background tasks, such as message moderation.
cd apps/worker
npm run dev # For development with hot-reloading
# Or
npm start # For production buildTo build the TypeScript source code for each application:
# For the API application
cd apps/api
npm run build
cd ../..
# For the Gateway application
cd apps/gateway
npm run build
cd ../..
# For the Worker application
cd apps/worker
npm run build
cd ../..You can use Docker Compose to set up local instances of PostgreSQL and Redis, which are used by the Sentinel services.
cd infra
docker-compose up -dThis will start PostgreSQL and Redis containers in the background.
We welcome contributions! Please see our CONTRIBUTING.md (if available) for guidelines on how to contribute to this project.
This project is licensed under the ISC License.