Folsom, Calif., resident Brian Esola never had any formal training in construction or engineering — he works in insurance. But at the beginning of this year, over the course of late nights and long weekends, he constructed an elaborate treehouse.

At first glance, it looks like a small shed, painted deep blue with white trim and a red door, curiously floating 7 feet above the ground. But closer inspection reveals it's not floating at all. It's mounted securely on a platform between two trees, with a ladder for access and another ladder on the inside going to the second story.

It's big enough — and sturdy enough — to hold up to six grown men, Esola said, and it's fun for his four kids and their friends to spend time in.

But after a complaint by an anonymous resident, the city determined the treehouse is not in compliance with codes. So there's a chance Esola will have to take it down.

The city characterizes the treehouse as an "accessory" building, which is defined as a detached, subordinate building. Christine Brainerd, spokeswoman for the Folsom city manager, said accessory buildings must be at least 5 feet from property lines and no more than 15 feet tall.

There are three problems with the treehouse. It's "very close" to the property line, Brainerd said. And it's approximately 21 feet tall — after you add its 7-foot elevation from the ground. It was also bolted to a sound wall without permission from the city.

Before he started construction, Esola said, he took a look through the city codes to make sure he was in compliance. For example, Esola didn't put in any electricity or plumbing because he knew that was against city codes.

"I did my homework," Esola said. "It's not like I just threw this thing up."

After Esola was first notified of the code violations, one of his neighbors posted pictures of his treehouse on the Facebook group Folsom Chat. The post's comments section flooded with people supporting Esola's treehouse, lamenting its possible removal and offering to help.

Folsom City Council member Robert Gaylord, who first heard about the treehouse through the Facebook post, reached out to Esola and offered to connect him with city officials who could help him resolve the problem.

"The biggest thing I've done is just bring attention to the issue," Gaylord said. "Honestly, (the treehouse) is a work of art. It's beautiful. As a resident — it's outdoors, it's good for the kids and it just looks good."

And after talking with city officials, Esola was given the opportunity to try and convince the City Council to revise codes to include treehouse ordinances before he has to take down his creation. So, Esola soon will have three minutes to present his case in front of the City Council — and if he can wrangle three votes from council members, his treehouse might not be on the chopping block.

Esola stressed he's not angry with the city or its officials, adding they've been more than accommodating during this process. If it comes to it, he's willing to take down the treehouse. But he views this as a chance to create new ordinances for the city that specifically pertain to treehouses.

If there is any place where an elaborate treehouse should be, Esola and Gaylord believe it's Folsom.

Folsom's motto is "Distinctive by Nature." And Esola's treehouse — big, bright, straight out of a picture book — is definitely distinctive, a structure that many seem to think embodies Folsom's spirit.