Tillitsdone
down Scroll to discover

How to Set Up a Next.js Project from Scratch

Learn how to create and configure a Next.js project from the ground up.

This guide covers installation, project structure, essential configurations, and best practices for beginners.
thumbnail

A modern abstract representation of building blocks floating in space with layered geometric shapes in bright teal and lime green colors against a clean white background shot from a low angle perspective high-quality ultra-realistic cinematic 8K UHD high resolution sharp and detail

Getting started with Next.js might seem daunting at first, but I promise you it’s easier than you think! I remember when I first began working with Next.js - the excitement of building something new mixed with the slight nervousness of learning a new framework. Let me walk you through the process of setting up your first Next.js project.

Prerequisites

Before we dive in, make sure you have Node.js installed on your computer. I recommend using the latest LTS version for the best experience. You’ll also need npm (comes with Node.js) or yarn if that’s your preferred package manager.

Abstract flowing lines forming a network pattern stone texture with smooth gradients in warm beige and light gray tones captured from a top-down aerial view high-quality ultra-realistic cinematic 8K UHD high resolution sharp and detail

Creating Your Project

Let’s start with the easiest and most recommended way to create a Next.js project. Open your terminal and run:

Terminal window
npx create-next-app@latest my-next-app

You’ll be prompted with a few questions about your project setup. Here’s what I typically recommend:

Terminal window
Would you like to use TypeScript? Yes
Would you like to use ESLint? Yes
Would you like to use Tailwind CSS? Yes
Would you like to use `src/` directory? Yes
Would you like to use App Router? Yes
Would you like to customize the default import alias? No

Project Structure

Once the installation is complete, you’ll notice Next.js has created a well-organized project structure for you. The most important directories you’ll work with are:

my-next-app/
├── app/
├── public/
├── components/
├── styles/
└── package.json

Minimalist architectural structure with interconnected layers featuring clean lines and smooth surfaces in bright stone white and soft gray tones photographed from a diagonal perspective high-quality ultra-realistic cinematic 8K UHD high resolution sharp and detail

Running Your Project

Now comes the exciting part - seeing your project come to life! Navigate to your project directory:

Terminal window
cd my-next-app

And start the development server:

Terminal window
npm run dev

Visit http://localhost:3000 in your browser, and you’ll see your Next.js application running! The default page includes some helpful resources and links to get you started.

Next Steps

Now that you have your project up and running, here are some things you might want to explore:

  1. Create new pages in the app directory
  2. Add some components in the components directory
  3. Experiment with styling using Tailwind CSS
  4. Try out Next.js’s built-in features like API routes and image optimization

Remember, the best way to learn is by doing. Don’t be afraid to experiment and break things - that’s how we all learn!

Dynamic abstract composition of flowing energy streams with vibrant neon green and dark forest green elements intertwining against a black background shot from a dutch angle perspective high-quality ultra-realistic cinematic 8K UHD high resolution sharp and detail

icons/next-js.svg Nextjs Blogs
React framework enabling server-side rendering and static site generation for optimized performance.
icons/logo-tid.svgicons/next-js.svg

Talk with CEO

Ready to bring your web/app to life or boost your team with expert Thai developers?
Contact us today to discuss your needs, and let’s create tailored solutions to achieve your goals. We’re here to help at every step!
🖐️ Contact us
Let's keep in Touch
Thank you for your interest in Tillitsdone! Whether you have a question about our services, want to discuss a potential project, or simply want to say hello, we're here and ready to assist you.
We'll be right here with you every step of the way.
Contact Information
rick@tillitsdone.com+66824564755
Find All the Ways to Get in Touch with Tillitsdone - We're Just a Click, Call, or Message Away. We'll Be Right Here, Ready to Respond and Start a Conversation About Your Needs.
Address
9 Phahonyothin Rd, Khlong Nueng, Khlong Luang District, Pathum Thani, Bangkok Thailand
Visit Tillitsdone at Our Physical Location - We'd Love to Welcome You to Our Creative Space. We'll Be Right Here, Ready to Show You Around and Discuss Your Ideas in Person.
Social media
Connect with Tillitsdone on Various Social Platforms - Stay Updated and Engage with Our Latest Projects and Insights. We'll Be Right Here, Sharing Our Journey and Ready to Interact with You.
We anticipate your communication and look forward to discussing how we can contribute to your business's success.
We'll be here, prepared to commence this promising collaboration.
Frequently Asked Questions
Explore frequently asked questions about our products and services.
Whether you're curious about features, warranties, or shopping policies, we provide comprehensive answers to assist you.