From bad92f64de43a3958e26b920f8390a24c5e25bfe Mon Sep 17 00:00:00 2001 From: gitea_admin Date: Sat, 14 Feb 2026 04:01:00 +0000 Subject: [PATCH] frontend --- frontend/.dockerignore | 1 + frontend/.gitignore | 1 + frontend/README.md | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 frontend/.dockerignore create mode 100644 frontend/.gitignore create mode 100644 frontend/README.md diff --git a/frontend/.dockerignore b/frontend/.dockerignore new file mode 100644 index 0000000..8b32c7d --- /dev/null +++ b/frontend/.dockerignore @@ -0,0 +1 @@ +node_modules\n*.log diff --git a/frontend/.gitignore b/frontend/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/frontend/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/frontend/README.md b/frontend/README.md new file mode 100644 index 0000000..372ff86 --- /dev/null +++ b/frontend/README.md @@ -0,0 +1,33 @@ +# Todo App Frontend + +This is a standalone Node.js server that serves the Todo application's web interface. + +## Standalone Setup +1. Clone this repository. +2. Install dependencies: + ```bash + npm install + ``` +3. Start the server: + ```bash + npm start + ``` + The frontend runs on port `3000` by default. + +## Connecting to Backend +The frontend needs to know where the Backend API is hosted. +- **Development**: Defaults to `http://localhost:3001`. +- **Production**: Set the `BACKEND_URL` environment variable when starting the server. + ```bash + BACKEND_URL=https://api.yourdomain.com npm start + ``` + +## Deployment +- **Docker**: + ```bash + docker build -t todo-frontend . + docker run -p 3000:3000 -e BACKEND_URL=https://your-api.com todo-frontend + ``` + +## Repository Independence +This repository is completely separate from the backend repository. It communicates with the backend exclusively via HTTP calls to the `BACKEND_URL`.