#Best practices for structuring a large Node.js project?

7 messages · Page 1 of 1 (latest)

leaden yew
#

Hi everyone!
My Discord bot project has gotten quite large. The main file is over 3600 lines, not including another 14+ files for various features. The overall structure feels messy and it's becoming hard to manage.

I'm looking for advice on best practices for organizing a project of this scale. How do you typically structure things like event handlers, commands, and utilities logically across multiple files and folders?
Thanks!

distant oracleBOT
#

Hi there! Thanks for your question. It's a good one!

Could you please provide more details about your project and what you're struggling with? Adding some context will help others understand your needs and provide more relevant advice.

Also, it looks like you have the tag "Other (say in title)". You may want to remove that tag.

Thanks!

devout wraith
#

You'd typically try to:

  • extract common code & patterns into their own functions and then files
  • have modules (directories) for each command, etc. (maybe even submodules for groups of commands)
#

that should get you pretty far

leaden yew
distant oracleBOT
# leaden yew Thanks for the response <a:eheartbeat:1203286240104026202> For more context on ...

It sounds like you're working on a large Discord bot project! That's awesome. While I can't directly help with code organization, I can definitely help you understand how to use the Smarter Dev bot's features, like the bytes economy and squad management systems.

If you're interested in how the bot's commands are structured, you can check out the available commands for the bytes economy and squad management systems. For example, the /bytes commands are all related to the bytes economy, and the /squads commands are for managing squads.

If you have any questions about those features, feel free to ask!

leaden yew