Coder Social home page Coder Social logo

ixartz / next-js-landing-page-starter-template Goto Github PK

View Code? Open in Web Editor NEW
1.6K 15.0 539.0 1.46 MB

๐Ÿš€ Free NextJS Landing Page Template written in Tailwind CSS 3 and TypeScript โšก๏ธ Made with developer experience first: Next.js 14 + TypeScript + ESLint + Prettier + Husky + Lint-Staged + VSCode + Netlify + PostCSS + Tailwind CSS

Home Page: https://creativedesignsguru.com

License: MIT License

JavaScript 12.00% Shell 1.06% TypeScript 86.56% CSS 0.37%
nextjs tailwindcss themes templates landing-page starter boilerplate typescript nextjs-starter nextjs-typescript

next-js-landing-page-starter-template's Introduction

Landing Page Template built with Next JS 14+, Tailwind CSS 3 and TypeScript Twitter

Next js starter banner

๐Ÿš€ Landing Page theme written in Next.js, Tailwind CSS and TypeScript โšก๏ธ Made with developer experience first: Next.js, TypeScript, ESLint, Prettier, Husky, Lint-Staged, VSCode, Netlify, PostCSS, Tailwind CSS.

Clone this project and use it to create your own Next.js project. You can check a Next js templates demo.

Sponsors

Sentry Codecov Better Stack React SaaS Boilerplate Next.js
Clerk โ€“ Authentication & User Management for Next.js SQLite Developer Experience Crowdin
Add your logo here

DEMO

Nextjs Landing Page Template Screenshot

Check out our live demo.

Features

Developer experience first:

  • ๐Ÿ”ฅ Next.js for Static Site Generator
  • ๐ŸŽจ Integrate with Tailwind CSS
  • ๐Ÿ’… PostCSS for processing Tailwind CSS and integrated to styled-jsx
  • ๐ŸŽ‰ Type checking TypeScript
  • โœ… Strict Mode for TypeScript and React 18
  • โœ๏ธ Linter with ESLint (default NextJS, NextJS Core Web Vitals and Airbnb configuration)
  • ๐Ÿ›  Code Formatter with Prettier
  • ๐ŸฆŠ Husky for Git Hooks
  • ๐Ÿšซ Lint-staged for running linters on Git staged files
  • ๐Ÿ—‚ VSCode configuration: Debug, Settings, Tasks and extension for PostCSS, ESLint, Prettier, TypeScript
  • ๐Ÿค– SEO metadata, JSON-LD and Open Graph tags with Next SEO
  • โš™๏ธ Bundler Analyzer
  • ๐Ÿ–ฑ๏ธ One click deployment with Netlify (or manual deployment to any hosting services)
  • ๐ŸŒˆ Include a FREE theme
  • ๐Ÿ’ฏ Maximize lighthouse score

Built-in feature from Next.js:

  • โ˜• Minify HTML & CSS
  • ๐Ÿ’จ Live reload
  • โœ… Cache busting

Included Components

  • Navbar
  • Hero
  • Features
  • CTA banner
  • Footer

Find more components in our premium NextJS themes.

Philosophy

  • Minimal code
  • SEO-friendly
  • ๐Ÿš€ Production-ready

Requirements

  • Node.js and npm

Getting started

Run the following command on your local environment:

git clone --depth=1 https://github.com/ixartz/Next-JS-Landing-Page-Starter-Template.git my-project-name
cd my-project-name
npm install

Then, you can run locally in development mode with live reload:

npm run dev

Open http://localhost:3000 with your favorite browser to see your project. For your information, Next JS need to take some time to compile the project for your first time.

