Giter VIP home page Giter VIP logo

mucahidyazar / nteboilerplate-next.js Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 5.25 MB

This is a Next.js boilerplate that was built by myself. I integreted the technologies that are Redux, Scss, Express, Prettier and an amazing React, Redux, Scss structure to my project. There are lots of boilerplate on internet so why did I build this one. Actually I looked at lots of boilerplates but I didn't find like mine.

TypeScript 22.65% JavaScript 64.78% SCSS 2.41% CSS 4.80% HTML 4.65% Shell 0.08% Dockerfile 0.63%

nteboilerplate-next.js's Introduction

Index

Installation

git clone https://github.com/mucahidyazar/NTEBoilerplate-Next.js.git
npm install .
npm run dev

Some Url about Next.JS

About Structure

  • public => there are static folderss and files in this folder
  • pages => we can create page on here
  • views/components => there are components folders and files in here...
  • views/layouts => there are layout templates in here. like header, footer, navbar...
  • views/ui => there are ui components in here. like button, input vs...
  • config => main setting folder
  • config/database => express database settings
  • config/helper => you can create some helper files on there. like getCurrentTime.ts, getDate.ts....
  • config/i18n => javascript setup settings of next-i18next(i18 multi language)
  • public/statics/locale => There are the key words that you can use for multi languages
  • redux => state management with redux
  • public/statics/assets/styles => The style management

About CSS

  • Next.JS CSS Yapısı
  • You should import new scss files in main.scss if you create a new one
  • You can manage your style files with 2 ways.
    • Either you create a new scss file then import that to the main.scss
    • or you can create a component folder and you can keep on there 2 files like this. Home/index.tsx, Home/styles.module.scss. and you can use this styles folder in your index.tsx by importing like this. (import styles from './styles.module.scss'). And now you can catch the classes that you create in the scss file in your tsx file. You should catch them in classNames of your elements. (
      )
  • You should use the media points by importing from 'public/static/assets/styles/base/breakpoints.scss' for responsivity

About Language System

  • We use next-i18next for this
  • public/static/locales => There are language folders
  • For using
    • import our withTranslation file in your component like this. (import { withTranslation } from '../../config/i18n/index')
    • then wapper your component like this. (export default withTranslation('header')(Header))
    • and now you are using the keys of header file in your public/static/locales/tr/header.json

About Icons

  • public/static/assets/styles/icon => main icon folder
  • Icomoon You should import your icon files on there and generate your new files to add there again

Creating New Page

  • You just need to create a new file or folder in the pages folder.

Setting up Your Environment Variables

  • Environment Variables Documentation
  • You should create a new file that name is .env.local on root
    • Environment Variables describing for server side OWM_API_ID=WRITEYOURAPIKEY
    • Environment Variables describing for client side(browser) NEXT_PUBLIC_OWM_API_ID=WRITEYOURAPIKEYFORBROWSER

nteboilerplate-next.js's People

Contributors

mucahidyazar avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar  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.