Giter Site home page Giter Site logo

portalfrontend's Introduction

A NextJs boilerplate with redux-saga and redux-persist.

GitHub (Pre-)Release Date npm NPM

A ready-to-use utility boilerplate to get your project started right away with just one single command. It sets up redux-saga and redux-persist with NextJs and makes it production ready. If you are a NextJs lover and need Redux for your next project this is definately the right boilerplate to start with.

Features :

   

  • NextJs v11
  • React v17
  • React-Redux v7
  • Redux-Saga v1
  • Redux-Persist v6
  • Basic folder structure Ready-to-go.
  • An example Countries API fetched.

Let's get started!

  • Choose a folder to create your project and create using following methods:

npx

npx create-next-saga-persist-app your-app-name

npm

npm init next-saga-persist-app your-app-name

OR

npm create next-saga-persist-app your-app-name

It will create a directory called your-app-name inside the current folder. Inside that directory, it will generate the initial project structure and install the transitive dependencies:

your-app-name
├── README.md
├── node_modules
├── package-lock.json
├── package.json
├── next.config.js
├── .gitignore
├── .env.example
├── .eslintrc
├── public
│   ├── favicon.ico
│   └── vercel.svg
├── pages
│   ├── _app.js
│   └── index.js
├── redux
│   ├── actions
│   |   └── countriesAction.js
│   ├── reducers
|   |   ├── countries.js
│   |   └── index.js
│   ├── sagas
|   |   ├── countriesSaga.js
│   |   └── index.js
│   └── store.js
└── styles
    ├── globals.css
    └── Home.module.css

Once the installation is done, you can open your project folder:

cd your-app-name
npm run dev
  • Build for production:
npm run build
npm start
  • Linting:
npm run lint

Environment Setup

Create a local .env.local or .env file with configurations stated in .env.example for local environment setup. Read more on Environment setup in NextJs here.

Note

index.js opts out of static optimization by default. please use getStaticProps to use static optimization feature of nextJs.

References :

Requirements :

Recommended updated versions of

  • NodeJs
  • NPM package manager

FAQ

What is a boilerplate ?

A boilerplate is a project with generic, maintainable and reusable code, files or content that is intended to be used as a starting point for creating new projects blazing fast without wasting time in setting up the basics each time.

Why Redux-Saga ?

Redux Saga is a middleware library that allows a Redux store to interact with resources outside of itself in an asynchronous way, including making of HTTP requests to external services, accessing the browser storage, or executing any I/O operations. These operations are known as side effects. Redux-Saga helps us to organize and manage these side effects in easier way.

This package uses restcountries api for fetching an example data.

Contributing

Pull requests and stars shall always be welcomed. For bugs and feature requests, please create an issue

Author

Aftab Ahmed

License

Copyright © 2021, Aftab Ahmed. Released under the [MIT license].

portalfrontend's People

Contributors

aaftab1441 avatar dependabot[bot] avatar

Watchers

 avatar

portalfrontend's Issues

Break Down Merchant components

Merchant components are massive and needs to be refactord, I am thinking to create smaller components, logic can be moved to controller components and smaller presentational components can be created for each section

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.