Skip to content

Commit

Permalink
Deploy youhouuu (#48)
Browse files Browse the repository at this point in the history
* ♻️: set api to backend folder

* 🐛: fix retrieval of data

* 📝: added README.md and .gitignore

* 📝: added README.md for backend

* 📝: change to project README.md

* 🎉: creating flutter app

* 🔧: created and implementation of env variables and update README.md

* 🚧: created and implementation of env variables and update README.md not finished

* 🐛: fix retrieval of data

* 🎉: creating flutter app

* 🔧: implementation of env variables

* 👷: tests for ci githubaction

* Create main.yml

* 👷: tests for ci githubaction

* 👷: tests for ci githubaction

* 👷: tests for ci githubaction

* 🚧: started data layer and repo
- added a class list to test
- config environnement for main

* 👷: tests for ci githubaction

* 👷: tests for ci githubaction

* 👷: tests for ci githubaction

* ➕: added symfony/apache-pack to symfony
- rename main.yaml to dev.yml

* ✨: added data layer for dayschedule (a day with a list of courses)
- refactor with a global api service
- added new prod url

* 🚧: added login page
- widgets
- login page
- main for debug (to delete)
- added in pubspec assets dir

* 🚧: login form with inputs
- inputs
- styling

* fix: added class_param to dayschedule bloc to get data
- added file conf for run

* 💄: end of login form

* ♻️: changed main and prod.dart

* 🔧: updated base .gitignore
- added .vscode directory

* 🔥: removed .vscode directory at base of project

* 🔥: removed .idea folder

* 🐛: fix calculation of weekend days

* ✨: create classes selection page

* 🐛: fix calculation of weekend days

* ➕: added symfony/orm-pack

* ♻️: refactor all models

* ♻️: add entities to manage schedules

* ➕: added symfony/serializer package

* 💥: change in entity structure and API response

* 💥: change in entity structure and API response

* ♻️: created XMLService to handle fetching

* 👷: removed .gitignore to entity

* 💡: Adding comments to back-end code

* 🚧: handle sharedpreferences when login

* ✨: create timetable page

* 📌: fix php to 8.1 for back

* ✨: added cubits to fetch data

* 🚧: trying to get new schedule

* ♻️: removed timetable class
- changed api models for timetable

* ♻️: added entity to handle classes

* 🐛: fix timetable problem with class

* 📝: added openapi spec

* 📝: updated openapi spec

* 👔: updated hours entity

* ♻️: moved openapi spec

* ♻️: moved openapi spec

* 🚧: trying to get weekschedule data and remove schedule data layer

* 🐛: fixed entity models

* 🐛: fixed entity with api

* 🔧: setup lint for flutter

* 🚨: fixing linter warnings

* 📝: updated readme for backend

* 🚨: added linter for php and fixing linter alerts

* 🐛: fix week schedule vie

* 👷: added steps to ci for linter

* 👷: update ci build

* 👷: added ci for lint and edit deploy script

* 💚: fix path for linter

* ⬇️: sebastian/diff downgrade for ci

* ⬇️: tests

* ⬇️: fix for build composer

* 🚨: dart format

* ok

* 💚: fix ci lint

* 💚: omg wtf is this

* 💚: yes

* ♻️: remove useless import

* fix: remove .env data

* ♻️: remove print linter

* ➕️: added meta depedency

* 🚨: fix warnings from linter

* ➕: added shared preferences

* 🔧: added devtools options

* 💩: je test la

* ➕: added flutter bloc

* ♻️: removed useless views and repositories and renamed some folder

* ♻️: removed useless views and repositories and renamed some folder

* ♻️: dart format

* 🚧: added shared preferences to login page but not redirecting to class page

* ✨: save login info into shared preferences and redirect to class select page

* 💚: dont upload code for pr

* 🚨: Fix lint warnings

* 🐛️: fixed overflow on login page

* 💄: update style files

* ♻️: refactor of datetime input

* 🚨: fix lint warning

* 💩: don't take care about this commit

* 🚧: adapting datas api to front

* 🚧: adapting datas api to front

* fix: dart format

* fix: dart format

* 💄: added some style to week_schedule page

* 💄🚧: planning view
- custom card
- custom app bar

* ✨: Login + Class Selection
- stored in shared preferences
- user repository

* 💄: added font and design

* ✨: added routes + cache for classes

* 🐛: fix with redirection between pages

* 💄: added font and design

* ♻️: refact className and fix conflicts

* ✨: new field in api for lunch time

* ✨: new field in api for lunch time

* ➕: added flutter_localizations and inlt to pubget

* 💄: add menu

* 🚨: forget to make a dart format

* 🌐: Translation of the login and class selection page
- Small refactor of some pages for translation

* 📝: Updated front README.md

* 🙈: not pushing cache to ref

* 🙈: not pushing  cache to ref

* ➕: Added flutter_dotenv to pubspec

* 🔐: Add environnement variables to app

* 🍱: Added .env to pubspec assets

* 📝: Updated frontend README with env vars

* 🔧: Sample env file for frontend

* 💩: dont mind its fixing

* 🚨: ok yan merge fixed lol

* 🚨: ok yan merge fixed lol

* 💩: dont mind its fixing

* 🚨: ok yan merge fixed lol

* 🚨: fix lint

* 🚨: fix lint

* ✨: create profil page

* 🚧💄: design of planning view
👔: added usercubit

* 🚨: dart format

* 👷: supp dist frontend when deploy

* 💚: oops

* 💚: copie seulement du backend

* ♻️🎨💄: - added final design? and improved the structure of widgets
👔: classcubit
👔: usercubit

* ♻️🎨💄: - added final design? and improved the structure of widgets
👔: classcubit
👔: usercubit

* 🌐: i10n

* 🚨: linter

* 🚨: linter

* fix: resolved conflict

* ⏪️: mistake

* 🚧💄: configuration of menu

* 👷: change api host

* 🚨: dart format

* fix: small details about frontend

* fix: menu

* fix: menu

* fix: get current route for menu

* fix: get current route for menu

* ♻️: refactor the code menu

* 🚨: dart format

* ➕: Added flutter_launcher_icons

* ♻️: Refactoring code and merging style files
- Fixing login

* 🔧: config launcher

* 💄: Adapting the AppBar to all pages

* ♻️: Removed Future builders for class page

* ♻️: l10n and add route profil page

* ✨: fetching and display on profile page

* ✨: Added logout page
- ♻️ Refactor of class page
- Added translations

* 🚚: changed route settings for profile page

* ♻️: refactor profil page

* 🚚: Reorganization of some pages

* ♻️: Refactoring login page

* ♻️: Refactoring before handing in the project

* 🌐: add localization

* Merge remote-tracking branch 'origin/dev' into ui/configuration_menu

* 💄: Shared color and added theme config

* 🔀: Resolved merge conflicts

* 💄: changed text size profil

* 🚑️: Fix empty rooms

* 🚑️: Fix empty rooms and usless classes

* 🙈: php cs cache added to gitignore

* 👷: Added CI for main

* 👷: Added CI for main

---------

Co-authored-by: Jules Artaud <[email protected]>
Co-authored-by: Yuta1409 <[email protected]>
Co-authored-by: Jules Artaud <[email protected]>
Co-authored-by: Yan <[email protected]>
  • Loading branch information
5 people authored Mar 15, 2024
1 parent be44b10 commit 36ef422
Show file tree
Hide file tree
Showing 281 changed files with 15,266 additions and 3,343 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/deploy-backend-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Upload backend to dev server and lint

on:
push:
branches:
- dev

env:
FLUTTER_VERSION: 3.10.1

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Upload PHP code
run: scp -o StrictHostKeyChecking=no -r backend ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_HOST }}:/home/imjames/www/API-3IL/dev

