- Verify that you are running the backend with the Java version 21 SDK.
- Ensure your directory is set to art-gallery-master (
cd art-gallery-master). - In the root directory, you will find the file open_project.sh.
- Simply run this bash script (
./open_project.sh) in a Git Bash terminal, and the entire site will be loaded.
The Art Gallery Project offers an engaging and interactive platform for exploring a vast collection of famous artworks. Users can contribute their own creations, comment on existing works, or even use an intuitive drawing tool to save custom art directly into the gallery.
-
Gallery Browsing
- Extensive and dynamic collection of famous artworks
- Interactive carousel for seamless navigation
- Sorting and filtering options for personalized exploration
- Fully responsive design for desktop and mobile devices
-
Commenting System
- Supports both guest and registered users
- Secure and efficient comment management
- Real-time updates for a smooth user experience
- Moderation tools for maintaining community integrity
-
User Gallery
- Simple and fast artwork upload
- Editable submissions for customization
- Interactive drawing widget for unique creations
- Community-focused features to encourage engagement
-
Random Artwork Button
- Picks a random piece from the 60 available artworks
- Offers an easy way to explore diverse art
-
Drawing Feature
- Easy-to-use interface for creating original art
- Save and share creations to the interface
The backend leverages Spring Boot for a robust, efficient, and secure architecture, handling server-side operations seamlessly.
Key Components:
- Spring Data JPA for efficient database interactions
- Spring Web for building RESTful APIs
- Spring Security for authentication and authorization
- Maven Wrapper for simplified dependency management
- *Spring Cache and Retry Mechanisms for optimized performance
An H2 in-memory database is used for development and testing, providing quick and lightweight persistence. Cache and retry mechanisms are implemented for the proxyImage method in ArtController, leveraging spring-retry and caching.
Developed with Angular, the frontend delivers a modern, dynamic, and responsive user experience.
-
Backend
- Java 21
- Spring Boot 3.4.1
- Spring Data JPA
- Spring Web
- Spring Security
- H2 Database
- Maven 3.9.9
- Lombok 1.18.30
-
Frontend
- Angular 16
- TypeScript
- HTML5 & CSS3
- RxJS
- Bootstrap (Optional)
-
Development Tools
- Visual Studio Code
- Git
- Postman
- Docker (Optional)
This API provides access to the Art Gallery application functionality, allowing users to retrieve artworks, submit comments, and manage user-submitted artworks. Below are the available endpoints for interaction.
- GET /api/artworks
- Retrieves a comprehensive list of all artworks in the main gallery. Each artwork entry includes details such as title, artist, year of creation, and associated image URL.
- GET /api/proxy?url={imageUrl}
- Proxies requests to external image URLs. This allows for the retrieval of images without exposing the original source URLs, enhancing security and avoiding CORS issues.
-
POST /api/comments
- Adds a new comment to an artwork. Requires the
artId,text, optionalusername, and optionalpassword(for authenticated users). If no username is provided, the comment will be associated with a "Guest" account.
- Adds a new comment to an artwork. Requires the
-
POST /api/comments/edit
- Updates an existing comment. Requires the
commentId,text, optionalusername, and optionalpasswordfor authentication. This endpoint uses the HTTPPOSTmethod for updates.
- Updates an existing comment. Requires the
-
POST /api/comments/delete
- Deletes an existing comment. Requires the
commentId, optionalusername, and optionalpasswordfor authentication. This endpoint uses the HTTPPOSTmethod for deletions.
- Deletes an existing comment. Requires the
-
GET /api/comments/recent
- Fetches the most recent comments from all artworks. Each comment returned includes details about the commenter, the associated artwork, and the date created.
-
GET /api/user-art
- Retrieves all artworks submitted by users. This endpoint allows users to view their own contributions to the gallery.
-
POST /api/user-art/upload
- Uploads a new artwork submitted by a user. Requires the
title,artistname,year, andimagefile. Optionally, it can include ausernameandpasswordfor authenticated submissions.
- Uploads a new artwork submitted by a user. Requires the
-
PUT /api/user-art/edit
- Updates an existing user-submitted artwork. Requires the unique
artIdand the new details (title,artist,year, and optionalimagefile). Authentication is necessary to ensure user ownership. This endpoint uses the HTTPPUTmethod to conform to RESTful principles.
- Updates an existing user-submitted artwork. Requires the unique
-
DELETE /api/user-art/delete
- Deletes a user-submitted artwork. Requires the
artId,username, andpasswordfor authentication. Only the original uploader can delete their artwork. This endpoint uses the HTTPDELETEmethod to conform to RESTful principles.
- Deletes a user-submitted artwork. Requires the
Some endpoints (such as comment addition and user art management) require authentication via username and hashed password to ensure that only authorized users can make modifications or deletions. Passwords are not stored in plain text; they are securely hashed.
- Java Development Kit (JDK) 17 or Higher
- Maven 3.9.9 or Higher
- Node.js and npm
- Git
- Clone the Repository
git clone <repository_url>
cd art-gallery- Backend Setup
cd backend
./mvnw clean install
./mvnw spring-boot:run- Frontend Setup
cd ../frontend
npm install
ng serveAccess the application at http://localhost:4200
This project is licensed under the MIT License - see the LICENSE file for details.