Skip to content
Sabi K edited this page May 7, 2024 · 5 revisions

A front part of Butem po mieście project, built on Nuxt 3 with:

Prerequisites

  • min. Windows 10 with WSL,
  • local environment (if you haven't already):
    • VS Code with extensions (in your IDE go to Extensions tab and enable those plugins (links are just for exact plugin's name reference, it's recommended to install those plugins via VS Code Extensions tab)):
    • Git Bash
  • both projects (butem-bedrock-wp and butem-nuxt) are in the same location ( headless-nuxt-wp directory ) on Ubuntu:
    • go to Windows Explorer -> Ubuntu:

      image

    • create directories projects/headless-nuxt-wp in home/[your_user], ie.: home/[your_user]/projects/headless-nuxt-wp,

    • enter the projects/headless-nuxt-wp directory and from a context menu (right-click mouse button) choose Git Bash Here,

    • ensure that your current path starts with ://wsl.localhost/... and ends with .../headless-nuxt-wp,

    • clone both repos (paste those exact commands in order to create the same directories):
      git clone https://github.com/butempomiesciepoznan/butem-nuxt.git butem-nuxt
      git clone https://github.com/butempomiesciepoznan/butem-bedrock-wp.git butem-bedrock-wp

Setup

  • open your VS Code, go to bottom left corner and enable WSL Remote, then open the butem-nuxt directory:

    Recording 2024-03-23 at 18 03 53

  • open an integrated terminal in VS Code, type in git status - you should see info that you are on branch main,

  • checkout to branch dev: git checkout dev - this is a branch for development, you should create all your working branches from this one,

  • install Node Version Manager, nodejs and pnpm:
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash - after installation verify your version by nvm -v

nvm install 20.11.0
nvm current - verify which version of node you are currently running

npm install -g pnpm

Install the dependencies:

pnpm install

Don't forget to adjust your .env file (use a template from .env.example from this repo and name it accordingly to files used in package.json commands - for local development you need to have .env.local file).

Development Server

Start the development server on http://localhost:3000 (automatically opens a browser):

pnpm dev -o

Staging

Build the application for stage environment:

pnpm run stage

Production

Build the application for production:

pnpm run build

Locally preview production build:

pnpm run preview