install_dependencies:
needs: deploy
runs-on: ubuntu-latest

steps:
- name: SSH Into Server and Install Composer Dependencies
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /home/imjames/www/API-3IL/dev/backend
composer2 install
- name: SSH Into Server and execute Linter for PHP
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /home/imjames/www/API-3IL/dev/backend
vendor/bin/php-cs-fixer fix src


53 changes: 53 additions & 0 deletions .github/workflows/deploy-backend-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Upload backend to PROD server and lint

on:
push:
branches:
- main

env:
FLUTTER_VERSION: 3.10.1

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Upload PHP code
run: scp -o StrictHostKeyChecking=no -r backend ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_HOST }}:/home/imjames/www/API-3IL/prod

install_dependencies:
needs: deploy
runs-on: ubuntu-latest

steps:
- name: SSH Into Server and Install Composer Dependencies
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /home/imjames/www/API-3IL/prod/backend
composer2 install
- name: SSH Into Server and execute Linter for PHP
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /home/imjames/www/API-3IL/prod/backend
vendor/bin/php-cs-fixer fix src


44 changes: 44 additions & 0 deletions .github/workflows/execute-linter-front.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Execute Lint and Format

concurrency:
group: $-$
cancel-in-progress: true

on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev

env:
FLUTTER_VERSION: 3.19.2

