- 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 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 operationsextras/- Extra files/functionshandlers/- Event handlers and middlewarelog/- Logging functionalitytasks/- Scheduled tasks and background jobsutils/- Utility functions and helpers
scripts/- Additional scripts and toolsapps/twitchClipper/- Go-based Twitch clipping functionality
The bot includes a built-in HTTP api server for monitoring and uptime tracking:
/- Detailed status with uptime information
The api server runs on port 3000 by default. You can customize this by setting the STATUS_PORT environment variable:
STATUS_PORT=8080{
"status": "running",
"uptime": 3600,
"uptimeFormatted": "1h 0m 0s",
"startTime": 1703123456,
"connectedChannels": 1,
"channelsToJoin": 1
}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