- NextJs
- Custom Express server
- Styled Components
- Typescript
- Linting: prettier, eslint, editorconfig, commitlint and more.
- SVG file automation: .svg > .tsx
- Favicons automation: Generate your favicons with 1 command.
- Http service for api calls
- Styled system base components like: Box, Card, Grid, Row, Column, etc.
- Storybook
- i18n / multi language using next-i18next
- useSWR for data fetching
Need more? Send an email hi@daphnesmit.nl
- Copy
.env.exampleto.envand fill in the required variables - Run
npm installto install the dependencies
To start the development server, run the command:
npm run dev
This will run the app in the development mode.
Open http://localhost:8080 to view it in the browser.
The page will reload if you make edits.
You will see any linting errors in your console/iTerm2/other fancy shell.
To start a production build, - local or in your preferred CI - run the command:
npm run build / npm run start
This build the app for production to the .next folder.
It optimizes the build for the best performance. 🎉!
- Run
npm run buildto make a production build - Run
rm -rf node_modulesto remove devDependencies - Run
npm ci --prodto build only production dependencies - IIS server: Create
web.configfile in the root where you fill in a bunch or stuff and run node index.js:
<handlers>
<add name=“iisnode” path=“index.js” verb=“*” modules=“iisnode”/>
</handler
This project uses next.js to achieve server side rendering https://nextjs.org/docs. Some of the major differences with client side react applications are routing and server side data fetching. Also you have to take in to account that you cannot use browser api on the server. To use browser api you need to wrap them in a condition. For example
if [process.browser) {
window.addEventListener(fn)
}Place all your icons in /assets/svg. Run npm run svgr. This generates tsx components from your svg's and optimizes them with SVGO. SVGO config is located in the root of the project. The CamelCased filename will be the name of the icon.
Example:
calendar.svg -> Calendar.tsx
Usage:
<Icon icon="Calendar" color="primary" />
To generate the favicons:
- Overwrite
/public/logo.svg. Make sure the resolution is as big as possible. - Define the configuration in
/config/favicons.js - Run
npm run favicons - The meta tags are automatically inserted in
_document.tsx
This boilerplate uses next-i18next for client and server side rendered translations. See react-i18next on how to use it. Note: currently, when updating the JSON translation files, you need to restart the server in order to see the updates
This project uses SWR for fetching data. And example can be found on the /about page SWR is a React Hooks library for remote data fetching.
Nicer code with prettier!
Better code with ESLint and extensions for React and Typescript
Decide how many spaces or [ugh) tabs you want to intend your project with using EditorConfig.
You might want to remove or customize Commitlint. Commitlint checks if your commit messages meet the conventional commit format. But in case you are using JIRA you might want to have a different commit message structure, example and another
This project is written to typescript. If you aren't that familiar with typescript this cheatsheet is a great resource to get familiar.
Documentation for this project is present in storybook. Run npm run storybook to start up the documentation.
This project uses styled-components and styled-system to create the ui library, but using css, css modules and sass are still supported.
The component archicture is set up following the atomic design methodology.
Big thanks to:
Tim de Wolf
https://github.com/tpdewolf