DEV Community

suyash200
suyash200

Posted on

Setting Up Your Next Project

Looking for a guide to start your project setup? You found a right place. This blog will give you an basic idea for setting up your project and this series will help you as a beginner. I am using next but this can apply for any framework as well as vanilla.js

Prerequisite

-node.js
-npm
-HTML
-CSS

Lets start ...

1. Creating next project

npx create-next-app app-name
Enter fullscreen mode Exit fullscreen mode

For beginners we can use ESlint in the options .

Project structure

lets understand project structure of the current project and update it to be more suitable structure.
How it looks now :

Image description

Following steps would be followed:

1. Removing the api folder from pages

2. Create component folder

3. Create an api folder in rood directory

4. Create an interceptor.js file and Endpoints folder

Now it looks like this

Image description

2. Working on CSS

lets clear the entire global CSS ...
Now starting fresh

CSS reset

  *{
    margin:0;
    padding:0;
    box-sizing: border-box;
   }
Enter fullscreen mode Exit fullscreen mode

This reset the CSS padding and removes unnecessary padding, margin that is automatically added to your HTML components.

Root Selector

:root{
   --white:#fff,
   --black:#000,

}
Enter fullscreen mode Exit fullscreen mode

The :root selector matches the document's root element. We can
declare our variable here , basically we can describe font
color that are repetitively used in the web app.

Body


body {
  background: var(--cream);
  font-family: "Playfair Display", "sans-serif";

}
Enter fullscreen mode Exit fullscreen mode

The css declarations in this part are applied through out the the web app ,we can provide with background color for out website
font-size, font-family etc can be described here.

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

Cloudinary image

Video API: manage, encode, and optimize for any device, channel or network condition. Deliver branded video experiences in minutes and get deep engagement insights.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay