naikus / webapp-starter

A starter web application with Fastify API server & React UI

Repository from Github https://github.comnaikus/webapp-starterRepository from Github https://github.comnaikus/webapp-starter

WepApp Starter

This project is organized as a npm workspace. This is a monorepo for two projects.

./server
./web

Install dependencies

npm install

Start a dev server (api server)

npm run server

Start a web app in a separate terminal

npm run web

Build and Run

npm run build Then

cd dist
sh ./run.sh

To start local tunnel, in your root directory:

# To start the localtunnel
npx lt --port 8080 --local-host "127.0.0.1" --print-requests
OR
npx lt --subdomain <subdomain> --port <local-port> --local-host "127.0.0.1" --print-requests

Copy the URL into the browser to access the app (The first time you'll be promped to enter your pubilc IP) Follow the instructions on the page to get it.

Docker

To build a docker image use the following command:

docker build -t webapp-starter .

To run use the following:

docker run -d -p 8080:8080 [-e ENV_VAR=value]* webapp-starter:latest

e.g.

docker run -d -p 8080:8080
  -e LOG_LEVEL=info
  webapp-starter:latest

Following env values can be set:

LOG_LEVEL=info
API_LOG_LEVEL=debug
DEBUG=true

About

A starter web application with Fastify API server & React UI


Languages

Language:JavaScript 61.9%Language:Less 35.6%Language:HTML 1.5%Language:Dockerfile 0.7%Language:Shell 0.3%