Giter Site home page Giter Site logo

rethunk-tech / nextjs-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
13.0 3.0 5.0 8.04 MB

Opinionated Next.JS Boilerplate with TypeScript and Material-UI

License: Other

JavaScript 26.31% TypeScript 55.47% CSS 1.92% Dockerfile 16.30%
boilerplate eslint material-ui nextjs nextjs-boilerplate react typescript

nextjs-boilerplate's Introduction

Next.JS Boilerplate

CodeQL Analysis Workflow Status Cypress Workflow Status License

This is an opinionated Next.js boilerplate, with:

Getting Started

First-Time Setup

If this is your first time using NodeJS, you'll need to install Yarn to use this project:

(You only need to do this once per system you develop on.)

npm install -g yarn

Then, we can clone the repository into a path of your choosing:

git clone https://github.com/Rethunk-Tech/nextjs-boilerplate.git project-name
cd project-name

Finally, install the dependencies using yarn.

cd project-name
yarn install

Running the Dev Server

You can run the server locally with the following command:

yarn run dev -p 9000

With Docker

Or, you can use Docker to run the server within containers:

  1. Install Docker Compose

  2. Enable BuildKit for Docker. (It's faster and has cache.)

  3. "Up" the composition (specifying --build to force a re-build):

    docker-compose up --build

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

Debugging

If you need to debug something inside the container, you can get a shell using:

docker-compose run --rm -u 0 nextjs sh

Developing with this Boilerplate

First, open http://localhost:9000/ in a browser, and open pages/index.tsx in your preferred editor. Side-by-side the windows as shown below for the most convenient developing experience! (Even better with more monitors.)

Any changes made to a file in pages will automatically update in the browser as long as the dev server is running.

You can start editing the page by modifying pages/index.tsx.

API routes can be accessed on http://localhost:9000/api/hello. This endpoint can be edited in pages/api/hello.ts.

The pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.

Learn More

TypeScript

Next.JS

Material UI

Cypress E2E Testing

Contributing

Consider using Gitmoji in your commit messages.

Here are some we use:

Code Meaning
๐Ÿ› :bug: Fix a bug
๐Ÿ’š :green_heart: Fix CI Build
๐Ÿšจ :rotating_light: Fix linter warnings
โšก :zap: Improve performance
โœจ :sparkles: Introduce new feature
โ™ป๏ธ :recycle: Refactor code
๐Ÿ”ฅ :fire: Remove code or files
๐Ÿ™ˆ :see_no_evil: Update a .gitignore file
๐Ÿ‘ท :construction_worker: Update CI build system
๐Ÿ’ก :bulb: Update comments in code
๐Ÿ“ :memo: Update documentation
โฌ†๏ธ :arrow_up: Upgrade dependency

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.