jobs:
format-lint:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
cache: true
cache-key: ":os:-modules-:hash:"
channel: "stable"
flutter-version: ${{ env.FLUTTER_VERSION }}

- name: Install dependencies
run: |
cd frontend/app_student
flutter pub get
- name: Formatting
run: dart --disable-analytics format --set-exit-if-changed frontend/app_student/lib

- name: Lint
run: flutter analyze frontend/app_student/lib
14 changes: 4 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@

###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/var/
/vendor/
###< symfony/framework-bundle ###
.idea/
.vscode/
backend/vendor/
backend/.php-cs-fixer.cache
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Projet 3iL Élève

Bienvenue dans le projet de l'application élève de l'école 3iL Ingénieurs et son groupe le groupe 3iL. Cette application est conçue pour faciliter la gestion de l'emploi du temps des élèves ainsi que leur suivi académique. Actuellement, elle permet de visualiser l'emploi du temps, tandis que la partie pour consulter les notes, les absences et d'autres informations est en cours de développement.

## Structure du projet

Le projet est organisé en deux parties principales :

- **frontend** : Contient l'application Flutter.
- **backend** : Contient l'API en PHP (Symfony) qui fournit les données nécessaires à l'application.

## Installation

Pour installer le projet, veuillez suivre les instructions fournies dans les README des dossiers correspondants :

- Pour le frontend, consultez le README dans le dossier `frontend`.
- Pour le backend, consultez le README dans le dossier `backend`.

## Contributeurs

Ce projet a été réalisé par Lukas, Jules et Yan dans le cadre de leurs études.

---
15 changes: 13 additions & 2 deletions .env → backend/.env
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=1493bafee09d036a0900844998c5ad7f
APP_ENV=
APP_SECRET=
###< symfony/framework-bundle ###

APP_3IL_SCHEDULE_URL=
###> doctrine/doctrine-bundle ###
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
#
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
# DATABASE_URL="mysql://app:[email protected]:3306/app?serverVersion=8.0.32&charset=utf8mb4"
# DATABASE_URL="mysql://app:[email protected]:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4"
DATABASE_URL="postgresql://app:[email protected]:5432/app?serverVersion=16&charset=utf8"
###< doctrine/doctrine-bundle ###
15 changes: 15 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/var/
/vendor/
###< symfony/framework-bundle ###

###> friendsofphp/php-cs-fixer ###
.php-cs-fixer.php
.php-cs-fixer.cache
###< friendsofphp/php-cs-fixer ###
1 change: 1 addition & 0 deletions backend/.php-cs-fixer.cache

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions backend/.php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

$finder = (new PhpCsFixer\Finder())
->in(__DIR__)
->exclude('var')
;

return (new PhpCsFixer\Config())
->setRules([
'@Symfony' => true,
])
->setFinder($finder)
;
33 changes: 33 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# API Symfony pour Gestion de l'Emploi du Temps

