200 lines
4.6 KiB
Markdown
200 lines
4.6 KiB
Markdown
# Novarix Networks Website
|
|
|
|
`Next.js 16` + `Tailwind CSS v4` website for `Novarix Networks`, built as a fully static site.
|
|
|
|
The site is designed for this workflow:
|
|
|
|
- edit locally
|
|
- push changes to your internal `Gitea` repo
|
|
- run one deploy command on the Ubuntu Nginx VM
|
|
- serve the static `out/` directory from `/var/www/novarix.uk/out`
|
|
- expose it publicly through `Nginx Proxy Manager`
|
|
|
|
## Recommended Repo Name
|
|
|
|
```text
|
|
novarix-networks-homepage
|
|
```
|
|
|
|
Keep all the Novarix domains in repos under the same convention so paths and clone URLs stay predictable, e.g.
|
|
|
|
```text
|
|
http://10.10.10.11:3000/kismet.hasanaj/novarix-networks-homepage.git
|
|
```
|
|
|
|
## Project Structure
|
|
|
|
- `content.ts` **all the editable text on the website lives here**
|
|
- `app/page.tsx` page layout and styling (React + Tailwind utilities)
|
|
- `app/layout.tsx` site-wide metadata, fonts, html shell
|
|
- `app/globals.css` Tailwind v4 entrypoint and design tokens
|
|
- `app/sitemap.ts` generates `/sitemap.xml` at build time
|
|
- `app/robots.ts` generates `/robots.txt` at build time
|
|
- `public/` static assets (logos, branding, favicon)
|
|
- `next.config.ts` configured for static export to `out/`
|
|
- `EDITING.md` plain-English guide for changing content
|
|
- `deploy.sh` server-side update script
|
|
- `ops/nginx/novarix.uk.conf.example` example Nginx config
|
|
|
|
## Important Tailwind / Next.js Note
|
|
|
|
This project uses the current Tailwind CSS v4 setup via `@tailwindcss/postcss`, configured entirely inside `app/globals.css` (no `tailwind.config.js`).
|
|
|
|
The build is a **static export**. `npm run build` produces a fully self-contained `out/` directory. Nginx serves files from that directory directly — there is no Node runtime on the production server.
|
|
|
|
## Ubuntu 24.04 Nginx Server Setup
|
|
|
|
Install Nginx and Git:
|
|
|
|
```bash
|
|
sudo apt update
|
|
sudo apt install -y nginx git
|
|
sudo systemctl enable nginx
|
|
sudo systemctl start nginx
|
|
```
|
|
|
|
Install Node.js 20 or newer. NodeSource currently supports Ubuntu 24.04 with Node 22, which is a good choice for this server:
|
|
|
|
```bash
|
|
sudo apt install -y curl
|
|
curl -fsSL https://deb.nodesource.com/setup_22.x -o nodesource_setup.sh
|
|
sudo -E bash nodesource_setup.sh
|
|
sudo apt install -y nodejs
|
|
```
|
|
|
|
After installing, confirm:
|
|
|
|
```bash
|
|
node --version
|
|
npm --version
|
|
```
|
|
|
|
Create the web directory and make your normal sudo user the owner:
|
|
|
|
```bash
|
|
sudo mkdir -p /var/www
|
|
sudo chown -R $USER:$USER /var/www
|
|
```
|
|
|
|
Clone the Gitea repo:
|
|
|
|
```bash
|
|
git clone http://10.10.10.11:3000/kismet.hasanaj/novarix-networks-homepage.git /var/www/novarix.uk
|
|
```
|
|
|
|
Install the website dependencies and build the static site:
|
|
|
|
```bash
|
|
cd /var/www/novarix.uk
|
|
npm install --no-package-lock
|
|
npm run build
|
|
```
|
|
|
|
After the build completes, the static site lives in:
|
|
|
|
```text
|
|
/var/www/novarix.uk/out
|
|
```
|
|
|
|
Use the Nginx config in:
|
|
|
|
```text
|
|
ops/nginx/novarix.uk.conf.example
|
|
```
|
|
|
|
The important Nginx root is:
|
|
|
|
```nginx
|
|
root /var/www/novarix.uk/out;
|
|
```
|
|
|
|
Enable the site:
|
|
|
|
```bash
|
|
sudo cp ops/nginx/novarix.uk.conf.example /etc/nginx/sites-available/novarix.uk
|
|
sudo ln -s /etc/nginx/sites-available/novarix.uk /etc/nginx/sites-enabled/
|
|
sudo rm -f /etc/nginx/sites-enabled/default
|
|
sudo nginx -t
|
|
sudo systemctl reload nginx
|
|
```
|
|
|
|
## Updating The Live Website
|
|
|
|
After pushing changes to Gitea from your local machine, SSH into the Nginx VM and run:
|
|
|
|
```bash
|
|
cd /var/www/novarix.uk
|
|
./deploy.sh
|
|
```
|
|
|
|
The deploy script does this:
|
|
|
|
```bash
|
|
git pull origin main
|
|
npm install --no-package-lock
|
|
npm run build
|
|
sudo nginx -t
|
|
sudo systemctl reload nginx
|
|
```
|
|
|
|
If the script is not executable yet, run this once:
|
|
|
|
```bash
|
|
chmod +x /var/www/novarix.uk/deploy.sh
|
|
```
|
|
|
|
## Editing The Site
|
|
|
|
For text content (headlines, services, contact details), edit:
|
|
|
|
```text
|
|
content.ts
|
|
```
|
|
|
|
For visual styling, layout, or new sections, edit:
|
|
|
|
```text
|
|
app/page.tsx
|
|
app/globals.css
|
|
```
|
|
|
|
The friendly walk-through for non-developers is:
|
|
|
|
```text
|
|
EDITING.md
|
|
```
|
|
|
|
## Local Development
|
|
|
|
For previewing changes on your own machine before pushing:
|
|
|
|
```bash
|
|
npm install
|
|
npm run dev
|
|
```
|
|
|
|
Then open `http://localhost:3000` in your browser. The page reloads automatically as you save files.
|
|
|
|
## Nginx Proxy Manager
|
|
|
|
Create a proxy host:
|
|
|
|
- Domain: `novarix.uk`
|
|
- Scheme: `http`
|
|
- Forward hostname/IP: private IP of the Ubuntu Nginx VM
|
|
- Forward port: `80`
|
|
- SSL: request certificate and force SSL
|
|
- Enable `Block Common Exploits`
|
|
|
|
If you also want to redirect `www.novarix.uk` and any defensive domains (e.g. `novarixnet.com`), add them as additional proxy hosts pointing at the same backend, or use NPM's redirect host feature.
|
|
|
|
## Canonical Domain
|
|
|
|
Recommended primary domain:
|
|
|
|
```text
|
|
novarix.uk
|
|
```
|
|
|
|
Redirect any other Novarix domains to the primary domain once DNS and Nginx Proxy Manager are ready.
|