Starter template for building a project using React, Typescript, Next.js, Jest, TailwindCSS and ESLint.
cd
in the project directory.git remote rm origin
..env.example
to .env
as that file is used to load up all your environment variables.yarn install
or npm install
to install all dependencies.yarn dev
: To start a local development server.
yarn test
: To run the entire unit test suite using jest
.
yarn test:ci
: To run tests on CI.
yarn lint
: To run the ESLint based linter to find out the issues in the project.
yarn lint:fix
: To autoformat all the issues.
yarn export
: Run this after running yarn analyze
to export a build copy.
yarn production
: To export a production build. Use yarn start
to serve that.
yarn upgrade --latest
: To upgrade all packages to their latest versions (could include breaking changes).
All source code is located in the src/
directory.
All Next.js entrypoints are housed in the src/pages
directory as a default.
_app.tsx
which imports TailwindCSS.index.tsx
. NOTE: Feel free to move pages
outside of src/
if that's what you prefer. You'll just need to restart your local development server and everything should continue working as normal.
src/components
are all stateless reusable components.
src/css
folder is there just to house any CSS.
All env variables are available in .env
files (.env
file isn't committed). Whenever you update .env
, please update .env.example
and .env.test
and next.config.js
to proxy all environment variables properly.
process.env.<VAR_NAME>
.If you feel like changing the directory structure, please change the appropriate settings in the following files:
jest.config.js
postcss.config.js
tsconfig.json
lint
and the lint:fix
scripts in package.json