What i do for living
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š
- Entire website content is editable ā
- Comes with access-control šØ, you can restrict who can do what!
- Comes with variety of themes š«
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
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
- Comes with good Admin-panel UI
- You can use both sql & no-sql databases
- Comes with Access Control
- Automatic type generationš„
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āļø