hobiprojekt

LYZELL’s POTTERY

This webpage showcases a pottery artist’s work with a complete overview of her ceramic creations.

Features

Setup

  1. Start database: docker-compose up -d
  2. Start application: npm start
  3. Access: http://localhost:3000

Project Structure

├── public/                 # Static frontend files
│   ├── index.html         # Main homepage
│   ├── aboutme.html       # About Me page
│   ├── contact.html       # Contact page with form
│   ├── completedpieces.html # Completed works gallery
│   ├── header.html        # Shared header component
│   └── images/            # Pottery images and assets
├── server.js              # Express.js server configuration
├── docker-compose.yml     # Docker services configuration
├── package.json           # Node.js dependencies and scripts
└── README.md              # Project documentation

Technical Stack

Prerequisites

Before running this application, ensure you have the following installed:

Installation

  1. Install the required Node.js dependencies:
    npm install
    

Database Setup

Option 1: Local MySQL/MariaDB Setup

  1. Ensure your MySQL or MariaDB server is running on your local machine

  2. Create and initialize the database using the provided SQL dump:

    mysql -u root -p mydb < dump.sql
    

    This command will:

    • Create the mydb database
    • Set up all necessary tables (collections, pieces, completed_pieces, tags, users, etc.)
    • Configure proper relationships and constraints between tables

For a quick setup with Docker, you can use the provided docker-compose configuration:

  1. Start the MariaDB container:
    docker-compose up mariadb -d
    
  2. Wait for the container to be ready, then initialize the database:
    mysql -h 127.0.0.1 -P 3308 -u root -p123 mydb < dump.sql
    

Database Schema Overview

The application uses a comprehensive database schema designed for pottery management:

Running the Application

  1. Start the Express.js server:
    npm start
    

    Or alternatively:

    node server.js
    
  2. Open your web browser and navigate to:
    http://localhost:3000
    

Available Routes

The application provides the following routes:

Development

Adding New Pottery Pieces

To add new pottery pieces to the database, you can:

  1. Insert records into the collections table for new series
  2. Add individual pieces to the pieces table
  3. Mark pieces as completed in the completed_pieces table
  4. Associate pieces with tags using the piece_tags table

Customizing the Frontend

The frontend files are located in the public/ directory:

Troubleshooting

Common Issues

  1. Database Connection Error: Ensure your MySQL/MariaDB server is running and accessible
  2. Port Already in Use: Check if port 3000 is available or modify the port in server.js
  3. Missing Dependencies: Run npm install to ensure all packages are installed

Database Connection

If you encounter database connection issues, verify:

License

This project is licensed under the ISC License.