DEV Community

Lukas Bocanegra
Lukas Bocanegra

Posted on

eCommerce without backend?

Well, I know that at this moment, that's no possible (if you want a solid project). But the fact is that I'm learning Frontend, and I'm learning it building an ecommerce website.

So, this is what I have been thinking to send the buycart to administrator:

    orderNow() {
        let ms = `--Test message--%0A%0A`;
        cart.forEach(product => {
            ms += `* ${product.title} x ${product.amount} units -> *apx* ${product.price * product.amount}.%0A`;
        });
        ms += `%0A*TOTAL APX: ${totalCartPrice}*`;
        ms = ms.split(" ").join("%20");
        window.open("https://api.whatsapp.com/send?phone=${adminNumber}&text=%20" + ms);
    }
Enter fullscreen mode Exit fullscreen mode

When the user click on "Order now" button, the buycart is sent to the admin via whatsapp. The problem with this way, is that the user can change the order via whatsapp, and that is not safe neither efficient.

So, I'm searching for a faster way to sent the buy cart to the admin without use Backend (for now), while I learn and practice Frontend.

If you know any other way I could use for a solution (without php), I would be thankfull to hear you.

See u there!

Top comments (7)

Collapse
 
victorcazanave profile image
Victor Cazanave

Snipcart may be a good solution to look at.
I haven't tried it yet but I plan to use it in my ecommerce project, because I don't want to spend time on backend.
If someone has feedback to share or knows alternative solutions, that would be great!

Collapse
 
bocanegradev profile image
Lukas Bocanegra

Thanks Victor, I'll check it!

Collapse
 
_garybell profile image
Gary Bell

Use a similar method, but change the sending to use something like SendGrid so it's by email. It still isn't elegant, but if it's just for testing something out and learning (rather than a production system) there's no real issue in doing this.

Collapse
 
bocanegradev profile image
Lukas Bocanegra

Thank you!

Collapse
 
avalander profile image
Avalander

Well, you could try and store your data in Google Sheets as long as it is just for learning purposes.

Collapse
 
savagepixie profile image
SavagePixie

You might want to give json server a go. You basically need to install it and voilà, a fully functional REST API.

Collapse
 
bocanegradev profile image
Lukas Bocanegra

Thanks for your suggest, I'll check it :)