This project is a Next.js application (pages dir) using Nx monorepo.
This section contains the steps needed set up your system. The key takeaway is you need NodeJS LTS (18.x.x) installed.
- Have Node.js and Npm installed firstly by running:
brew install nodejs - Install
nas a Node Version manager using:npm install -g n - Install the LTS version of nodejs/npm using:
sudo n lts - Install Pnpm:
npm i -g pnpmand verify:pnpm --version.
- Clone the repository:
git clone https://github.com/jobstash/app.git. - Install dependencies:
cd app/ && pnpm install - Init husky:
npx husky install - Create a new
env.localinapps/webfolder based from.env-example.
This section contains the step needed to run the application locally on your machine.
- To start the application in development, run
pnpm dev - Go to
http://localhost:3000to view the app. - Make sure
NEXT_PUBLIC_MW_URLpoints to a working instance of mw.
- Nx: Smart, Fast Extensible Build System
- NextJS: the React Framework for Production
- Tailwindcss: rapidly build modern websites without ever leaving your HTML
- Make sure
huskyis installed. - Do commits as usual. Make sure all lints passed.
- Push to
devbranch or better yet, open a PR for review.
- Libs are categorized as one of the following:
core- constants, interfaces, type definitions and other shared instancesutils- any utility functionsdata- fetch functions and other api related utilitiesstate- client state e.g. hooks, atoms, etcui- components which ideally should be statelessfeature- components which preferrably all state and data fetching happenspages- individual pages exported as default and used bynextjsapp- the application consuming all these libs
- There's a hierarchy among these libs. For instance,
corelibs should not be able to import other libs,utillibs can't import hooks etc. This rules are in place for maintainability and best practices. For specific rules check@nx/enforce-module-boundariesin.eslintrc.json - You can view this hierarchy in your browser by runing
pnpm nx graph - This monorepo also takes advantage of
nx's cache which is extremely useful when performing lots of builds and tests. For instance when running all tests, if there are no changes associated with the lib and its dependencies, it will skip the test for this lib and all its dependencies too. This results in much faster time for all tests. More info here: Nx Cache Task Results