Clean architecture starter for Next.js with TypeScript. All the tools you need to build your next project.
~/
prefixThe 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
To start the project locally, run:
npm dev
our
yarn dev
Open http://localhost:3000
with your browser to see the result.
.husky
— Husky configuration and hooks.
public
— Static assets such as robots.txt, images, and favicon.
src
— Application source code, including pages, components, styles.
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.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