Choosing tech stack for online store with web and mobile apps

Hey everyone! I’m about to start building an online store with both a website and mobile app. I’m not sure what tech to use for the front and back end. At first I thought about using React.js, Node.js, and MongoDB for the web part, then React Native for mobile. But now I’m second-guessing myself.

I know HTML, CSS, JavaScript, and .NET pretty well. What would you recommend for this kind of project? I want something that works well for both web and mobile.

Here’s a quick example of what I was thinking for the web app:

// Basic React component
function ProductList() {
  const [items, setItems] = useState([])

  useEffect(() => {
    fetchProducts()
  }, [])

  async function fetchProducts() {
    const response = await fetch('/api/products')
    const data = await response.json()
    setItems(data)
  }

  return (
    <div>
      {items.map(item => (
        <ProductCard key={item.id} product={item} />
      ))}
    </div>
  )
}

Does this approach make sense? Or should I consider other options? Thanks for any advice!

Your tech stack choice is solid for cross-platform development. React.js and React Native share a lot of code, which can speed up development. For the backend, Node.js with MongoDB is a popular combo, but consider using a relational database like PostgreSQL if you need complex data relationships or transactions.

One suggestion: look into using TypeScript. It can help catch errors early and improve code maintainability, especially as your project grows. Also, for state management in larger apps, consider Redux Toolkit or MobX - they can simplify complex state logic.

For the mobile app, React Native is a good choice given your JavaScript background. However, be prepared for some platform-specific code and occasional performance tuning.

Lastly, don’t forget about testing. Jest for unit tests and Cypress for end-to-end tests can help ensure your store runs smoothly across platforms.

yo ClimbingMountain, ur stack sounds decent but have u thought bout using a headless CMS like Strapi? it can make content management way easier for ur store. Also, for mobile, maybe check out Ionic? its pretty cool for hybrid apps. just my 2 cents tho. wutever u choose, make sure to test thorougly on different devices. good luck with ur project dude!

Hey there ClimbingMountain! :wave:

Your tech stack idea sounds pretty solid, but have you considered using a framework like Next.js instead of plain React? It could give you some nice benefits for SEO and performance right out of the box.

I’m curious, what kind of products are you planning to sell in your store? That might influence some of the tech decisions. For example, if you’re dealing with a lot of real-time inventory updates, you might want to look into websockets or GraphQL subscriptions.

Also, have you thought about how you’ll handle payments? Stripe is pretty popular, but there are other options too. What’s your take on that?

For the mobile app, React Native is a good choice if you’re already familiar with React. But have you looked into Flutter at all? It’s been gaining a lot of traction lately.

Your code snippet looks good! Just wondering, how are you planning to handle state management for more complex scenarios? Redux, MobX, or something else?

Let me know what you think! Always excited to chat about different tech approaches. :blush: