Skip to content
This repository has been archived by the owner on Dec 10, 2023. It is now read-only.

Commit

Permalink
Update Project Museum
Browse files Browse the repository at this point in the history
1. Update README
2. Lint the code on a modern way
3. Add docker images
4. Add github actions
  • Loading branch information
Giglium committed Dec 10, 2023
1 parent 4b34356 commit 36805e4
Show file tree
Hide file tree
Showing 17 changed files with 571 additions and 805 deletions.
4 changes: 4 additions & 0 deletions .github/linters/.jscpd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"threshold": 25,
"absolute": true
}
2 changes: 2 additions & 0 deletions .github/linters/.sqlfluff
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[sqlfluff]
dialect = mysql
40 changes: 40 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI to GHCR

on:
push:
branches:
- main

env:
IMAGE_NAME: project-museum

jobs:
push:
runs-on: ubuntu-latest

steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Log in to GitHub Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta. outputs.labels }}
25 changes: 25 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Lint Code Base

on:
push:
branches:
- main

jobs:
build:
name: Lint Code Base
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Lint Code Base
uses: github/super-linter@v5
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
5 changes: 5 additions & 0 deletions .sqlfluffignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore this files due to open issue: https://github.com/sqlfluff/sqlfluff/issues/901
function.sql
procedure.sql
trigger.sql
query.sql
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM mysql:5.5

ENV MYSQL_ROOT_PASSWORD=root
ENV MYSQL_DATABASE=museum
ENV MYSQL_USER=museum
ENV MYSQL_PASSWORD=museum

COPY ./sql/*.sql /docker-entrypoint-initdb.d/

EXPOSE 3306
50 changes: 46 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,50 @@
# Project Museum
The museum manager database.
This repository encompasses the report and code developed for the "Basi di Dati" (Database Systems) project as part of the Bachelor's Degree program at the University of Padua during the academic year [A.A. 2015/2016](https://en.didattica.unipd.it/off/2015/LT/SC/SC1167/000ZZ/SCP4065533/N0).

## Project for "*Basi di Dati*"
A.A. 2015/2016 at *University of Padua*
## Project Specification
The project must meet the following requirements:
1. Utilization of more than five tables;
2. Incorporation of at least one hierarchical dataset.;
3. Inclusion of all three types of relationships: one-to-one (1:1), one-to-many (1:N) or many-to-many (M:N);
4. Implementation of at least six relevant queries and/or procedures;
5. Integration of at least two functions;
6. Introduction of at least two triggers.

## Project idea and realization
Given Padua's rich history and cultural heritage, abundant with artifacts dating back to ancient times, a museum management system was simulated for this project.
The system managed a museum, its employees and artifacts. The architecture and relationships are visualized in the ER diagram:

![ER diagram of the project](./img/erDiagram.png)

## Project Structure
The project is organized as follows:
* the `img` directory contains ER diagrams in PNG format, along with the original [DIA](http://dia-installer.de/) file;
* the `sql` directory houses all SQL scripts, segmented into files arranged in logical groups;
* the `report.pdf` file represents the Italian project report submitted.

## Prerequisites
* [MySQL 5.5](https://www.mysql.com/)

## Usage
```shell
git clone https://github.com/Giglium/Project-Museum.git
cd Project-Museum/sql
mysql -u <username> -p
source createDatabase.sql;
source function.sql;
source procedure.sql;
source query.sql;
source triggers.sql;
```
## Docker Usage
```shell
docker run -d -rm --name project-museum -p 3306:3306 ghcr.io/giglium/project-museum:latest
```

## Authors
* [Francesco Antonio Migliorin](https://github.com/Giglium)
* [Davide Saonara](https://github.com/solosao)

## License
* [MIT License](https://opensource.org/licenses/MIT)
This project is licensed under the MIT License - see
the [LICENSE](https://github.com/Giglium/vinted_scraper/blob/main/LICENSE) file for details.
File renamed without changes.
File renamed without changes
File renamed without changes.
Loading

0 comments on commit 36805e4

Please sign in to comment.