Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release #7

Open
wants to merge 68 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
cdda2e0
chore: add project file structure
Arthur-Bottemanne Aug 29, 2024
0a4a9f1
feat: make website functional with initial setup
Arthur-Bottemanne Aug 29, 2024
6c0bf98
feat: add simple router
Arthur-Bottemanne Aug 29, 2024
85812ef
refactor: add layout for view pages
Arthur-Bottemanne Aug 29, 2024
256d6d6
chore: add new packages and create composer.lock
Arthur-Bottemanne Sep 3, 2024
e55ae4a
chore: add .env.example file
Arthur-Bottemanne Sep 3, 2024
122af62
feat: add DBConnection class for managing database
Arthur-Bottemanne Sep 3, 2024
64b3af9
feat: add query execution
Arthur-Bottemanne Sep 4, 2024
220da99
chore: add PHP_CodeSniffer and configure PSR12 convention
Arthur-Bottemanne Sep 4, 2024
7e3133a
chore: add gitignore template
NukLord Sep 10, 2024
332a069
chore: add phpunit framework
Arthur-Bottemanne Sep 10, 2024
3043426
chore: added README template
Arthur-Bottemanne Sep 11, 2024
5b9df80
test
Arthur-Bottemanne Sep 11, 2024
04e9d9a
Merge branch 'feature/initial-website-setup' into develop
Arthur-Bottemanne Sep 24, 2024
bc8a726
feat: Added home page HTML
Arthur-Bottemanne Sep 24, 2024
be208fe
doc: conceptualized CDM
Arthur-Bottemanne Sep 24, 2024
6b77b95
chore: removed unnecessary file
Arthur-Bottemanne Sep 24, 2024
5f21dd5
doc: add associations
walvie Sep 24, 2024
3cd9bc0
doc: conceptualize LDM
walvie Sep 24, 2024
717d385
doc: fixed minor LDM issues
walvie Sep 24, 2024
9b76136
feat: changed DatabaseConnection class into singleton
walvie Sep 24, 2024
f9853a1
refactor: more appropriate class and folder names
walvie Sep 24, 2024
5691450
feat: Implemented add exercise method
walvie Sep 24, 2024
d50c987
fix: database parameters use ENV values
walvie Sep 24, 2024
fb5bcb9
feat: add exercises controller
Arthur-Bottemanne Sep 25, 2024
efc47e1
refactor: applied PSR-12 rules
Arthur-Bottemanne Sep 25, 2024
3c712da
fix: update LDM and CDM
Arthur-Bottemanne Sep 25, 2024
101b98e
fix: updated LDM and CDM version
Arthur-Bottemanne Sep 25, 2024
62fcdf3
feat: add css template
NukLord Sep 26, 2024
cc0d824
feat: add URI routes
Oct 1, 2024
c27d017
Merge branch 'feature/home-page-implementation' into develop
Oct 1, 2024
3f70667
Merge pull request #1 from CPNV-ES/feature/home-page
Arthur-Bottemanne Oct 1, 2024
18e7166
Frontend create an exercise
NukLord Oct 2, 2024
3fcd0a3
feat: add exercise controller route
Oct 2, 2024
0f3a490
chore: add autoload folder
Oct 2, 2024
5761804
refactor: add Handler, Router and Controller related classes
Arthur-Bottemanne Oct 8, 2024
c78862c
fix: fixed layout require path
Arthur-Bottemanne Oct 8, 2024
c36cfcf
feat: linked backend to the frontend and improved model classes
Arthur-Bottemanne Oct 8, 2024
b136a70
Merge branch 'develop' into feature/create-exercise-page
Arthur-Bottemanne Oct 8, 2024
7b99a13
Merge pull request #2 from CPNV-ES/feature/create-exercise-page
Arthur-Bottemanne Oct 8, 2024
389b86a
refactor: capitalized files for coherent naming convention
Arthur-Bottemanne Oct 8, 2024
832b46c
feat: add frontend to /exercises/answering page
Arthur-Bottemanne Oct 8, 2024
7ca6d9f
feat: fetch and display exercises
Arthur-Bottemanne Oct 8, 2024
9295056
feat: page exercise Fields
NukLord Oct 8, 2024
243fa0d
feat: implemented Field backend class
Arthur-Bottemanne Oct 8, 2024
8e4e4b0
Merge branch 'feature/exercise-field-page' of github.com:CPNV-ES/MAW1…
Arthur-Bottemanne Oct 8, 2024
f424eae
refactor: changed method name to function to be more explicit
Arthur-Bottemanne Oct 8, 2024
979f229
feat: modified classes to allow for dynamic ids in url
Arthur-Bottemanne Oct 8, 2024
ca6567f
Merge pull request #3 from CPNV-ES/feature/take-exercise-page
Arthur-Bottemanne Oct 9, 2024
33544b6
refactor: change file capitalization to be coherent
Arthur-Bottemanne Oct 9, 2024
42bdc62
fix: updated style
Arthur-Bottemanne Oct 9, 2024
be87c1f
feat: add update method for exercise and model classes
Arthur-Bottemanne Oct 10, 2024
a379af8
fix: change form action url
Arthur-Bottemanne Oct 10, 2024
7386eca
feat: returns row when insert
Arthur-Bottemanne Oct 10, 2024
a8c7712
Merge pull request #5 from CPNV-ES/feature/create-exercise-redirect
Arthur-Bottemanne Oct 10, 2024
60114de
Merge branch 'develop' of github.com:CPNV-ES/MAW11-ABE-NUI into featu…
Arthur-Bottemanne Oct 10, 2024
7ad56d6
Merge pull request #4 from CPNV-ES/feature/home-page-style
Arthur-Bottemanne Oct 10, 2024
d1c82c6
fix: modified frontend to resemble looper website
Arthur-Bottemanne Oct 10, 2024
b6792ac
feat: added fontawesome to layout
Arthur-Bottemanne Oct 10, 2024
18c75f9
feat: add dynamic data to page
Arthur-Bottemanne Oct 10, 2024
b8678ae
Merge branch 'develop' into feature/exercise-field-page
Arthur-Bottemanne Oct 11, 2024
1d4c75a
fix: merge errors
Arthur-Bottemanne Oct 11, 2024
61c7d19
Merge pull request #6 from CPNV-ES/feature/exercise-field-page
Arthur-Bottemanne Oct 11, 2024
138925e
creation of the new_exercise page and debug
NukLord Nov 21, 2024
4bf9ef2
fix code
NukLord Dec 18, 2024
b0693d4
last version
NukLord Dec 20, 2024
3d78829
change port to data base
NukLord Dec 20, 2024
5e70ee2
Update README.md
NukLord Dec 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
DATABASE_HOST="placeholder"
DATABASE_PORT="placeholder"
DATABASE_NAME="placeholder"
DATABASE_USERNAME="placeholder"
DATABASE_PASSWORD="placeholder"
173 changes: 173 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
# Cache, temp and personal files
.env
.vscode
/.htaccess
*.log

# Cache
/cache/*
!/cache/.htaccess
!/cache/cachefs/index.php
!/cache/deprecated.txt
!/cache/index.php
!/cache/purifier/index.php
!/cache/push/activity
!/cache/push/index.php
!/cache/push/trends
!/cache/sandbox/index.php
!/cache/smarty/cache/index.php
!/cache/smarty/compile/index.php
!/cache/smarty/index.php
!/cache/tcpdf/index.php

# Download
/download/*
!/download/.htaccess
!/download/index.php

# Images
/img/*
!/img/.htaccess
!/img/index.php
!/img/404.gif
!/img/bg_500.png
!/img/bg_loader.png
!/img/favicon.ico
!/img/loader.gif
!/img/loadingAnimation.gif
!/img/logo.jpg
!/img/logo.png
!/img/logo_invoice.jpg
!/img/logo_stores.png
!/img/macFFBgHack.png
!/img/prestashop-avatar.png
!/img/[email protected]
!/img/[email protected]
!/img/[email protected]
!/img/questionmark.png
!/img/genders/index.php
!/img/admin/index.php
!/img/c/index.php
!/img/cms/index.php
!/img/co/index.php
!/img/jquery-ui
!/img/l/index.php
!/img/m/index.php
!/img/os/index.php
!/img/p/index.php
!/img/s/index.php
!/img/scenes
!/img/st/index.php
!/img/su/index.php
!/img/t/index.php
!/img/tmp/index.php

# Upload
/upload/*
!/upload/.htaccess

/vendor/*
/docs/phpdoc-sf/
/composer.lock
*.hot-update.js
*.hot-update.json


/admin-dev/autoupgrade/*
!/admin-dev/autoupgrade/index.php
!/admin-dev/autoupgrade/backup/index.php

/admin-dev/backups/*
!/admin-dev/backups/.htaccess

/admin-dev/import/*
!/admin-dev/import/.htaccess
!/admin-dev/import/index.php

/admin-dev/export/*
!/admin-dev/export/.htaccess
!/admin-dev/export/index.php

# Downloaded RTL files
/admin-dev/themes/default/css/bundle/default_rtl.css
/admin-dev/themes/default/css/bundle/shared_rtl.css
/admin-dev/themes/default/css/font_rtl.css
/admin-dev/themes/default/css/overrides_rtl.css
/admin-dev/themes/default/css/vendor/font-awesome/font-awesome_rtl.css
/admin-dev/themes/default/css/vendor/nv.d3_rtl.css
/admin-dev/themes/default/css/vendor/titatoggle-min_rtl.css
/admin-dev/themes/default/public/theme_rtl.css
/admin-dev/themes/new-theme/css/module/drop_rtl.css
/admin-dev/themes/new-theme/css/right-sidebar_rtl.css

themes/*/cache/*

# Config

config/settings.inc.php
config/settings.old.php
config/xml/*
config/themes/*
!config/xml/themes/default.xml
themes/*/config/settings_*.json
app/config/parameters.old.yml
app/config/config.php

