10 Commits

12 changed files with 112 additions and 115 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
.env
node_modules/
hardcoded-strings-report.md
backend.env

View File

@ -1 +1 @@
node scripts/prepare-commit-msg.js "$1" "$2"
#node scripts/prepare-commit-msg.js "$1" "$2"

View File

@ -37,7 +37,7 @@
<body>
<div class="container">
<div class="header">
<img src="{{URL_DJANGO}}static/img/logo_min.svg" alt="Logo N3wt School" class="logo" />
<img src="{{URL_DJANGO}}/static/img/logo_min.svg" alt="Logo N3wt School" class="logo" />
<h1>Confirmation de souscription</h1>
</div>
<div class="content">

View File

@ -1 +1 @@
__version__ = "0.0.2"
__version__ = "0.0.3"

View File

@ -66,6 +66,7 @@ urllib3==2.2.3
vine==5.1.0
wcwidth==0.2.13
webencodings==0.5.1
watchfiles
xhtml2pdf==0.2.16
channels==4.0.0
channels-redis==4.1.0

View File

@ -1,5 +1,6 @@
import subprocess
import os
from watchfiles import run_process
def run_command(command):
process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@ -11,6 +12,7 @@ def run_command(command):
return process.returncode
test_mode = os.getenv('test_mode', 'false').lower() == 'true'
watch_mode = os.getenv('DJANGO_WATCH', 'false').lower() == 'true'
commands = [
["python", "manage.py", "collectstatic", "--noinput"],
@ -32,6 +34,17 @@ test_commands = [
["python", "manage.py", "init_mock_datas"]
]
def run_daphne():
try:
result = subprocess.run([
"daphne", "-b", "0.0.0.0", "-p", "8080", "N3wtSchool.asgi:application"
])
return result.returncode
except KeyboardInterrupt:
print("Arrêt de Daphne (KeyboardInterrupt)")
return 0
if __name__ == "__main__":
for command in commands:
if run_command(command) != 0:
exit(1)
@ -41,14 +54,35 @@ for command in commands:
# if run_command(test_command) != 0:
# exit(1)
# Lancer les processus en parallèle
if watch_mode:
celery_worker = subprocess.Popen(["celery", "-A", "N3wtSchool", "worker", "--loglevel=info"])
celery_beat = subprocess.Popen(["celery", "-A", "N3wtSchool", "beat", "--loglevel=info", "--scheduler", "django_celery_beat.schedulers:DatabaseScheduler"])
try:
run_process(
'.',
target=run_daphne
)
except KeyboardInterrupt:
print("Arrêt demandé (KeyboardInterrupt)")
finally:
celery_worker.terminate()
celery_beat.terminate()
celery_worker.wait()
celery_beat.wait()
else:
processes = [
subprocess.Popen(["daphne", "-b", "0.0.0.0", "-p", "8080", "N3wtSchool.asgi:application"]),
subprocess.Popen([
"daphne", "-b", "0.0.0.0", "-p", "8080", "N3wtSchool.asgi:application"
]),
subprocess.Popen(["celery", "-A", "N3wtSchool", "worker", "--loglevel=info"]),
subprocess.Popen(["celery", "-A", "N3wtSchool", "beat", "--loglevel=info", "--scheduler", "django_celery_beat.schedulers:DatabaseScheduler"])
]
# Attendre la fin des processus
try:
for process in processes:
process.wait()
except KeyboardInterrupt:
print("Arrêt demandé (KeyboardInterrupt)")
for process in processes:
process.terminate()
for process in processes:
process.wait()

View File

@ -2,6 +2,13 @@
Toutes les modifications notables apportées à ce projet seront documentées dans ce fichier.
### [0.0.3](https://git.v0id.ovh:5022/n3wt-innov/n3wt-school/compare/0.0.2...0.0.3) (2025-06-01)
### Corrections de bugs
* Ajout d'un '/' en fin d'URL ([67cea2f](https://git.v0id.ovh:5022/n3wt-innov/n3wt-school/commit/67cea2f1c6edae8eed5e024c79b1e19d08788d4c))
### 0.0.2 (2025-06-01)
@ -161,7 +168,7 @@ Toutes les modifications notables apportées à ce projet seront documentées da
* ajout de credential include dans get CSRF ([c161fa7](https://git.v0id.ovh:5022/n3wt-innov/n3wt-school/commit/c161fa7e7568437ba501a565ad53192b9cb3b6f3))
* Ajout de l'établissement dans la requête KPI récupérant les ([ada2a44](https://git.v0id.ovh:5022/n3wt-innov/n3wt-school/commit/ada2a44c3ec9ba45462bd7e78984dfa38008e231))
* Ajout des niveaux scolaires dans le back [[#27](https://git.v0id.ovh:5022/n3wt-innov/n3wt-school/issues/27)] ([05542df](https://git.v0id.ovh:5022/n3wt-innov/n3wt-school/commit/05542dfc40649fd194ee551f0298f1535753f219))
* ajout des urls prod et demo ([b780e8b](https://git.v0id.ovh:5022/n3wt-innov/n3wt-school/commit/b780e8b4ff4b5e6bbbccf1c77a56136c0c4affcb)), closes [#1](https://git.v0id.ovh:5022/n3wt-innov/n3wt-school/issues/1) [#123](https://git.v0id.ovh:5022/n3wt-innov/n3wt-school/issues/123)
* ajout des urls prod et demo ([043d93d](https://git.v0id.ovh:5022/n3wt-innov/n3wt-school/commit/043d93dcc476e5eb3962fdbe0f6a81b937122647))
* Ajout du % ou € en mode édition de réduction ([f2628bb](https://git.v0id.ovh:5022/n3wt-innov/n3wt-school/commit/f2628bb45a14da42d014e42b1521820ffeedfb33))
* Ajout du controle sur le format des dates ([e538ac3](https://git.v0id.ovh:5022/n3wt-innov/n3wt-school/commit/e538ac3d56294d4e647a38d730168ea567c76f04))
* Ajout du mode Visu ([e1c6073](https://git.v0id.ovh:5022/n3wt-innov/n3wt-school/commit/e1c607308c12cf75695e9d4593dc27ebe74e6a4f))

View File

@ -1,6 +1,6 @@
{
"name": "n3wt-school-front-end",
"version": "0.0.2",
"version": "0.0.3",
"private": true,
"scripts": {
"dev": "next dev",

22
conf/backend.env.default Normal file
View File

@ -0,0 +1,22 @@
TZ="Europe/Paris"
TEST_MODE=true
CSRF_COOKIE_SECURE=true
CSRF_COOKIE_DOMAIN=".localhost"
CORS_ALLOWED_ORIGINS=http://localhost:3000,http://127.0.0.1:3000,http://localhost:8080,http://127.0.0.1:8080
CSRF_TRUSTED_ORIGINS=http://localhost:3000,http://127.0.0.1:3000,http://localhost:8080,http://127.0.0.1:8080
BASE_URL=http://localhost:3000
DEBUG=false
EMAIL_HOST="smtp.hostinger.com"
EMAIL_PORT="587"
EMAIL_HOST_USER=""
EMAIL_HOST_PASSWORD=''
EMAIL_USE_TLS=true
EMAIL_USE_SSL=false
DB_NAME="school"
DB_USER="postgres"
DB_PASSWORD="postgres"
DB_HOST="database"
DB_PORT="5432"
URL_DJANGO="http://localhost:8080"
SECRET_KEY="<SIGNINGKEY>"

View File

@ -1,15 +1,19 @@
services:
redis:
image: 'redis:latest'
image: "redis:latest"
volumes:
- redis-data:/data
expose:
- 6379
environment:
- TZ=Europe/Paris
database:
image: 'postgres:latest'
image: "postgres:latest"
expose:
- 5432
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
@ -20,17 +24,13 @@ services:
image: git.v0id.ovh/n3wt-innov/n3wt-school/backend:latest
ports:
- 8080:8080
environment:
- TZ=Europe/Paris
- TEST_MODE=True
env_file: "./conf/backend.env"
links:
- "database:database"
- "redis:redis"
depends_on:
- redis
- database
volumes:
- ./conf/application.json:/Back-End/Subscriptions/Configuration/application.json
command: python start.py
frontend:
@ -40,6 +40,8 @@ services:
environment:
- TZ=Europe/Paris
- NODE_ENV=production
- NEXT_PUBLIC_API_URL=http://toto:8080
depends_on:
- backend
volumes:
- ./conf/env:/app/.env
volumes:
postgres-data:
redis-data:

View File

@ -1,55 +1,24 @@
services:
redis:
image: "redis:latest"
ports:
- 6379:6379
volumes:
- redis-data:/data
expose:
- 6379
environment:
- TZ=Europe/Paris
database:
image: "postgres:latest"
ports:
- 5432:5432
expose:
- 5432
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: school
TZ: Europe/Paris
# docuseal_db:
# image: postgres:latest
# environment:
# POSTGRES_USER: postgres
# POSTGRES_PASSWORD: postgres
# DOCUSEAL_DB_HOST: docuseal_db
# POSTGRES_DB: docuseal
# ports:
# - 5433:5432 # port différent si besoin d'accès direct depuis l'hôte
# docuseal:
# image: docuseal/docuseal:latest
# container_name: docuseal_app
# depends_on:
# - docuseal_db
# ports:
# - "3001:3000"
# environment:
# DATABASE_URL: postgresql://postgres:postgres@docuseal_db:5432/docuseal
# volumes:
# - ./docuseal:/data/docuseal
# caddy:
# image: caddy:2
# container_name: caddy
# restart: unless-stopped
# ports:
# - "4000:4443"
# volumes:
# - ./Caddyfile:/etc/caddy/Caddyfile
# - caddy_data:/data
# - caddy_config:/config
# depends_on:
# - docuseal
backend:
build:
@ -58,54 +27,15 @@ services:
- 8080:8080
volumes:
- ./Back-End:/Back-End
environment:
- TZ=Europe/Paris
- TEST_MODE=True
- CORS_ALLOWED_ORIGINS=http://localhost:3000,http://127.0.0.1:3000,http://localhost:8080,http://127.0.0.1:8080
- CSRF_TRUSTED_ORIGINS=http://localhost:3000,http://127.0.0.1:3000,http://localhost:8080,http://127.0.0.1:8080
- BASE_URL=http://localhost:3000
env_file: "./conf/backend.env"
links:
- "database:database"
- "redis:redis"
depends_on:
- redis
- database
#- docuseal
command: python start.py
# init_docuseal_users:
# build:
# context: .
# dockerfile: Dockerfile
# depends_on:
# - docuseal
# environment:
# DOCUSEAL_DB_HOST: docuseal_db
# POSTGRES_USER: postgres
# POSTGRES_PASSWORD: postgres
# USER_FIRST_NAME: n3wt
# USER_LAST_NAME: school
# USER_COMPANY: n3wt.innov
# USER_EMAIL: n3wt.school@gmail.com
# USER_PASSWORD: n3wt1234
# volumes:
# - ./initDocusealUsers.sh:/docker-entrypoint-initdb.d/initDocusealUsers.sh
# frontend:
# build:
# context: ./Front-End
# args:
# - BUILD_MODE=development
# ports:
# - 3000:3000
# volumes:
# - ./Front-End:/app
# env_file:
# - .env
# environment:
# - TZ=Europe/Paris
# depends_on:
# - backend
volumes:
caddy_data:
caddy_config:
postgres-data:
redis-data:

View File

@ -1,6 +1,6 @@
{
"name": "n3wt-school",
"version": "0.0.2",
"version": "0.0.3",
"scripts": {
"prepare": "husky",
"release": "standard-version",