A SvelteKit web application designed for quality control of daily photos. It displays seven photos, one for each day of the week, allowing users to approve or regenerate them via a simple interface.
Before you begin, ensure you have the following installed on your system:
Follow these steps to get the application running on your local machine:
Navigate to the project directory:
cd /path/to/your/photo-qc-app
(Replace /path/to/your/photo-qc-app with the actual path to this project on your Linux machine.)
Install dependencies:
npm install
Image Setup:
The application expects your image files to be located in /home/shmolph/photos on your Linux machine. The files should be named after the days of the week (e.g., Monday, Tuesday, Wednesday, etc.) without a file extension, even though they are PNG images.
The application uses a SvelteKit server endpoint to serve these images, so no symbolic linking is required for the images themselves.
Run the development server:
npm run dev
The server is configured to listen on all network interfaces (0.0.0.0), so you can access it from other devices on your network using your machine's IP address (e.g., http://your-ip-address:5173).
Access the application:
Open your web browser and navigate to the dev server URL printed by Vite (for example, http://<your-machine-ip>:5173). Use the exact URL shown in the terminal after running npm run dev.
This application uses @sveltejs/adapter-node for production, which builds a standalone Node.js server.
Ensure adapter-node is installed and configured:
If you haven't already, install it:
npm install @sveltejs/adapter-node
And ensure your svelte.config.js looks like this:
import adapter from '@sveltejs/adapter-node';
/** @type {import('@sveltejs/kit').Config} */
const config = {
kit: {
adapter: adapter()
}
};
export default config;
Build the project for production:
npm run build
This will create a build directory containing your optimized application and server.
Deploy to your Linux server:
package.json, node_modules, and the newly created build directory) to your production server./home/shmolph/photos directory exists on your production server and contains the correctly named image files (e.g., Monday, Tuesday).Start the production server: Navigate to your project directory on the server and run:
node build/index.js
Process Management (Recommended): For continuous operation, use a process manager like PM2 to keep your Node.js server running in the background and restart it automatically if it crashes.
# Install PM2 globally if you don't have it
npm install -g pm2
# Start your app with PM2
pm2 start build/index.js --name "photo-qc-app"
# Save PM2 process list to ensure it restarts on server reboot
pm2 save
. # Project Root
├── src/
│ ├── app.css # Global styles (dark mode, custom font)
│ ├── app.html # Main HTML template
│ ├── routes/
│ │ ├── +layout.svelte # Global layout and style import
│ │ ├── +page.svelte # Main application component (image display, navigation, buttons)
│ │ └── api/
│ │ └── photos/
│ │ └── [day]/
│ │ └── +server.js # API endpoint to serve images from /home/shmolph/photos
├── static/
│ └── # (empty, no longer used for images directly)
├── package.json
├── svelte.config.js
├── tsconfig.json
├── jsconfig.json
└── vite.config.js
sh: 1: vite: not found: This usually means npm install did not complete successfully. Try running npm install again.src/routes/+layout.svelte exists and correctly imports ../app.css.Monday, Tuesday) exist in /home/shmolph/photos on your Linux machine and that the server is running correctly.VITE_API_BASE to the API URL before starting the dev server. Example:$env:VITE_API_BASE = 'http://localhost:3000'
npm run dev
Or create a .env file in the project root with:
VITE_API_BASE=http://localhost:3000
If VITE_API_BASE is not set the frontend will call internal endpoints under /api (mock handlers are provided in src/routes/api/actions).