# Themes, modules and overrides

modules/*
override/*
themes/*/
!themes/classic
!themes/_core
!themes/_libraries

# Vendors and dependencies

bower_components/
node_modules/
composer.phar
php-cs-fixer
.grunt/*

# Translations and emails templates

translations/*
mails/*
!mails/themes/
!mails/_partials/
themes/default-bootstrap/lang/*
themes/default-bootstrap/modules/*/translations/*.php
themes/default-bootstrap/mails/*
!themes/default-bootstrap/mails/en/
themes/default-bootstrap/modules/*/mails/*
!themes/default-bootstrap/modules/*/mails/en

# MISC

*sitemap.xml
/robots.txt

# Symfony

/bin/
/app/Resources/geoip/GeoLite2-City.mmdb
/app/Resources/translations/*
!/app/Resources/translations/default
/app/config/parameters.yml
/app/config/parameters.php
/build/
/phpunit.xml
/var/*
!/var/cache
/var/cache/*
!var/cache/.gitkeep
!/var/logs
/var/logs/*
!var/logs/.gitkeep
!/var/sessions
/var/sessions/*
!var/sessions/.gitkeep
!var/SymfonyRequirements.php
/vendor/
/web/bundles/
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Utilise l'image officielle MariaDB comme base
FROM mariadb:10.11

# Définit le répertoire de travail
WORKDIR /var/lib/mysql

# Copie les fichiers de configuration personnalisés si nécessaires
# COPY my-custom.cnf /etc/mysql/conf.d/

# Définit les variables d'environnement pour MariaDB
ENV MYSQL_ROOT_PASSWORD=root_password
ENV MYSQL_DATABASE=my_database
ENV MYSQL_USER=my_user
ENV MYSQL_PASSWORD=my_password

# Expose le port par défaut de MariaDB
EXPOSE 3306

# Commande par défaut pour démarrer MariaDB
CMD ["mysqld"]
80 changes: 80 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# MAW11 - Exercice Looper

## Subject

Create a copy of this web application: [Exercice Looper](https://maw-looper.mycpnv.ch/)

## Deadlines

- **Intermediate:** 31.10.2024
- **Final:** 21.12.2024

## Requirements

You must use:

- HTML5
- CSS
- PHP
- Object-Oriented Programming (OOP)

## Installation

### Local Installation (for Development)

#### Prerequisites:

1. Have PHP and a database connection service installed.
2. Verify the installation in a shell:
```bash
php -v
```
Successful verification occurs if the command is recognized.

#### Procedure:

1. Clone the repository from GitHub or download it as a ZIP file:
```bash
git clone <repository_url>
```
Example: Clone it into the folder `C:/Users/<username>/Documents/Github/`.

2. Set up the database:
- Run the provided script `create_db.sql` located in the `modelisation` folder to create the necessary database.
- Database connection details are:
```php
DBConnection::setUp(
'mysql:host=127.0.0.1;port=3308;dbname=looper;charset=utf8mb4',
'root',
'root_password'
);
```

3. Install dependencies:
```bash
composer install
```
Run this command in the root of the project directory.

4. Start the development server:
```bash
php -S localhost:4444 -t public
```

## Progress

### Completed Features:

- Exercise creation works.
- Field creation works.
- Fields can be viewed within an exercise.

### Known Issues:

- Exercises cannot be viewed.
- Fields cannot be viewed individually.
- Exercises cannot be filled.
- Responses cannot be viewed.
- CSS is broken.
- No best practices like dotenv or similar are followed.
- Code documentation is minimal.
19 changes: 19 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: "3.9"

services:
mariadb:
image: mariadb:10.11 # Utilise l'image officielle MariaDB
container_name: looper-db
environment:
MYSQL_ROOT_PASSWORD: root_password # Mot de passe root
MYSQL_DATABASE: my_database # Base de données initiale
MYSQL_USER: my_user # Utilisateur
MYSQL_PASSWORD: my_password # Mot de passe utilisateur
volumes:
- db_data:/var/lib/mysql # Persist les données
ports:
- "3308:3306" # Mappe le port 3306
restart: always

volumes:
db_data:
20 changes: 20 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "nui/maw11",
"type": "project",
"minimum-stability": "stable",
"require": {
"ext-pdo": "*"
},
"autoload": {
"psr-4": {
"App\\": "src/",
"Controllers\\": "src/Controllers",
"Router\\": "src/Router",
"Database\\": "src/Database/",
"Models\\": "src/Models/"
}
},
"require-dev": {
"phpunit/phpunit": "^9"
}
}
Loading