Skip to content

Latest commit

 

History

History
64 lines (47 loc) · 1.48 KB

File metadata and controls

64 lines (47 loc) · 1.48 KB

Make Movies UI

No frills Next.js + Chakra based UI for movie library maintenance.

Development

Works well with a mock api provided in ./mock-api.

Then:

npm run dev

Open http://localhost:3000 with your browser.

Docker

docker build -t make-movies-ui .
docker run -it --rm -p 3000:3000 make-movies-ui

Deploy

For simplicity, I run this on Ubuntu via systemd.

  1. Build and copy an export to a central place (note there is some juggling here, all documented via Next.js).

    npm install
    npm run build
    
    mkdir -p /opt/make-movies/ui
    
    cp -r .next/standalone/* /opt/make-movies/ui
    cp -r .next/standalone/.next /opt/make-movies/ui/.next
    cp -r public /opt/make-movies/ui/public
    cp -r .next/static /opt/make-movies/ui/.next/static
  2. Create systemd unit in /etc/systemd/system/make-movies-ui.service:

    [Unit]
    Description=Make movies UI
    Wants=network-online.target
    After=network-online.target
    
    [Service]
    Type=simple
    Restart=on-failure
    WorkingDirectory=/opt/make-movies/ui
    ExecStart=node /opt/make-movies/ui/server.js
    
    [Install]
    WantedBy=default.target
  3. Reload systemd, start and enable the service:

    sudo systemctl daemon-reload
    sudo systemctl enable make-movies-ui
    sudo systemctl start make-movies-ui
  4. Browse to http://localhost:3000