Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 20 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,51 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v5

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 11

- name: Set up Node.js
uses: actions/setup-node@v5
with:
node-version: '24'
node-version: '23'
cache: 'pnpm'
cache-dependency-path: ./backend/pnpm-lock.yaml

- name: Install dependencies
working-directory: ./backend
run: npm ci
run: pnpm install --frozen-lockfile

- name: Lint
working-directory: ./backend
run: npm run lint
run: pnpm run lint

lint-front:
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 11

- name: Set up Node.js
uses: actions/setup-node@v5
with:
node-version: '24'
node-version: '23'
cache: 'pnpm'
cache-dependency-path: ./frontend/pnpm-lock.yaml

- name: Install dependencies
working-directory: ./frontend
run: npm ci
run: pnpm install --frozen-lockfile

- name: Lint
working-directory: ./frontend
run: npm run lint
run: pnpm run lint

build-api:
runs-on: self-hosted
Expand Down
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pnpm -C frontend lint
pnpm -C backend lint
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 120,
"tabWidth": 4,
"arrowParens": "always",
"endOfLine": "lf",
"bracketSameLine": true
}
161 changes: 112 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ Ce projet est une plateforme pour le site d'intégration de l'Université de Tec
- **Frontend** :
- Vite.js
- React
- Serve (pour servir le build statique)
- Nginx (pour servir le build statique)
- Docker

- **Backend** :
- Node.js
- Express.js
- Drizzle ORM
- Prisma
- PostgreSQL client
- Docker

Expand All @@ -26,58 +26,140 @@ Ce projet est une plateforme pour le site d'intégration de l'Université de Tec

---

## 🚀 Lancer le projet en local
## Prérequis

### Cloner le projet

### 1. Prérequis
```bash
git clone https://github.com/ungdev/Integration.git
cd Integration
```

### Docker & Docker-Compose

Assurez-vous d'avoir installé :

- [Docker](https://www.docker.com/)
- [Docker Compose](https://docs.docker.com/compose/)

Vérifiez avec :

```bash
docker --version
docker-compose --version
```

### 2. Cloner le projet
### ESLint & Prettier

```bash
git clone https://github.com/ungdev/Integration.git
cd Integration
ESLint & Prettier sont utilisés pour maintenanir une cohérence et propreté de syntaxe dans le code de ce projet ainsi que la lisibilité.

Il convient donc d'installation les deux extensions sur votre éditeur de code.

Vérification de syntaxe via la commande

```
pnpm lint
```

### 3. Démarrer les conteneurs
La syntaxe doit être controllée avant chaque commit.

Exécutez la commande suivante à la racine du projet :
### Variables d'environnement

```bash
docker-compose up --build
#### Frontend

Dans [le dossier frontend](/frontend)

```
cp .env.example .env
```

Cette commande :
- Lance PostgreSQL
- Démarre le backend avec migration automatique via Drizzle ORM
- Compile et sert le frontend
Renseigner les différents champs utiles.

#### API

Dans [le dossier backend](/backend)

```
cp .env.example .env
```

Renseigner les différents champs utiles.

## 🚀 Lancer le projet en local

### 4. Accéder aux services
### Database

#### Via Docker-Compose

A la racine du projet

```
docker compose up db
```

#### Database externe

Passage par exemple par `systemctl`

```
sudo systemctl start postgresql
```

### Frontend

Dans [le dossier frontend](/frontend)

Installation des dépendances

```
pnpm i
```

Pour lancer le serveur

```
pnpm run dev
```

### API

Dans [le dossier backend](/backend/)

Installation des dépendances & Migration DB

```
pnpm i
pnpm migrate
```

Pour lancer le serveur

```
pnpm run dev
```

### Accéder aux services

- Frontend : [http://localhost:4000](http://localhost:4000)
- Backend : [http://localhost:4001](http://localhost:4001)
- Base de données PostgreSQL : `localhost:5432` (user: `admin`, password: `password`)

---

## 🧪 Gestion des migrations
## Test de build

Le backend utilise **Drizzle ORM** pour la gestion des migrations.
### Via Docker

La commande suivante est exécutée automatiquement au démarrage :
Exécutez la commande suivante à la racine du projet :

```bash
npm run migrate
docker-compose up --build
```

Cette commande :

- Lance PostgreSQL
- Démarre le backend avec migration automatique via Prisma
- Compile et sert le frontend

---

## 📁 Structure du projet
Expand All @@ -97,8 +179,7 @@ npm run migrate

---


# 🔧 Installation du site de l'Intégration en local
# 🔧 Routage `/api` sur integration.utt.fr en local

Ce guide permet de configurer le site `integration.utt.fr` en local avec Nginx, en HTTPS, pour simuler l'environnement de production.

Expand Down Expand Up @@ -138,6 +219,7 @@ mkcert integration.utt.fr
```

Cela crée deux fichiers :

- `integration.utt.fr.pem`
- `integration.utt.fr-key.pem`

Expand Down Expand Up @@ -177,30 +259,13 @@ sudo systemctl reload nginx

### 4. Lancer les services

Dans deux terminaux différents :
[Lancer l'API](#api) puis [lancer le Frontend](#frontend)

```bash
cd frontend
npm install
npm run dev
```

```bash
cd backend
npm install
npm run dev
```
Le projet de dev est maintenant accessible sur https://integration.utt.fr, en local.

---

### ✅ Accès

Ouvrir :
👉 https://integration.utt.fr

---

## 🔚 Nettoyage quand le dev est terminé
## Nettoyage

### 1. Supprimer l'entrée dans `/etc/hosts`

Expand All @@ -226,10 +291,8 @@ sudo systemctl reload nginx

---

Tu peux maintenant accéder à la version en ligne de :
👉 https://integration.utt.fr

La site de production est maintenant accessible sur https://integration.utt.fr, en ligne.

## 📜 Licence

Projet destiné à des fins d'utilisation pour l'intégration des étudiants à l'UTT.
Projet destiné à des fins d'utilisation pour l'intégration des nouveaux étudiants à l'Université de Technologie de Troyes.
1 change: 1 addition & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ EMAIL_HOST=
EMAIL_USER=
EMAIL_PASSWORD=
EMAIL_FROM=
EMAIL_CONCURRENCY=20

CAS_VALIDATE_URL=
CAS_LOGIN_URL=
Expand Down
1 change: 1 addition & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"jsonwebtoken": "^9.0.2",
"multer": "^2.1.1",
"nodemailer": "^9.0.1",
"p-limit": "^7.3.0",
"papaparse": "^5.5.2",
"pg": "^8.14.1",
"pg-promise": "^12.6.2",
Expand Down
17 changes: 17 additions & 0 deletions backend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading