> Canonical URL: https://codingcat.dev/course/intro-to-solid-js/lesson/fundamentals

# Fundamentals | Intro to SolidJS | CodingCat.dev Course

[🧶 Intro to SolidJS](/course/intro-to-solid-js)Section 1.1 · Lesson 1 of 4[![](/logos/tags/solidjs-symbol-light.svg)![](/logos/tags/solidjs-symbol-dark.svg)SolidJS](/topic/solidjs)[![](/logos/tags/vite-symbol-light.svg)![](/logos/tags/vite-symbol-dark.svg)Vite](/topic/vite)[![](/logos/tags/html-symbol-light.svg)![](/logos/tags/html-symbol-dark.svg)HTML](/topic/html)[![](/logos/tags/javascript-symbol-light.svg)![](/logos/tags/javascript-symbol-dark.svg)JavaScript](/topic/javascript)[![](/logos/tags/react-symbol-light.svg)![](/logos/tags/react-symbol-dark.svg)React](/topic/react)[Next Lesson →](/course/intro-to-solid-js/lesson/basics)

# Fundamentals

![CodingCat.dev tutorial cover image](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/395d46343179b93440dac8f5f3164207fc2b04a6-1920x1080.png?w=1920&q=82&fit=max&auto=format)Lesson 1 / 4Course Lessons Outline▾1Getting Started
- [1.1Fundamentals](/course/intro-to-solid-js/lesson/fundamentals)

2Basics
- [2.1Solid Basics](/course/intro-to-solid-js/lesson/basics)
- [2.2Deployment](/course/intro-to-solid-js/lesson/deployment)

3SolidStart
- [3.1SolidStart](/course/intro-to-solid-js/lesson/solidstart)

## Project Structure and Vite Configuration

Create a blank directory called `intro-to-solid` and initialize a `package.json` file with either `pnpm` or `npm`.

Copied! 🐾

```
mkdir intro-to-solid
cd intro-to-solid
pnpm init
# npm i
```

Install the following project dependencies:

- `solid-js` - A reactive JavaScript UI library, updating directly on the DOM for high performance.
- `@solidjs/meta` - Tools for managing metadata within Solid applications, enhancing SEO.
- `@solidjs/router` - A router library for Solid, enabling single-page application creation.
- `vite` - A modern front-end build tool providing fast development experience via features like hot module replacement.
- `vite-plugin-solid` - A Vite plugin that adds Solid support, allowing Vite to compile Solid's syntax and reactivity system.

Copied! 🐾

```
pnpm add -D solid-js @solidjs/meta @solidjs/router vite vite-plugin-solid
# npm i -D solid-js @solidjs/meta @solidjs/router vite vite-plugin-solid
```

Add `vite` scripts to `package.json` for `dev`, `build`, and `preview`.

- `dev` is set to `vite` which starts the Vite development server. It provides features like hot module replacement and fast refresh, allowing you to instantly see changes as you develop your application.
- `build` is set to `vite build` which instructs Vite to build your project for production. It optimizes and minifies your code, resulting in smaller bundle sizes that load faster for your users. It typically outputs the build assets into a `dist` folder in your project directory.
- `serve` is set to `vite preview` which allows you to preview your built application in a local server environment. It serves the files generated by `vite build` from a local server, enabling you to preview the production build of your application before deploying it.

Also make sure that `type` is set to `module` in `package.json`.

Copied! 🐾

```
{
	"name": "into-to-solid",
	"description": "An example SolidJS application using Solid Router and Vite",
	"type": "module",
	"keywords": ["SolidJS"],
	"author": "Anthony Campolo",
	"license": "MIT",
	"scripts": {
		"dev": "vite",
		"build": "vite build",
		"serve": "vite preview"
	},
	"devDependencies": {
		"@solidjs/meta": "^0.28.0",
		"@solidjs/router": "^0.4.3",
		"solid-js": "^1.5.5",
		"vite": "^3.1.3",
		"vite-plugin-solid": "^2.3.6"
	}
}
```

Create a `vite.config.js` file.

Copied! 🐾

```
echo > vite.config.js
```

Vite works with multiple frameworks that use different syntaxes and file types like React, Vue, and Svelte. Vite will know what to expect and how to handle different frameworks through plugins in its configuration file.

Copied! 🐾📄 vite.config.jsjavascript

```
import { defineConfig } from 'vite';
import solidPlugin from 'vite-plugin-solid';

export default defineConfig({
	plugins: [solidPlugin()]
});
```

Here we have defined our Vite configuration with the Solid Plugin. It is imported as `solidPlugin` from `vite-plugin-solid` and added to the `plugins` array inside Vite's `defineConfig` helper.

### HTML Entry Point

Create an `index.html` file for our HTML entry point. This will be the page shell that our root DOM will render into.

Copied! 🐾

```
echo > index.html
```

The root Solid component will be imported as an ESM module from `/src/root.jsx` and set to the `src` attribute on `script`.

Copied! 🐾

```

		A First Look at Solid

		You need to enable JavaScript to run this app.

```

### Render Function

