Solid JS Tutorial #2 - Making a New Solid App

Net Ninja · Beginner ·🌐 Frontend Engineering ·3y ago

Key Takeaways

The video demonstrates how to create a new Solid JS application using the Solid JS template and explains the different files and folders in the starter project, including the app.jsx file, app.module.css file, index.css file, and index.jsx file. It also shows how to run the project in a browser using npm run dev.

Full Transcript

all right then so let's create a brand new solid application so I've gone to solidjs.com and if you go to guides and then getting started you're going to end up on this page right here and if we scroll down we can see how we can set up a brand new solid application now you can use JavaScript or typescript if you wish it's entirely up to you I'm going to be using JavaScript purely because I want to keep the barrier to the series quite low and I don't want to assume everyone already knows typescript but if you prefer to use typescript that's fair enough I'm going to use this Command right here typescript users you can use this one but essentially we want to copy up to this bit right here because we're going to name our application something else so we're going to be using D git to basically grab a solid JS template a starter template so copy that little command there go to wherever you want to create this project in a terminal and then paste this in we're going to call this ninja hyphen merch doesn't matter what you call it to be honest press enter and this is going to start to install a brand new solid JS project for us alright so once it's done that we can CD into that new folder ninja merch so CD ninja hyphen merch like so and we want to install all the dependencies now and we do that by typing npm install and pressing enter that's going to install all the project dependencies for us and then once we've done that I'm going to open it up in vs code by tapping code space and then full stop press enter and it's going to open up this starter project for us right here so let me just zoom in a little bit so we can see everything a bit clearer all right so let me just take a couple of minutes now to walk you through this data application and then we'll fire it up and preview it in a browser so first of all we have the node modules folder for all of the project dependencies it's pretty standard then we have the source folder which is where you'll be writing about 99 or more of your code it's in this folder you're going to make all of your components any style sheets and probably any other helper files as well any assets like images can go inside the assets folder if you want to use them in components later down the line so to begin with in this Source folder the starter project already has a few files which will run quickly through so the app.jsx file is a solid JS component and in fact it's the root component meaning it's going to sit at the very top of the component tree now at the minute inside this file we've got some imports at the top we have a component function and a a jsx template returned from that function and this template ultimately gets compiled and injected into the Dom so we can view it in a browser also notice that we export the component function and that's how we can import the component into other files later on if we need them now we're going to talk more about this file and components in general in the next lesson for now let's move on so we also have the app.module.css file which is a CSS module and that's used to apply styles that can be scoped to the app components so if we open the app component up again we can see that we actually import that CSS module and they're used to style this component the template all right so the index.css file is a global style sheet for the entire application so any Global Styles go in here the index.jsx file is the file that essentially kick-starts the whole application and it does that using the render function right here that we import from solid so we grab an element from the HTML page which coincidentally is over here outside of the source folder this is the HTML page that gets sent to the browser and if we open it up we can see that there's actually pretty much no content in it at all except this div right here with an ID of root and it's got no content in it because solid.js uses the render function we just saw to ultimately inject our templates into this div so if we go back to the index.jsx file we grab that root element from the HTML page right here and then down at the bottom of the file we use that render method to render the app component into that root element and remember the app component is that component we saw a minute ago app.jsx so we're taking that component template and we're injecting it into this root element into the HTML page we're also importing the app component up here so that we can use it in this file and we import the global index CSS file too otherwise they wouldn't take effect so after this file we also have an SVG logo that gets used in the app component we don't really need that so delete it if you want to and that's pretty much it for the source folder so far outside of that we have the HTML file we also have the git ignore file a JS config file which contains some compiler options our package files a readme and a Veet config file so that's pretty much it for the starter project overview hopefully now you've got at least a basic idea of what these different things are next up let's try and run this in the browser so to run the project open up a brand new terminal make sure you're in the root directorate ninja merch in my case then we're going to run npm run Dev and press enter so this is going to spin up a local Dev server for us which we can view at this address now and if we view that in the browser we can see we actually get an error over here and it says logo is not defined and that's to do with me actually deleting that logo file I also deleted the import inside the app.jsx file but I don't think I deleted it where we use it in the template so it's trying to use this thing right here in the source but we don't have it so let's get rid of it right here as well and save that and now in the browser we can see that works so all of this content here this is basically all of the content that was coming from that app.jsx file all of the template okay so in the next lesson we're going to talk a little bit more about components and how we can use components to build up an application

Original Description

🚀🥷🏼Get early access to this entire course now on Net Ninja Pro: https://netninja.dev/p/solid-js-tutorial 📂🥷🏼 Access the course files on GitHub: https://github.com/iamshaunjp/solid-js-tutorial 💻🥷🏼 Modern JavaScript Tutorial: On Net Ninja Pro - https://netninja.dev/p/modern-javascript-from-novice-to-ninja On YouTube - https://www.youtube.com/watch?v=iWOYAxlnaww&list=PL4cUxeGkcC9haFPT7J25Q9GRB_ZkFrQAc 💻🥷🏼 Tailwind CSS Tutorial: On Net Ninja Pro - https://netninja.dev/p/tailwind-css-tutorial On YouTube - https://www.youtube.com/watch?v=bxmDnn7lrnk&list=PL4cUxeGkcC9gpXORlEHjc5bgnIi5HEGhw 🔗🥷🏼 Solid Playground - https://playground.solidjs.com/ 🔗🥷🏼 Solid JS docs (getting started) - https://www.solidjs.com/guides/getting-started 🔗🥷🏼 Solid Router docs - https://github.com/solidjs/solid-router#getting-started 🔗🥷🏼 VS Code - https://code.visualstudio.com/
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Net Ninja · Net Ninja · 0 of 60

