2017 was a great year for Shopify (NYSE:SHOP) investors, who watched their stock surge 140% on a streak of robust sales growth and bottom line improvements. But after that big run investors might be wondering if the e-commerce services provider will run out of steam next year. Let's take a closer look at Shopify's biggest headwinds and tailwinds to find out.

Proving the shorts wrong

Shopify's rally boosted its price-to-sales ratio to 17, compared to the industry average of 6 for software makers. Since it isn't consistently profitable, it can't be valued by traditional P/E ratios. This means that it could drop quickly during a market rout.

A shopping cart icon displayed on a smartphone.

Image source: Getty Images.

It also makes Shopify an easy target for short sellers like Citron Research, which claims that the company "oversells" the ability of its customers to make money, and that its core business is essentially a "get-rich-quick scheme" aimed at small businesses which will eventually flop.

During last quarter's conference call, Shopify CEO Tobi Lütke called Citron's Andrew Left a "short selling troll" and that his claims were "unsubstantiated" and "an insult" to its merchants.

However, Shopify still hasn't fully recovered to the levels before Citron's report on Oct. 4, so Shopify might need to address the issue again.

Impressive revenue growth

Shopify's revenue rose 95% in 2015 and 90% in 2016, and analysts expect another 70% growth this year. Its year-over-year growth is gradually slowing down, but it still has plenty of room to run as more small businesses digitize.

Lütke believes that Shopify could become a "100 year company" since there will always be demand from brick-and-mortar companies to digitize their businesses. Lütke might be right, since Shopify doesn't have many direct competitors.

The biggest threat was once Amazon's (NASDAQ:AMZN) WebStore, a similar platform which was launched in 2010. But WebStore eventually flopped, and Amazon shuttered the service in 2015 and integrated its marketplace with Shopify's platform.

The expansion of its ecosystem

To lock in customers, Shopify has been aggressively expanding its ecosystem with new features. That ecosystem includes Shopify Pay, which stores customers' payment data; a point-of-sale card reader; a wholesale channel for buyers; and new APIs (application programming interfaces) which let developers integrate Shopify's platform into their apps.

It also recently added a new Instagram channel which showcases its merchants, a partnership with "global fashion search engine" Lyst, bulk label printing capabilities, and new augmented reality features for mobile apps.

Many of these improvements are boosting mobile traffic to merchants' stores, which hit 74% of all traffic and 62% of all orders last quarter -- up from 72% of all traffic and 60% of all orders in the previous quarter.

Potential profitability in 2018

The bears often cite Shopify's lack of profitability as its Achilles' heel. However, its losses have been narrowing over the past few quarters, resulting in an adjusted (non-GAAP) operating profit of $1.7 million last quarter -- compared to an adjusted loss of $2.2 million in the prior year quarter. It also reported a net profit of $5 million, versus an adjusted loss of $1.8 million a year earlier.

That profit, its first as a public company, arrived "a quarter sooner than anticipated" according to CFO Russ Jones. Jones noted that although Shopify "clearly demonstrated" its ability to achieve an operating profit, its "focus continues to be on growth."

Analysts expect Shopify to post adjusted earnings of $0.05 per share for fiscal 2017 and an EPS of $0.27 in 2018. If the company can hit those targets, it could prove its naysayers wrong.

The key takeaways

I previously stated that Shopify's best days were ahead, and I stand by that assertion. The company has stellar growth, doesn't face any meaningful competition, and is finally on track to post its first full-year profit. The stock will still be volatile, but I'd rather buy it on the dips than take profits.

John Mackey, CEO of Whole Foods Market, an Amazon subsidiary, is a member of The Motley Fool's board of directors. Leo Sun owns shares of Amazon. The Motley Fool owns shares of and recommends Amazon and Shopify. The Motley Fool has a disclosure policy.