Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dineshbyte/nextjs-boilerplate


https://github.com/dineshbyte/nextjs-boilerplate

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

### Philosophy

- Minimal code
- SEO-friendly
- 🚀 Production-ready

### Requirements

- Node.js 14+ and npm

### Getting started

Run the following command on your local environment:

```shell
git clone --depth=1 https://github.com/RadiansysInc/alopay-fe.git
cd alopay-fe
npm install
```

Then, you can run locally in development mode with live reload:

```shell
npm run dev
```

Open http://localhost:3000 with your favorite browser to see your project.

```shell
.
├── README.md # README file
├── .husky # Husky configuration
├── .vscode # VSCode configuration
├── public # Public assets folder
├── src
│ ├── layouts # Layouts components
│ ├── pages # Next JS Pages
│ ├── pages.test # Next JS Pages tests (this avoid test to treated as a Next.js pages)
│ ├── styles # Styles folder
│ ├── templates # Default template
│ └── utils # Utility functions
├── tailwind.config.js # Tailwind CSS configuration
```

### Customization

You can easily configure Next js Boilerplate. Please change the following file:

- `public/apple-touch-icon.png`, `public/favicon.ico`, `public/favicon-16x16.png` and `public/favicon-32x32.png`: your website favicon, you can generate from https://favicon.io/favicon-converter/
- `src/styles/global.css`: your CSS file using Tailwind CSS
- `src/utils/AppConfig.js`: configuration file
- `src/templates/Main.js`: default theme

### Deploy to production

You can see the results locally in production mode with:

```shell
$ npm run build
$ npm run start
```

The generated HTML and CSS files are minified (built-in feature from Next js). It will also remove unused CSS from [Tailwind CSS](https://tailwindcss.com).

You can create an optimized production build with:

```shell
npm run build-prod
```

Now, your blog is ready to be deployed. All generated files are located at `out` folder, which you can deploy with any hosting service.

### Testing

All tests are collocated with the source code inside the same directory. So, it makes it easier to find them. Unfortunately, it is not possible with the `pages` folder which is used by Next.js for routing. So, what is why we have a `pages.test` folder to write tests from files located in `pages` folder.