DEV Community

Cover image for Modern API Development (Part 1)
Mitch Chimwemwe Chanza
Mitch Chimwemwe Chanza

Posted on • Updated on • Originally published at .mitch.guru

Modern API Development (Part 1)

Throughout this series, we will construct a comprehensive backend utilizing contemporary tools and cutting-edge concepts. My earnest desire is for you to accompany this journey from its inception, following the episodes in the order of their publication. This sequential approach is designed to facilitate a thorough understanding of the foundational concepts, making it particularly beneficial for beginners. However, if you happen to be an expert in the field, feel free to leverage your skills and customize the process to align with your specific objectives. Whether you're just starting out or a seasoned professional, there's something valuable for everyone in this series as we delve into the intricacies of backend development.

Please note that there will be coresponding youtube videos for each topic we cover in this series

Project Setup

Let's initiate the project setup and push it to GitHub. In this endeavor, we will be employing various frameworks, libraries, and programming languages. The selection of tools is independent of the project structure. Below is a list of tools we will be utilizing:

  • Node.js 18
  • PNPM - Package Manager (PNPM will also be employed for managing a monorepo)
  • Hasura - GraphQL Tool
  • GraphQL - Schema Engine
  • Express - Server
  • Prisma - ORM
  • Postgres - Database

As the project progresses, additional tools may be incorporated into this list.

Create a Monorepo

Assuming PNPM is installed (for installation instructions, refer to pnpm), let's create a monorepo:

mkdir myproject-monorepo
cd myproject-monorepo
# Create an API folder
mkdir api
# Initialize PNPM project
pnpm init
# Initialize PNPM monorepo configuration
touch pnpm-workspace.yaml
# Add the following in the workspace file
    packages:
        - "api"
        - "frontend" # This is optional for now
# setup api project
cd api
# initialize  project
pnpm init
# install initial dependencies
pnpm add -D typescript @types/node
# initialize typescript
npx tsc --init 
# modify tsconfig.json to suit your development requirements. you might want to enable more features in that file.


Enter fullscreen mode Exit fullscreen mode

With these steps completed, we are prepared to weave together the components of our project. This marks the beginning of our successful project journey.

Dive into part 2 of this series.

It is advisable to commit our modifications and push them to the GitHub repository. This precaution ensures that, in the event of any issues with our local version, we can easily retrieve the latest version from the remote repository. For further insights on GitHub and its functionalities .

Top comments (0)