In a SolidJS application, the root `render` function is responsible for mounting your application to a DOM element. Create a file called `root.jsx` in a directory called `src`.

Copied! 🐾

```
mkdir src
echo > src/root.jsx
```

`render` is the root render function imported from `solid-js/web` and is analogous to `ReactDOM.render()` in a React application or `Vue.mount()` in a Vue application.

The root `render` function takes two arguments:

- The component that you want to render
- The DOM element you want to render it into

Copied! 🐾📄 src/root.jsxjsx

```
/* @refresh reload */
import { render } from 'solid-js/web';

function App() {
	return (

# A First Look at Solid

				[Learn Solid]()

	);
}

render(() => , document.getElementById('root'));
```

Here, the `App` component is the top-level component for the application where your main application logic resides. `document.getElementById('root')` is the DOM node that the application will be mounted to.

This is typically a `div` with an `id` of `root` in your HTML. Once this code runs, SolidJS will create an instance of `App`, mount it to the specified DOM node, and keep it up-to-date with the state of your application.

### Start Development Server

Run `pnpm dev` or `npm run dev` to start the development server on localhost.

Copied! 🐾

```
pnpm dev
# npm run dev
```

Open [localhost:5173](http://localhost:5173/) to view the running application in your browser. The page will reload if you make edits.

✏️ Visual Architecture Diagram

## how this course connects together.

Follow AJ through the layered stack topology from input contract to production output.

Let’s build it!✏️ Architecture Diagram: Intro to SolidJS: FundamentalsLAYERED SYSTEM STACKARCHITECTURE DIAGRAM[Diagram Walkthrough]Content-driven layered-stack diagram for Intro to SolidJS: Fundamentals: Getting Started -> Intro to SolidJS -> Verified Production Artifact.AAA Contrast Verified

## related deep dives.

[View All&rarr;](/blog)[![The Odin Project 1: Web Development Foundations (HTML, CSS, Flexbox & JS Basics)](https://cdn.sanity.io/images/hfh83o0w/production/fce6fcae58667ff3143db133eb6b57fbd9ec471f-1376x768.png?w=1376&q=82&fit=max&auto=format)](/course/odin-web-development-foundations)November 4, 2026[![](/logos/tags/html-symbol-light.svg)![](/logos/tags/html-symbol-dark.svg)HTML](/topic/html)[![](/logos/tags/css-symbol-light.svg)![](/logos/tags/css-symbol-dark.svg)CSS](/topic/css)[![](/logos/tags/javascript-symbol-light.svg)![](/logos/tags/javascript-symbol-dark.svg)JavaScript](/topic/javascript)[+1](/course/odin-web-development-foundations)

### [The Odin Project 1: Web Development Foundations (HTML, CSS, Flexbox & JS Basics)](/course/odin-web-development-foundations)

Master the complete Odin Project Foundations path modernized for 2026: how the web works, semantic HTML5, CSS Box Model & Flexbox, and JavaScript DOM fundamentals.

[![Alex Patterson](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/a606dfaa381aab08ddbe16a33fe1d3e1fb37c927-400x400.jpg?w=96&h=96&q=82&fit=max&auto=format)Alex Patterson](/author/alex-patterson)[![The Odin Project 4: JavaScript Deep Dive (Closures, Event Loop, Async & TDD)](https://cdn.sanity.io/images/hfh83o0w/production/dd88ac44f50d7e5f3da1d21184bb96cb032c66fc-1376x768.png?w=1376&q=82&fit=max&auto=format)](/course/odin-javascript-deep-dive)November 4, 2026[![](/logos/tags/javascript-symbol-light.svg)![](/logos/tags/javascript-symbol-dark.svg)JavaScript](/topic/javascript)[![](/logos/tags/typescript-symbol-light.svg)![](/logos/tags/typescript-symbol-dark.svg)TypeScript](/topic/typescript)[#Testing](/topic/testing)[+1](/course/odin-javascript-deep-dive)

### [The Odin Project 4: JavaScript Deep Dive (Closures, Event Loop, Async & TDD)](/course/odin-javascript-deep-dive)

Master lexical closures, ES Modules, the V8 Event Loop (microtasks vs. macrotasks), Promise concurrency, and Test-Driven Development with Vitest.

[![Alex Patterson](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/a606dfaa381aab08ddbe16a33fe1d3e1fb37c927-400x400.jpg?w=96&h=96&q=82&fit=max&auto=format)Alex Patterson](/author/alex-patterson)[Course Outline](/course/intro-to-solid-js)

## Intro to SolidJS

1/41

### Getting Started

- [1.1Fundamentals▶](/course/intro-to-solid-js/lesson/fundamentals)

2

### Basics

- [2.1Solid Basics](/course/intro-to-solid-js/lesson/basics)
- [2.2Deployment](/course/intro-to-solid-js/lesson/deployment)

3

### SolidStart

- [3.1SolidStart](/course/intro-to-solid-js/lesson/solidstart)

@CodingCatDev on YouTube62.5K / 100K

Subscribe for new course lessons and architecture deep dives every week.

[Subscribe for New Lessons →](https://www.youtube.com/@codingcatdev?sub_confirmation=1)