Giter Site home page Giter Site logo

khanhtt / clean-arch-nextjs-starter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yazaldefilimone/clean-arch-nextjs-starter

0.0 0.0 0.0 328 KB

Clean architecture starter for Next.js with TypeScript. All the tools you need to build your next project.

Home Page: https://clean-arch-nextjs-starter.vercel.app

Shell 0.61% JavaScript 1.18% TypeScript 77.76% CSS 20.45%

clean-arch-nextjs-starter's Introduction

Unsplash welcome! License License Stars Languages

Clean architecture starter for Next.js with TypeScript.
All the tools you need to build your nextxroject.

Features

  • ⚡️ Next.js 12
  • ⚛️ React 18
  • ⛑ TypeScript
  • ✨ Styled Components - CssInJs for component styling
  • 📏 ESLint — To find and fix problems in your code
  • 💖 Prettier — Code Formatter for consistent style
  • 🐶 Husky — For running scripts before committing
  • 🚓 Commitlint — To make sure your commit messages follow the convention
  • 🚫 lint-staged — Run ESLint and Prettier against staged Git files
  • ⚙️ EditorConfig - Consistent coding styles across editors and IDEs
  • 🗂 Path Mapping — Import components or images using the ~/ prefix
  • ‽ Either Error Handler - For error handling. (Either is designed to hold either a left or a right value but never both).

Quick Start

The best way to start with this template is using Create Next App.

# yarn
yarn create next-app -e https://github.com/yazaldefilimonepinto/clean-arch-nextjs-starter
# npm
npx create-next-app -e https://github.com/yazaldefilimonepinto/clean-arch-nextjs-starter

Development

To start the project locally, run:

  npm dev
  our
  yarn dev

Open http://localhost:3000 with your browser to see the result.

Requirements

  • Node.js >= 12.22.0
  • npm our yarn

Directory Structure

  • .husky — Husky configuration and hooks.
  • public — Static assets such as robots.txt, images, and favicon.
  • src — Application source code, including pages, components, styles.

Scripts

  • yarn/npm dev — Starts the application in development mode at http://localhost:3000.
  • yarn/npm build — Creates an optimized production build of your application.
  • yarn/npm start — Starts the application in production mode.
  • yarn/npm lint — Runs ESLint for all files in the src directory.

Path Mapping

TypeScript are pre-configured with custom path mappings. To import components or files, use the ~/ prefix.

import { Button } from '~/presentation/components/Button';

// To import images or other files from the public folder
import avatar from '~/public/avatar.png';

NOTE: As many use styled-component I added the settings for it, but you can remove it at: src/pages/_document.tsx and remove global styles in: src/shared/styles/globals.ts

License

MIT © Yazalde Filimone

clean-arch-nextjs-starter's People

Contributors

yazaldefilimone avatar

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.