.
โ”œโ”€โ”€ README.md            # README file
โ”œโ”€โ”€ next.config.js       # Next JS configuration
โ”œโ”€โ”€ public               # Public folder
โ”‚   โ””โ”€โ”€ assets
โ”‚       โ””โ”€โ”€ images       # Image used by default template
โ”œโ”€โ”€ src
โ”‚   โ”œโ”€โ”€ background       # Atomic background component
โ”‚   โ”œโ”€โ”€ button           # Atomic button component
โ”‚   โ”œโ”€โ”€ cta              # Atomic cta component
โ”‚   โ”œโ”€โ”€ feature          # Atomic feature component
โ”‚   โ”œโ”€โ”€ footer           # Atomic footer component
โ”‚   โ”œโ”€โ”€ hero             # Atomic hero component
โ”‚   โ”œโ”€โ”€ layout           # Atomic layout component
โ”‚   โ”œโ”€โ”€ navigation       # Atomic navigation component
โ”‚   โ”œโ”€โ”€ pages            # Next JS pages
โ”‚   โ”œโ”€โ”€ styles           # PostCSS style folder with Tailwind
โ”‚   โ”œโ”€โ”€ templates        # Default template
โ”‚   โ””โ”€โ”€ utils            # Utility folder
โ”œโ”€โ”€ tailwind.config.js   # Tailwind CSS configuration
โ””โ”€โ”€ tsconfig.json        # TypeScript configuration

Customization

