A quick and practical guide to starting your first frontend web project with the main tools and without complications.
Prerequisites
Before getting started, it's important to have some basic knowledge:
- π§© Programming Logic
- π¦ Package Managers (NPM, Yarn, or PNPM)
- π§ Git and GitHub (for versioning and code hosting)
- π¨ CSS Libraries (such as Tailwind, Material UI)
- ποΈ Project Structure (understanding folders like /src and files like package.json)
π In this guide, we'll focus on frontend web development using React + TypeScript and Vite as a startup tool.
Choosing Technologies
The first crucial decision is choosing the project type and the appropriate technologies, since the choice of project type can indirectly define some of the technologies that will be used.
Project Type | Recommended Technology |
---|---|
Simple Landing Page | HTML, CSS, JavaScript |
Website with Login/Components | React, Vue |
Complex Application | React + TypeScript, Vuejs, Nuxt, Next |
For this tutorial, we chose React because of its gentle learning curve.
π οΈ Managing Packages in Node.js
Node.js uses a package manager called NPM (Node Package Manager).
It is responsible for installing, updating, and removing libraries used by your project. These libraries (also called dependencies) are listed in the package.json file.
NPM is automatically installed with Node.js and is one of the most important tools for any modern JavaScript or TypeScript project.
π¦ Main NPM Commands
π§© Action | π» Command |
---|---|
Install a package | npm install package-name |
Uninstall a package | npm uninstall package-name |
Install development dependency | npm install -D package-name |
Check installed dependencies | Check the package.json file |
π‘ Tips
- NPM creates a folder called
node_modules
, where all installed packages are stored. - If you prefer, you can also use Yarn, an alternative to NPM with similar commands (e.g.,
yarn add
,yarn remove
, etc.).
Step 1 β Creating the repository on GitHub
I like to first create a repository on GitHub and clone it to my machine, as this makes it easier to version code directly in the project repository, both locally and remotely after using git commands.
- Access your GitHub Account and
- Create a new repository (public or private)
- Copy the repository's HTTPS link
In the explorer, clone the repository using the command:
git clone https://github.com/your-username/your-repository.git
Then access the cloned repository.
Step 2 β Installing React with Vite
Vite is a lightning-fast frontend build tool that powers the next generation of web applications.
Open the terminal inside your repository folder and run:
npm create vite
This will download essential dependencies and libraries to start the project.
During the interactive setup, you can use the arrow keys to navigate and the keyboard to type in the terminal, for example:
- Enter/Set the project name
- Select React as the main library
- Choose TypeScript (TS) as the language (or JavaScript if you prefer)
Step 3 β Installing Dependencies
Dependencies are small pieces and snippets of code responsible for managing the application between high- and low-level modules, things that this blog won't delve into at this time.
Therefore, open the terminal in the project folder (project root) and run the following command to install these software dependencies for your project.
npm install
Step 4 β Running the Project
To run the project, you need to check which scripts are provided in the package.json file. In this case, we're looking for the dev script.
The dev script makes the new application run, as if we were going to play it. Therefore, in your project's terminal in VScode (or any other IDE you're using), run the command
npm run dev
And That's It!
- Your project is running on localhost:5173 (Vite's default port).
Localhost means your project is running only with the files they already have or even the files you've written, but it's not yet onlineβthat is, it exists only locally on your computer. Only you can access it.
Step 5 β Installing Additional Libraries (Tailwind CSS)
Tailwind its Rapidly build modern websites without ever leaving your HTML.
Tailwind is a famous CSS library widely used in frontend development due to its versatility and mobile-first foundation. This means that Tailwind's intention is to style the project responsivelyβin other words, to have a UI that works for desktops, tablets, and mobile platforms.
To install Tailwind CSS (example of an additional library):
in the terminal, at the project root:
npm install -D tailwindcss
Furthermore, it's important to clarify that it's EXTREMELY necessary to read the libraries you want to include in your project, since code generated by Generative Artificial Intelligence tends to be poorly written and outdated.
Therefore, as a professional concerned with your work, it's also your job to read these important documents about the dependencies you want to have in your own project.
Furthermore, installation alone doesn't guarantee that the dependency is 100% working; it's also necessary to configure it, and these configurations are usually found in the first pages of the library and framework documentation.
Your package.json contains important scripts for running the project.
Package.json is an extremely important file for web projects, as it contains the main information about the system/project, such as name, version, repository, main dependencies, and scripts.
For example, within the "scripts" object, we have the following scripts:
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
}
- npm run dev - Starts the development server
- npm run build - Generates the production build
- npm run preview - Views the production build
Created Project Structure
your_project_name/
βββ node_modules/ # Installed dependencies
βββ public/ # Static files
βββ src/
β βββ assets/ # Images, fonts, etc.
β βββ components/ # React Components
β βββ App.tsx # Main Component
β βββ main.tsx # Entry Point
β βββ index.css # Global Styles
βββ index.html # Main HTML
βββ package.json # Dependencies and Scripts
βββ tsconfig.json # TypeScript Configuration
βββ vite.config.ts # Vite Configuration
π‘ Important Tips
- Always consult the official documentation
- ChatGPT may display outdated and incorrect code.
- Keep your package.json up to date
- Use Git for version control from the start
- No AI replaces the user manual**
- Official documentation is always more reliable
- Check dependencies in package.json after each installation
To recap what was done:
- β Created repository on GitHub
- β Cloned to your machine
- β Initialized project with Vite + React + TypeScript (via NPM)
- β Installed dependencies
- β Ran the project locally
- β Added Tailwind CSS (optional)
π Useful Links
π React Documentation
β‘ Vite Documentation
π¨ Tailwind CSS Documentation
This guide was created based on practical development experience.
Author: Ruan Rickelme Ramos
π‘ Remember: This is a guide for beginners who want to get started quickly.
As your project grows, explore more advanced concepts like routing, state management, and testing.
THANKKSS!!
Top comments (0)