- Clone the repository and initialize submodules:
git clone https://github.com/leafyzito/jsFolhinha.git
cd jsFolhinha
git submodule update --init --recursive- Copy
.env.exampleto.envand fill in your credentials
For MongoDB setup (collections, indexes, first-time config), env vars, and optional services, see docs/setup.md in the docs folder.
For development and testing without all services:
- Install dependencies:
npm install- Run the application:
npm run devFor running the complete application with all services (including Cobalt and Twitch Clipper):
- Make sure you have Docker and Docker Compose installed
- Ensure the environment variable ENV is set to 'prod' in docker-compose.yml (or 'dev' for testing)
- Start the application:
docker compose up -dTo stop the application:
docker compose downmain.js- Main application entry pointsrc/- Source code directoryapis/- API integrationsclients/- Client connectionscommands/- Bot commands and handlersdb/- Database operations (schemas/has JSON Schema per collection)extras/- Extra files/functionshandlers/- Event handlers and middlewarelog/- Logging functionalitytasks/- Scheduled tasks and background jobsutils/- Utility functions and helpers
scripts/- Additional scripts and tools (e.g.init-mongo.js,backup-db.js)docs/- Developer documentationapps/twitchClipper/- Go-based Twitch clipping functionality
The bot includes a built-in HTTP API server for monitoring and uptime tracking.
**/**— Status payload with uptime and channel counts**/commands**— List of registered commands and metadata**/plus**— Dev, admin, Plus, and supporter users from the database (for internal / ops use)
The API server listens on port 3323 by default (see docker-compose.yml). Override with STATUS_PORT:
STATUS_PORT=8080{
"status": "running",
"uptime": 3600,
"uptimeHumanized": "1h 0m 0s",
"startTime": 1703123456,
"connectedChannels": 1,
"stats": {
"totalCommandsUsed": 42,
"totalChannels": 1
}
}Exact fields may change as the handler evolves; see src/utils/api-server.js.
This project uses ESLint for code quality and consistency.
npm run lint- Check for linting issuesnpm run lint:fix- Automatically fix linting issues where possible
Feel free to contribute to the project by opening issues or submitting pull requests with your ideas :)
Before submitting code:
- Run
npm run lintto check for code quality issues - Run
npm run lint:fixto automatically fix any auto-fixable issues