How I built an E-commerce API with Adonis.Js

Samuel OlakadaSamuel Olakada
2 min read

Introduction

Hello! Welcome to my blog!!!

In this article, I'll write about a difficult backend task I experienced recently.

it will include;

  • why it was difficult and

  • the steps I took to overcome it

Why it was difficult

As part of my development, I decided to develop an E-commerce API. This was quite challenging because I haven't done it before and I was developing it using @adonisjs which I just started learning a few weeks prior. However the adonisjs docs and Adocasts screencasts really helped me.

Steps taken to overcome

The total steps can be broken down into the following;

  • planning

    • project research

    • decide API features

    • database modelling

  • execution

Planning

As with all projects, planning plays a vital role in the success. I started by researching on the various features an E-commerce API should have. I decided on features needed for my project. After that I worked on the database model, which I used dbdiagram to implement a pictorial representation(model) of the database relationships amongst other features.

Execution

The project consists of five(5) resources namely;

  • Users

  • Products

  • Categories

  • Carts

  • Orders

Models and Controllers were created as needed for each resource, Authentication was implemented using email and password. Appropriate Authorization was also implemented using adonisjs policies.

HNG Internship

I am currently enrolled in HNG 11, where I want to push and test my skills to the limit. I've been in HNG before, where I participated in the frontend stack. This time I'm in the backend stack.

My expectations include meeting other awesome developers, sharing ideas and ultimately grow with them.

To learn more about HNG, visit HNG Internship and HNG Hire.

0
Subscribe to my newsletter

Read articles from Samuel Olakada directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Samuel Olakada
Samuel Olakada