← Previous Next →
1 Regular Expressions (RegEx) Tutorial #14 - Matching a Username
Regular Expressions (RegEx) Tutorial #14 - Matching a Username
Net Ninja
2 Regular Expressions (RegEx) Tutorial #15 - Email RegEx Pattern
Regular Expressions (RegEx) Tutorial #15 - Email RegEx Pattern
Net Ninja
3 Regular Expressions (RegEx) Tutorial #16 - Finishing Touches
Regular Expressions (RegEx) Tutorial #16 - Finishing Touches
Net Ninja
4 GraphQL Tutorial #1 - Introduction to GraphQL
GraphQL Tutorial #1 - Introduction to GraphQL
Net Ninja
5 GraphQL Tutorial #2 - A Birdseye View of GraphQL
GraphQL Tutorial #2 - A Birdseye View of GraphQL
Net Ninja
6 GraphQL Tutorial #3 - Project (stack) Overview
GraphQL Tutorial #3 - Project (stack) Overview
Net Ninja
7 GraphQL Tutorial #4 - Making Queries (front-end preview)
GraphQL Tutorial #4 - Making Queries (front-end preview)
Net Ninja
8 GraphQL Tutorial #5 - Express App Setup
GraphQL Tutorial #5 - Express App Setup
Net Ninja
9 GraphQL Tutorial #6 - Setting up GraphQL
GraphQL Tutorial #6 - Setting up GraphQL
Net Ninja
10 GraphQL Tutorial #7 - GraphQL Schema
GraphQL Tutorial #7 - GraphQL Schema
Net Ninja
11 GraphQL Tutorial #8 - Root Query
GraphQL Tutorial #8 - Root Query
Net Ninja
12 GraphQL Tutorial #9 - The Resolve Function
GraphQL Tutorial #9 - The Resolve Function
Net Ninja
13 GraphQL Tutorial #10 - Testing Queries in Graphiql
GraphQL Tutorial #10 - Testing Queries in Graphiql
Net Ninja
14 GraphQL Tutorial #11 - GraphQL ID Type
GraphQL Tutorial #11 - GraphQL ID Type
Net Ninja
15 GraphQL Tutorial #12 - Author Type
GraphQL Tutorial #12 - Author Type
Net Ninja
16 GraphQL Tutorial #13 - Type Relations
GraphQL Tutorial #13 - Type Relations
Net Ninja
17 GraphQL Tutorial #14 - GraphQL Lists
GraphQL Tutorial #14 - GraphQL Lists
Net Ninja
18 GraphQL Tutorial #15 - More on Root Queries
GraphQL Tutorial #15 - More on Root Queries
Net Ninja
19 GraphQL Tutorial #16 - Connecting to mLab
GraphQL Tutorial #16 - Connecting to mLab
Net Ninja
20 GraphQL Tutorial #17 - Mongoose Models
GraphQL Tutorial #17 - Mongoose Models
Net Ninja
21 GraphQL Tutorial #18 - Mutations
GraphQL Tutorial #18 - Mutations
Net Ninja
22 GraphQL Tutorial #19 - More on Mutations
GraphQL Tutorial #19 - More on Mutations
Net Ninja
23 GraphQL Tutorial #20 - Updating the Resolve Functions
GraphQL Tutorial #20 - Updating the Resolve Functions
Net Ninja
24 GraphQL Tutorial #21 - GraphQL NonNull
GraphQL Tutorial #21 - GraphQL NonNull
Net Ninja
25 GraphQL Tutorial #22 - Adding a Front-end
GraphQL Tutorial #22 - Adding a Front-end
Net Ninja
26 GraphQL Tutorial #23 - Create React App
GraphQL Tutorial #23 - Create React App
Net Ninja
27 GraphQL Tutorial #24 - Book List Component
GraphQL Tutorial #24 - Book List Component
Net Ninja
28 GraphQL Tutorial #25 - Apollo Client Setup
GraphQL Tutorial #25 - Apollo Client Setup
Net Ninja
29 GraphQL Tutorial #26 - Making Queries from React
GraphQL Tutorial #26 - Making Queries from React
Net Ninja
30 GraphQL Tutorial #27 - Rendering Data in a Component
GraphQL Tutorial #27 - Rendering Data in a Component
Net Ninja
31 GraphQL Tutorial #28 - Add Book Component
GraphQL Tutorial #28 - Add Book Component
Net Ninja
32 GraphQL Tutorial #29 - External Query File
GraphQL Tutorial #29 - External Query File
Net Ninja
33 GraphQL Tutorial #30 - Updating Component State
GraphQL Tutorial #30 - Updating Component State
Net Ninja
34 GraphQL Tutorial #31 - Composing Queries
GraphQL Tutorial #31 - Composing Queries
Net Ninja
35 GraphQL Tutorial #32 - query variables
GraphQL Tutorial #32 - query variables
Net Ninja
36 GraphQL Tutorial #33 - Re-fetching Queries
GraphQL Tutorial #33 - Re-fetching Queries
Net Ninja
37 GraphQL Tutorial #34 - Book Details Component
GraphQL Tutorial #34 - Book Details Component
Net Ninja
38 GraphQL Tutorial #36 - Styling the App
GraphQL Tutorial #36 - Styling the App
Net Ninja
39 GraphQL Tutorial #35 - Making a Single Query
GraphQL Tutorial #35 - Making a Single Query
Net Ninja
40 Build Apps with Vue & Firebase - Udemy Course
Build Apps with Vue & Firebase - Udemy Course
Net Ninja
41 Updated Vue & Firebase Course (Udemy)
Updated Vue & Firebase Course (Udemy)
Net Ninja
42 Vue & Firebase Real-time Chat (Preview) #1 - Intro
Vue & Firebase Real-time Chat (Preview) #1 - Intro
Net Ninja
43 Vue & Firebase Real-time Chat (Preview) #2 - Project Structure
Vue & Firebase Real-time Chat (Preview) #2 - Project Structure
Net Ninja
44 Vue & Firebase Real-time Chat (Preview) #3 - Firestore Setup
Vue & Firebase Real-time Chat (Preview) #3 - Firestore Setup
Net Ninja
45 Vue & Firebase Real-time Chat (Preview) #4 - Welcome Screen
Vue & Firebase Real-time Chat (Preview) #4 - Welcome Screen
Net Ninja
46 Vue & Firebase Real-time Chat (Preview) #5 - Props in Routes
Vue & Firebase Real-time Chat (Preview) #5 - Props in Routes
Net Ninja
47 Vue & Firebase Real-time Chat (Preview) #6 - Route Guards
Vue & Firebase Real-time Chat (Preview) #6 - Route Guards
Net Ninja
48 Vue & Firebase Real-time Chat (Preview) #7 - Chat Window
Vue & Firebase Real-time Chat (Preview) #7 - Chat Window
Net Ninja
49 Vue & Firebase Real-time Chat (Preview) #8 - New Message Component
Vue & Firebase Real-time Chat (Preview) #8 - New Message Component
Net Ninja
50 Object Oriented JavaScript Tutorial #1 - Introduction
Object Oriented JavaScript Tutorial #1 - Introduction
Net Ninja
51 Object Oriented JavaScript Tutorial #2 - Object Literals
Object Oriented JavaScript Tutorial #2 - Object Literals
Net Ninja
52 Object Oriented JavaScript Tutorial #3 - Updating Properties
Object Oriented JavaScript Tutorial #3 - Updating Properties
Net Ninja
53 Object Oriented JavaScript Tutorial #4 - Classes
Object Oriented JavaScript Tutorial #4 - Classes
Net Ninja
54 Object Oriented JavaScript Tutorial #5  - Class Constructors
Object Oriented JavaScript Tutorial #5 - Class Constructors
Net Ninja
55 Object Oriented JavaScript Tutorial #6 - Class Methods
Object Oriented JavaScript Tutorial #6 - Class Methods
Net Ninja
56 Object Oriented JavaScript Tutorial #7 - Method Chaining
Object Oriented JavaScript Tutorial #7 - Method Chaining
Net Ninja
57 Object Oriented JavaScript Tutorial #8 - Class Inheritance
Object Oriented JavaScript Tutorial #8 - Class Inheritance
Net Ninja
58 Object Oriented JavaScript Tutorial #9 - Constructors (under the hood)
Object Oriented JavaScript Tutorial #9 - Constructors (under the hood)
Net Ninja
59 Object Oriented JavaScript Tutorial #10 - Prototype
Object Oriented JavaScript Tutorial #10 - Prototype
Net Ninja
60 Object Oriented JavaScript Tutorial #11 - Prototype Inheritance
Object Oriented JavaScript Tutorial #11 - Prototype Inheritance
Net Ninja

This video teaches how to create a new Solid JS application and explains the different files and folders in the starter project. It also shows how to run the project in a browser.

Key Takeaways
  1. Create a new Solid JS application using the Solid JS template
  2. Understand the different files and folders in the starter project
  3. Run the project in a browser using npm run dev
  4. Delete the SVG logo file and remove the import statement
  5. Fix the error in the browser by removing the reference to the logo file
💡 The render function is used to inject the template into the HTML page, and the app.jsx file is the root component of the application.

Related Reads

Up next
How to Speed Up Your WordPress Website with WP Rocket ⚡Tutorial 2026
Matt Tutorials
Watch →