There are so many sub-projects in the JIRA source code, is there some documents to explain what's purpose of every sub-project?
And how to debug the JIRA source code in local machine?
There isn't a document that explains each of the subfolders, etc in the JIRA Source Code but that would be beneficial. You can help get that created by going to https://jira.atlassian.com/secure/Dashboard.jspa and creating a feature request to have the developers publish and article such as the one you're seeking.
In regards to debugging JIRA, there are two articles that may help you:
Creating a Remote Debug Target
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot