use `locate-dominating-file' function to detect project root directory