Bienvenue dans l'API Symfony pour la gestion de l'emploi du temps. Cette API est développée en Symfony 6.4 et offre deux endpoints principaux pour récupérer des données sur les emplois du temps des classes.

## Configuration requise

Avant de pouvoir utiliser cette API, assurez-vous que votre environnement répond aux exigences suivantes :

- **PHP 8.1 ou version ultérieure** : Cette API nécessite au minimum PHP 8.1 pour fonctionner correctement.
- **Composer** : Vous aurez besoin de Composer pour installer les dépendances nécessaires au fonctionnement de l'API.

## Installation

Pour installer l'API et ses dépendances, suivez les étapes ci-dessous :

1. Clonez ce dépôt sur votre machine locale.
2. Naviguez vers le répertoire `/backend` dans votre terminal.
3. Exécutez la commande `composer install` pour installer toutes les dépendances nécessaires.


## Endpoints

L'API offre les endpoints suivants :

- `/api/timetable?class_param=XX` : Permet de récupérer l'emploi du temps d'une classe spécifique.
- `/api/classes` : Permet de récupérer la liste des classes disponibles.

Vous pouvez retrouver la spécification OpenApi à la racine du projet Symfony

## Utilisation

Une fois l'API installée et configurée, vous pouvez commencer à l'utiliser en effectuant des requêtes HTTP vers les endpoints mentionnés ci-dessus. Assurez-vous de respecter les méthodes HTTP appropriées (GET, POST, etc.) pour interagir avec les données de l'API.

File renamed without changes.
8 changes: 8 additions & 0 deletions backend/compose.override.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '3'

services:
###> doctrine/doctrine-bundle ###
database:
ports:
- "5432"
###< doctrine/doctrine-bundle ###
21 changes: 21 additions & 0 deletions backend/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '3'

services:
###> doctrine/doctrine-bundle ###
database:
image: postgres:${POSTGRES_VERSION:-16}-alpine
environment:
POSTGRES_DB: ${POSTGRES_DB:-app}
# You should definitely change the password in production
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!}
POSTGRES_USER: ${POSTGRES_USER:-app}
volumes:
- database_data:/var/lib/postgresql/data:rw
# You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./docker/db/data:/var/lib/postgresql/data:rw
###< doctrine/doctrine-bundle ###

volumes:
###> doctrine/doctrine-bundle ###
database_data:
###< doctrine/doctrine-bundle ###
83 changes: 83 additions & 0 deletions backend/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"type": "project",
"license": "proprietary",
"minimum-stability": "stable",
"prefer-stable": true,
"require": {
"php": ">=8.1",
"ext-ctype": "*",
"ext-iconv": "*",
"ext-simplexml": "*",
"doctrine/dbal": "^3",
"doctrine/doctrine-bundle": "^2.11",
"doctrine/doctrine-migrations-bundle": "^3.3",
"doctrine/orm": "^3.1",
"symfony/apache-pack": "^1.0",
"symfony/console": "6.4.*",
"symfony/css-selector": "6.4.*",
"symfony/dom-crawler": "6.4.*",
"symfony/dotenv": "6.4.*",
"symfony/flex": "^2.4",
"symfony/framework-bundle": "6.4.*",
"symfony/http-client": "6.4.*",
"symfony/property-access": "6.4.*",
"symfony/requirements-checker": "^2.0",
"symfony/runtime": "6.4.*",
"symfony/serializer": "6.4.*",
"symfony/yaml": "6.4.*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.51",
"symfony/debug-bundle": "6.4.*",
"symfony/maker-bundle": "^1.56"
},
"config": {
"allow-plugins": {
"php-http/discovery": true,
"symfony/flex": true,
"symfony/runtime": true
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php72": "*",
"symfony/polyfill-php73": "*",
"symfony/polyfill-php74": "*",
"symfony/polyfill-php80": "*",
"symfony/polyfill-php81": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd",
"requirements-checker": "script"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "6.4.*"
}
}
}
Loading

0 comments on commit 36ef422

Please sign in to comment.