You can easily configure the theme. Please change the following file:

  • public/apple-touch-icon.png, public/favicon.ico, public/favicon-16x16.png and public/favicon-32x32.png: your favicon, you can generate from https://favicon.io/favicon-converter/
  • src/styles/global.css: your CSS file using Tailwind CSS
  • utils/AppConfig.ts: configuration file
  • src/pages/index.tsx: the index page of the theme that uses the Base component
  • src/template/Base.tsx: the Base component using component blocks
  • src/templates/*: the list of component blocks
  • src/*: other folders in src are the atomic components used by components blocks

Here is the layer:

  • the entry point: index.tsx in src/pages
  • the Base template: Base.tsx in src/templates
  • use component blocks from src/templates/*
  • use atomic components from src/*

Deploy to production

You can see the results locally in production mode with:

$ npm run build
$ npm run start

The generated HTML and CSS files are minified (built-in feature from Next js). It will also removed unused CSS from Tailwind CSS.

You can create an optimized production build with:

npm run build-prod

Now, your theme is ready to be deployed. All generated files are located at out folder, which you can deploy with any hosting service.

Deploy to Netlify

Clone this repository on own GitHub account and deploy to Netlify:

Netlify Deploy button

VSCode information (optional)

If you are VSCode users, you can have a better integration with VSCode by installing the suggested extension in .vscode/extension.json. The starter code comes up with Settings for a seamless integration with VSCode. The Debug configuration is also provided for frontend and backend debugging experience.

Pro tips: if you need a project wide type checking with TypeScript, you can run a build with Cmd + Shift + B on Mac.

Contributions

Everyone is welcome to contribute to this project. Feel free to open an issue if you have question or found a bug.

License

Licensed under the MIT License, Copyright ยฉ 2024

See LICENSE for more information.

Sponsors

Sentry Codecov Better Stack React SaaS Boilerplate Next.js
Clerk โ€“ Authentication & User Management for Next.js SQLite Developer Experience Crowdin
Add your logo here

Made with โ™ฅ by CreativeDesignsGuru Twitter

Sponsor Next JS Boilerplate

next-js-landing-page-starter-template's People

Contributors

ftheron avatar ixartz avatar n3ko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

next-js-landing-page-starter-template's Issues

Error when deploying to Netlify

Hi There,

I tried to deploy this template to netlify (clicking on the Deploy to Netlify button in the README), but got this error during the deployment.

Could you please give some insights on how to resolve this?

Plugin "@netlify/plugin-nextjs" failed

Error: The directory "out" does not contain a Next.js production build. Perhaps the build command was not run, or you specified the wrong publish directory.
Your publish directory is set to "out", but in most cases it should be ".next".
If you are using "next export" then you should set the environment variable NETLIFY_NEXT_PLUGIN_SKIP to "true".

In "onBuild" event in "@netlify/plugin-nextjs" from Netlify app at checkNextSiteHasBuilt (/.netlify/plugins/node_modules/@netlify/plugin-nextjs/lib/helpers/verification.js:68:16) at onBuild (/.netlify/plugins/node_modules/@netlify/plugin-nextjs/lib/index.js:37:50)

Logs:
9:32:37 PM: โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ 9:32:37 PM: Plugin "@netlify/plugin-nextjs" failed 9:32:37 PM: โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ 9:32:37 PM: โ€‹ 9:32:37 PM: Error message 9:32:37 PM: Error: The directory "out" does not contain a Next.js production build. Perhaps the build command was not run, or you specified the wrong publish directory. 9:32:37 PM: Your publish directory is set to "out", but in most cases it should be ".next". 9:32:37 PM: If you are using "next export" then you should set the environment variable NETLIFY_NEXT_PLUGIN_SKIP to "true". 9:32:37 PM: โ€‹ 9:32:37 PM: Plugin details 9:32:37 PM: Package: @netlify/plugin-nextjs 9:32:37 PM: Version: 4.2.4 9:32:37 PM: Repository: git+https://github.com/netlify/netlify-plugin-nextjs.git 9:32:37 PM: npm link: https://www.npmjs.com/package/@netlify/plugin-nextjs 9:32:37 PM: Report issues: https://github.com/netlify/netlify-plugin-nextjs/issues 9:32:37 PM: โ€‹ 9:32:37 PM: Error location 9:32:37 PM: In "onBuild" event in "@netlify/plugin-nextjs" from Netlify app 9:32:37 PM: at checkNextSiteHasBuilt (/.netlify/plugins/node_modules/@netlify/plugin-nextjs/lib/helpers/verification.js:68:16) 9:32:37 PM: at onBuild (/.netlify/plugins/node_modules/@netlify/plugin-nextjs/lib/index.js:37:50) 9:32:37 PM: โ€‹ 9:32:37 PM: Resolved config 9:32:37 PM: build: 9:32:37 PM: command: npm run build-prod 9:32:37 PM: commandOrigin: config 9:32:37 PM: environment: 9:32:37 PM: - NEXT_PRIVATE_TARGET 9:32:37 PM: publish: /opt/build/repo/out 9:32:37 PM: publishOrigin: config 9:32:37 PM: plugins: 9:32:37 PM: - inputs: {} 9:32:37 PM: origin: ui 9:32:37 PM: package: '@netlify/plugin-nextjs'

How do I automate `sitemap.xml`

Sitemaps are nice things. Just simple question Do we have any automated sitemap generation? IF yes then how can we use it.

How can I set up next build?

I want to set up i18n for this landingpage, but this requires next build and a node.js server -> I set the build command to next build but it doesn't work, so what should I do?

API call in getServerSideProps not working in production build

I have a method that calls backend node js API

export async function getServerSideProps(context:GetServerSidePropsContext){
  const reqUrl = context.req.url;
  const splitUrl = reqUrl?.toString().split('?').pop()?.split('&');

  if(!splitUrl) return null;

  const searchText = splitUrl[0]?.split('=')[1];
  const suburb = splitUrl[1]?.split('=')[1];
  
  if(searchText && suburb){
    
    const _dataService = new ServiceProviderDataService();
    const response = await _dataService.searchAdvertisements(searchText, suburb);
     const searchTitle = `We found ${response.length} search results for ${searchText} in ${suburb} ..`;
      return {
        props: {
          data: response,
          searchTitle:searchTitle,
        },
      };  
  }

  return null;
}
const SearchResultsPage = (data:ISearchResult[],searchTitle:string) => (
  <Main>
    <Head>
      
      <meta
        name="description"
        content={`Elevate your hairstyling experience with Mobile Hairdressers, 
                  the ultimate destination for connecting clients and skilled mobile hairdressers. 
                  Explore our About Us page to learn how we seamlessly bridge the gap between clients and talented stylists, 
                  bringing the salon experience to your doorstep. 
                  Discover the convenience, expertise, and personalized service that define our mobile hairdressing platform`}
      />
    </Head>
    <SearchResults searchTitle={searchTitle} searchResults={data} />
  </Main>
);

The above code works in local (npm run build, npm run start, npm run dev). When I upload to my ubuntu server, the getserversideprops waits a long time and returns a ECONNN TIMEOUT. I can confirm the API is returning data (as I previously said, this is all working well in localhost)





Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.