PICUS' template for universal Node/React applications. It offers you the required tooling for your universal JavaScript application, as well as an opinionated full-stack ready to kick-off your next project.
- 👀
reactas the view. - 🎛 Preconfigured with
redux. - 🚄
expressserver. - 🛢️
sequelizeORM for data persistence. - 📦
pm2for process management. - 👌 Airbnb's ESlint configuration and Standard Stylelint - performing code formatting on commit. Stop worrying about code style consistency.
- 📝
browserslistto share target browsers between different front-end tools. - 🌍 Server Side Rendering with
next.js. - 🔧 Centralised application configuration with helpers to avoid boilerplate in your code. Also has support for environment variables.
- 💅
styled-componentsto style your apps without stress. - ⛑ SEO friendly - provides control of title/meta from within your pages.
- 📊 Google Analytics support.
- 🐞 Error tracking with Sentry.
- ⚙️ Offline mode with Service Workers.
- 👮 Security on the
expressserver usinghelmetandhpp. - 🏜 Asset bundling support. e.g. images/svgs/fonts.
$ npm install2. Configure Environment variables
$ npm run db:migrate:seeds$ npm run devStarts a development server.
$ npm run buildBuilds the project for production, producing the bundled assets.
$ npm startStarts a production server. You must run npm run build before running this command.
$ npm run lintRuns ESlint and Stylelint on the project.
We use conventional commit messages: commitlint/config-conventional.
$ npm run docsRuns react-docgen to generate Markdown documentation for each component available in components. By default it generates a doc.md inside the component directory.
Your project can consume variables declared in your environment by accessing them via process.env.
The following variables will be made available:
SITE_URL: The URL where the site will be running, e.g.,http://project-name.comHOST: The host where the site will be running, e.g.,localhostPORT: The port where the site will be running, e.g.,3000DB_USER: The user name used for database connection.DB_PASSWORD: The user's password used for database connection.DB_HOST: The database connection, the value can be a IP address or a domain.REACT_APP_*: Custom variables that may be accessible in both the client and server bundles.NODE_ENV: One ofdevelopment,test,stagingorproduction.
These will be embedded at build time, thus are read-only. This means you must rebuild your application every time you change them.
Besides the variables listed above, your server bundle will have access to the whole process.env just like a regular Node.js application.
Only the variables listed above will be available.
If you need custom environment variables, you must prefix them with REACT_APP_. This avoids accidentally exposing sensitive environment variables, such as a private key or a database credential.
Environment variables defined on .env file will be loaded into process.env.
Please read dotenv documentation for more information.
REACT_APP_FOO=bar
This file is ignored in source control and it is intended to be created from .env.sample, which is committed and anyone who clones the project can easily use it as a starting point.
By default, configurations for ESlint, Stylelint are "> 3%, Chrome >= 66, Firefox >= 59, Edge >= 15, Explorer >= 11, Safari >= 11, iOS >= 10.3" based on browserl.ist.