Overview
The website pages that you have seen actually have 3 different aspects:- Skeleton (HTML): Imagine blocks when you are writing on Notion
- Skin (CSS): Styling
- Brain (JavaScript): Logics
HTML
Hyper Text Markup Language (HTML) is a file to define your website blocks and metadata.This is a required and main file that has to exist in order to create a website.
How to Start
Create a file called:index.html. Then press: ! + Tab inside your code editor.
Recommended editors:
- Visual Studio Code
- Cursor
- AntiGravity
Tags
Notice the pattern:Head vs Body
Head Tag
Inside<head> you usually place metadata such as:
- Title
- Description
- OpenGraph tags
- SEO information
Body Tag
Inside<body> is where the content of your website goes.
Examples:
Attributes
Tags can contain attributes. Example:srchrefalt
CSS
Cascading Style Sheets (CSS) is used to style your HTML elements. CSS cannot run alone. It must be connected to an HTML file.Linking CSS
Add this inside your<head>:
style.css
Custom Fonts
You can get fonts from: https://fonts.google.com. Search a font and copy the link tag into the<head>.
Base Styling Template
Common CSS reset:- Reset browser default spacing
- Prevent elements exceeding dimensions
CSS Selectors
Selectors target HTML elements. Types:- Tag selector
- Class selector
- ID selector
.→ class selector#→ id selector
Magic Element: Div
div is a container element used to group elements.
Example:
- wrapper
- container
- layout block
Layout Styling Template
Flexbox
Used for horizontal or vertical layouts- row
- column
Grid
Used for card-based layouts. Example:- Google Classroom style cards
JavaScript
HTML and CSS are not programming languages. They do not contain logic. JavaScript adds logic and interactivity.Linking JavaScript
Create:script.js. Add before closing body:
DOM Manipulation
JavaScript can select HTML elements and manipulate them. Example:- Select element
- Add click event
- Change style dynamically
React
React is one of the most used JavaScript frameworks today. It helps create:- Complex applications
- Multiple pages
- Reusable UI components
- Dynamic rendering
Getting Started
After creating a React project: Install dependencies:Components
Components make UI reusable. Example:React Hooks
Hooks are built-in React functions. Docs: https://react.dev/reference/react/hooksuseEffect
Runs side effects based on dependencies. Example:useState
Used to manage component state. Example:prev represents the current value.
TailwindCSS
TailwindCSS allows styling without writing CSS files. Docs: https://tailwindcss.com Install TailwindCSS IntelliSense extension for autocomplete.Basic Syntax
Colors
Size
Spacing
Layout
shadcn/ui
A component library that allows installing only the components you need. Docs: https://ui.shadcn.com AI builders usually use shadcn components instead of building UI from scratch.Next.js
Next.js is a fullstack framework built on React. Docs: https://nextjs.org Unlike React, Next.js includes:- Backend
- Frontend
- Routing
- API
- Lovable
- Orchids
Rendering Methods
Server Side Rendering (SSR)
Rendered on the server before reaching the browser. Use cases:- Metadata
- Protected pages
- Authentication validation
Client Side Rendering (CSR)
Rendered in the browser. Example:- Skeleton loading
- Fetching data after page load
Middleware
You can protect routes using middleware. Example file:- Authentication
- Session validation
- Access control
Routing
React
Requires: https://reactrouter.com/Next.js
Uses file-based routing. Example: Create page:Dynamic Routes
Folder:API Routes
Create API folder:Infrastructure
Vercel
https://vercel.com Next.js is built by Vercel. Features:- GitHub integration
- Automatic deployments
- CI/CD
Supabase
All-in-one backend platform. https://supabase.com Includes:- Database
- Authentication
- File storage
OpenRouter
AI API platform with free credits. https://openrouter.ai Allows integration with multiple AI models.Libraries
Prisma
https://www.prisma.io ORM used for database communication. Benefits:- Safer queries
- Prevent SQL injection
- Easy database manipulation
Better Auth
https://www.better-auth.com Authentication library supporting:- Email/password
- Google login
- OAuth
tRPC
https://trpc.io Allows easy creation of API endpoints and server logic.Bonus
Starter kit with:- Prisma
- Better Auth
- tRPC