From 98870d51f1353fb610ce148b4d16754a26783a72 Mon Sep 17 00:00:00 2001 From: Steve Dogiakos Date: Mon, 27 Jan 2025 13:25:14 -0700 Subject: [PATCH] Steve's initial commit --- .gitignore | 6 ++++++ Dockerfile | 20 ++++++++++++++++++++ README.md | 35 +++++++++++++++++++++++++++++++++++ app.js | 31 +++++++++++++++++++++++++++++++ index.html | 28 ++++++++++++++++++++++++++++ package.json | 0 6 files changed, 120 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 app.js create mode 100644 index.html create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..69c1fc2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +# Node modules +node_modules/ + +# Environment files or credentials +.env +credentials.json diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..25d0b85 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# Use a lightweight Node image +FROM node:18-alpine + +# Create app directory +WORKDIR /app + +# Copy package.json first to leverage Docker caching +COPY package.json . + +# Install dependencies +RUN npm install + +# Copy the rest of the application files +COPY . . + +# Expose port 3000 (the port your Node app will run on) +EXPOSE 3000 + +# Start the server +CMD ["node", "app.js"] \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..3a7aa57 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +This is a simple kiosk landing page that embeds a Google Form and displays approved submissions on a scrolling ticker. + +Features +Embeds an existing Google Form in an iframe +Fetches approved entries (Name, Location, Comment) from an API endpoint +Displays approved entries in a scrolling ticker at the bottom of the page +Getting Started +Install Node.js if not using Docker. +Clone this repo and change to the project folder. +Install dependencies: +` npm install ` + +Run locally: +` node app.js ` + +Or: + +` npm start ` + +Then open http://localhost:3000 in your browser. + +Running in Docker +Build the image: +` docker build -t museum-kiosk . ` + +Run a container: +` docker run -p 3000:3000 museum-kiosk ` + +Then open http://localhost:3000 (or the server’s IP) in your browser. + +Configuration +Google Sheets API credentials: Place them as credentials.json (this file should remain uncommitted). +Adjust environment variables or code as needed for your specific form and sheet. +License +MIT License. See LICENSE for details. \ No newline at end of file diff --git a/app.js b/app.js new file mode 100644 index 0000000..1666512 --- /dev/null +++ b/app.js @@ -0,0 +1,31 @@ +const express = require('express'); +const path = require('path'); +// const { google } = require('googleapis'); // only if you're using Google Sheets API + +const app = express(); +const PORT = process.env.PORT || 3000; + +// Serve static files from the 'public' folder +app.use(express.static(path.join(__dirname, 'public'))); + +// Example route to serve index.html +app.get('/', (req, res) => { + res.sendFile(path.join(__dirname, 'index.html')); +}); + +// Example (placeholder) route for approved data +app.get('/api/approved', async (req, res) => { + // TODO: connect to Google Sheets or n8n to fetch approved entries + + // For now, just return some sample data + const dummyData = [ + { name: 'Alice', location: 'Paris', comment: 'Loving this exhibit!' }, + { name: 'Bob', location: 'New York', comment: 'Very insightful museum.' } + ]; + + res.json(dummyData); +}); + +app.listen(PORT, () => { + console.log(`Server running on http://localhost:${PORT}`); +}); diff --git a/index.html b/index.html new file mode 100644 index 0000000..3b4bd3b --- /dev/null +++ b/index.html @@ -0,0 +1,28 @@ + + + + + + Museum Kiosk + + + + +

Welcome to the Museum!

+ + + + + +
+
Loading submissions...
+
+ + + + + \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..e69de29