Back What i do for living cover pic

What i do for living

3 min read
# Life

Hi therešŸ‘‹, Iā€™m Pavan Bhaskar the creator behind this blog. As you can guess, Iā€™m a šŸŒ Web Developer and i create websiteā€™s for living. My goal is to create websites to provide good web-experience for šŸ‘„humans

Iā€™m currently working at ContentQL as a Full-Stack Developer, and Iā€™m excited to share with you what weā€™re building there!

ContentQL

Managing content is a pain in the assšŸ™ƒ. So, how does ContentQL help you manage content easily? we create websites that give you more control over your website contentšŸ‘‡

Learn more about ContentQL herešŸ‘‡

So whatā€™s next? Sign up for a free account at ContentQL, weā€™ve a great free-tier to start. Iā€™ve been working on a theme hand-crafted for your blog-website itā€™s launching soonšŸŽŠ! stay tuned

Under the hood

Under the hood

Weā€™re using NextJS for the frontend & PayloadCMS as our backend. These two things open doors for lot of possibilities. Now Iā€™ll share how weā€™re leveraging PayloadCMS features!

Payload CMS

Before understanding whatā€™s PayloadCMS, letā€™s understand what is CMS.

CMS -> Content Management System, youā€™ll get admin interface where you can monitor or control few aspects of your website, here are few CMS examples: WordPress, ContentFul etcā€¦

Unlike WordPress, ContentFul or Sanity, PayloadCMS integrates with your NextJS App-router so when you deploy your app your admin panel also gets hosted at /admin route

Features

Iā€™ll demonstrate one small example of Payload schema VS Traditional MongoDB schemašŸ‘‡

import { Schema } from "mongoose";

// So here we've traditional MongoDB schema
export const userSchema = new Schema(
  {
    name: { type: String, required: true, lowercase: true, trim: true },
    age: { type: Number, required: true },
  },
  {
    timestamps: true,
  }
);

Payload schemašŸ‘‡, here we generally call schema as collections

import type { CollectionConfig } from "payload";

// So here we're mapping the fields to payload schema
export const Users: CollectionConfig = {
  slug: "users",
  fields: [
    {
      name: "name",
      label: "Name",
      type: "text",
    },
    {
      name: "age",
      label: "Age",
      type: "number",
    },
  ],
};

so you need to add this collection to you payload.config.ts file, youā€™ll have a collection on your admin panel.

Learn more about payload herešŸ‘‡

Tailwind CSS šŸ’…

For styling different themes weā€™re using Tailwind CSS, Theming is quite easy in tailwind & by default comes with a good design-system. Tailwind typography-plugin is dope for blog-page styling. Learn more about Tailwind CSS

And thatā€™s it for this blog, thanks for reading this far, stay tuned for more updates peaceāœŒļø