mirror of
https://github.com/tmdinosaurcenter/kiosk-guestbook.git
synced 2025-04-10 14:11:28 -06:00
Steve's initial commit
This commit is contained in:
parent
2e421a2075
commit
98870d51f1
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# Node modules
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# Environment files or credentials
|
||||||
|
.env
|
||||||
|
credentials.json
|
20
Dockerfile
Normal file
20
Dockerfile
Normal file
@ -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"]
|
35
README.md
Normal file
35
README.md
Normal file
@ -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.
|
31
app.js
Normal file
31
app.js
Normal file
@ -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}`);
|
||||||
|
});
|
28
index.html
Normal file
28
index.html
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<title>Museum Kiosk</title>
|
||||||
|
<link rel="stylesheet" href="public/style.css" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<h1>Welcome to the Museum!</h1>
|
||||||
|
|
||||||
|
<!-- Embedded Google Form IFrame -->
|
||||||
|
<iframe
|
||||||
|
src="https://docs.google.com/forms/d/e/1FAIpQLSekn1-da42vLyOAMDwfswxNOtDsPFaiuYABBe9XqhhEssBndw/viewform?embedded=true"
|
||||||
|
width="100%" height="600" frameborder="0" style="border: none;">
|
||||||
|
Loading…
|
||||||
|
</iframe>
|
||||||
|
|
||||||
|
<!-- Ticker Container -->
|
||||||
|
<div id="ticker-container">
|
||||||
|
<div id="ticker-content">Loading submissions...</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="public/script.js"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
0
package.json
Normal file
0
package.json
Normal file
Loading…
x
Reference in New Issue
Block a user