Skip to main content

🚦 Start

πŸ—‚οΈ Folder Structure​

caution

We have a monorepo structure. Run all commands (espeically anything to do with installing) from root directory otherwise dependencies will get in a mess.

rentreef # root directory of your site
β”œβ”€β”€ package.json # npm workspaces
β”œβ”€β”€ package-lock.json # the only one
β”œβ”€β”€ πŸ“ node_modules # root level
β”œβ”€β”€ πŸ“ functions # firebase functions
β”œβ”€β”€ πŸ“ www # next.js & storybook
β”‚ β”œβ”€β”€ TailwindUIExΒ amples # TailwindUI
β”‚ β”œβ”€β”€ πŸ“ node_modules # www level
β”‚ └── πŸ“ src
β”‚ β”œβ”€β”€ πŸ“ components # React components
β”‚ β”œβ”€β”€ πŸ“ pages # Next pages
β”‚ └── πŸ“ stories # storybook
β”‚
└── πŸ“ app-docs # documentation
β”œβ”€β”€ docs # main folder for docs
β”œβ”€β”€ docusaurus.config.js # config
└── πŸ“ node_modules # app-docs level

NPM Workspaces​

NPM Workspaces

Workspaces is a generic term that refers to the set of features in the npm cli that provides support to managing multiple packages from your local files system from within a singular top-level, root package.

npm install --workspace=app-docs # run a command in app-docs
npm install -w=app-docs # run a command in app-docs

Get started​

Environment file​

cd www
touch env.local
NEXT_PUBLIC_FIREBASE_API_KEY=
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=
NEXT_PUBLIC_FIREBASE_DATABASE_URL=
NEXT_PUBLIC_FIREBASE_PROJECT_ID=
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=
NEXT_PUBLIC_FIREBASE_APP_ID=
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=

Install Dependencies​

# within `root` rentreef directory
npm install

This will create a node_modules folder in the root of rentreef, in the www folder and app-docs folder. It will only create one package-lock.json in the root rentreef folder.

Next.js dev server​

# within `www` directory or `root` directory
npm run dev

Storybook dev server​

# within `www` directory or `root` directory
npm run sb

Docusaurus dev server​

# within `app-docs` directory or `root` directory
npm run start