seo-dev-env 0.1.2__py3-none-any.whl → 0.1.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- seo/cli.py +1 -1
- seo/generators.py +4 -4
- seo/templates/debutant/README.md +44 -0
- seo/templates/debutant/requirements.txt +2 -0
- seo/templates/debutant/{style.css → static/style.css} +12 -3
- seo/templates/debutant/templates/a_propos.html +49 -0
- seo/templates/debutant/{index.html → templates/index.html} +7 -6
- seo/templates/intermediaire/README.md +107 -0
- seo/templates/intermediaire/app/static/css/style.css +170 -0
- seo/templates/intermediaire/app/templates/base.html +32 -0
- seo/templates/intermediaire/app/templates/index.html +53 -0
- seo/templates/pro/README.md +206 -0
- {seo_dev_env-0.1.2.dist-info → seo_dev_env-0.1.3.dist-info}/METADATA +1 -1
- {seo_dev_env-0.1.2.dist-info → seo_dev_env-0.1.3.dist-info}/RECORD +18 -10
- {seo_dev_env-0.1.2.dist-info → seo_dev_env-0.1.3.dist-info}/WHEEL +0 -0
- {seo_dev_env-0.1.2.dist-info → seo_dev_env-0.1.3.dist-info}/entry_points.txt +0 -0
- {seo_dev_env-0.1.2.dist-info → seo_dev_env-0.1.3.dist-info}/licenses/LICENSE.ls +0 -0
- {seo_dev_env-0.1.2.dist-info → seo_dev_env-0.1.3.dist-info}/top_level.txt +0 -0
seo/cli.py
CHANGED
|
@@ -147,7 +147,7 @@ def afficher_prochaines_etapes(nom_projet: str, type_projet: str, docker: bool =
|
|
|
147
147
|
print(f"\n Prochaines étapes:\n")
|
|
148
148
|
print(f" 1. cd {nom_projet}")
|
|
149
149
|
if docker:
|
|
150
|
-
print(" 2. docker
|
|
150
|
+
print(" 2. docker compose up --build")
|
|
151
151
|
else:
|
|
152
152
|
if type_projet == "apprentissage":
|
|
153
153
|
print(" 2. python app.py")
|
seo/generators.py
CHANGED
|
@@ -161,10 +161,10 @@ def creer_environnement(niveau, type_app='web', chemin='.'):
|
|
|
161
161
|
print("flask db migrate")
|
|
162
162
|
print("flask db upgrade")
|
|
163
163
|
print("flask run")
|
|
164
|
-
else:
|
|
165
|
-
print("\n🚀 Pour démarrer avec Docker:")
|
|
166
|
-
print(f"cd {chemin}")
|
|
167
|
-
print("docker
|
|
164
|
+
else:
|
|
165
|
+
print("\n🚀 Pour démarrer avec Docker:")
|
|
166
|
+
print(f"cd {chemin}")
|
|
167
|
+
print("docker compose up --build")
|
|
168
168
|
|
|
169
169
|
# Alias pour une utilisation plus simple
|
|
170
170
|
creer_projet = creer_environnement
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Mon Projet Flask
|
|
2
|
+
|
|
3
|
+
Projet généré avec **SEO Dev Env** - Niveau Apprentissage
|
|
4
|
+
|
|
5
|
+
## 🚀 Démarrage
|
|
6
|
+
|
|
7
|
+
1. Installer les dépendances :
|
|
8
|
+
```bash
|
|
9
|
+
pip install -r requirements.txt
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
2. Lancer l'application :
|
|
13
|
+
```bash
|
|
14
|
+
python app.py
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
3. Ouvrir votre navigateur à : http://localhost:5000
|
|
18
|
+
|
|
19
|
+
## 📁 Structure du projet
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
mon_projet/
|
|
23
|
+
├── app.py # Application Flask principale
|
|
24
|
+
├── templates/ # Fichiers HTML (Jinja2)
|
|
25
|
+
│ ├── index.html
|
|
26
|
+
│ └── a_propos.html
|
|
27
|
+
├── static/ # Fichiers CSS, JS, Images
|
|
28
|
+
│ └── style.css
|
|
29
|
+
├── requirements.txt # Dépendances Python
|
|
30
|
+
└── README.md # Ce fichier
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## 📚 Prochaines étapes
|
|
34
|
+
|
|
35
|
+
- [ ] Personnaliser les templates HTML
|
|
36
|
+
- [ ] Modifier les styles CSS
|
|
37
|
+
- [ ] Ajouter de nouvelles routes dans app.py
|
|
38
|
+
- [ ] Apprendre Flask avec la [documentation officielle](https://flask.palletsprojects.com/)
|
|
39
|
+
|
|
40
|
+
## 💡 Conseils
|
|
41
|
+
|
|
42
|
+
- Utilisez `debug=True` uniquement en développement
|
|
43
|
+
- Changez la SECRET_KEY dans app.py
|
|
44
|
+
- Consultez la documentation Flask pour aller plus loin
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
* {
|
|
2
2
|
margin: 0;
|
|
3
3
|
padding: 0;
|
|
4
4
|
box-sizing: border-box;
|
|
@@ -32,6 +32,7 @@ nav .container {
|
|
|
32
32
|
|
|
33
33
|
nav h1 {
|
|
34
34
|
color: #667eea;
|
|
35
|
+
font-size: 1.5rem;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
nav ul {
|
|
@@ -53,6 +54,7 @@ nav a:hover {
|
|
|
53
54
|
|
|
54
55
|
main {
|
|
55
56
|
margin-top: 3rem;
|
|
57
|
+
margin-bottom: 3rem;
|
|
56
58
|
padding: 2rem;
|
|
57
59
|
background: white;
|
|
58
60
|
border-radius: 10px;
|
|
@@ -85,26 +87,33 @@ h2 {
|
|
|
85
87
|
margin: 0.5rem 0;
|
|
86
88
|
}
|
|
87
89
|
|
|
90
|
+
.card p {
|
|
91
|
+
margin-bottom: 0.5rem;
|
|
92
|
+
}
|
|
93
|
+
|
|
88
94
|
code {
|
|
89
95
|
background: #e7eaf6;
|
|
90
96
|
padding: 2px 6px;
|
|
91
97
|
border-radius: 3px;
|
|
92
98
|
font-family: "Courier New", monospace;
|
|
93
99
|
color: #667eea;
|
|
100
|
+
font-size: 0.9em;
|
|
94
101
|
}
|
|
95
102
|
|
|
96
103
|
footer {
|
|
97
104
|
text-align: center;
|
|
98
105
|
padding: 2rem;
|
|
99
106
|
color: white;
|
|
100
|
-
margin-top:
|
|
107
|
+
margin-top: auto;
|
|
101
108
|
}
|
|
102
109
|
|
|
103
110
|
a {
|
|
104
111
|
color: #667eea;
|
|
105
112
|
text-decoration: none;
|
|
113
|
+
transition: all 0.3s;
|
|
106
114
|
}
|
|
107
115
|
|
|
108
116
|
a:hover {
|
|
109
117
|
text-decoration: underline;
|
|
110
|
-
|
|
118
|
+
color: #764ba2;
|
|
119
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="fr">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>{{ titre }} - Mon Projet Flask</title>
|
|
7
|
+
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<nav>
|
|
11
|
+
<div class="container">
|
|
12
|
+
<h1>🚀 Mon Projet Flask</h1>
|
|
13
|
+
<ul>
|
|
14
|
+
<li><a href="/">Accueil</a></li>
|
|
15
|
+
<li><a href="/a-propos">À propos</a></li>
|
|
16
|
+
</ul>
|
|
17
|
+
</div>
|
|
18
|
+
</nav>
|
|
19
|
+
|
|
20
|
+
<main class="container">
|
|
21
|
+
<h2>À propos de ce projet</h2>
|
|
22
|
+
<p>Cette application Flask a été créée avec <strong>SEO Dev Env</strong>, un générateur de projets Flask pour développeurs francophones.</p>
|
|
23
|
+
|
|
24
|
+
<div class="card">
|
|
25
|
+
<h3>🎯 Objectif</h3>
|
|
26
|
+
<p>SEO Dev Env vous permet de démarrer rapidement avec Flask en générant une structure de projet adaptée à votre niveau :</p>
|
|
27
|
+
<ul>
|
|
28
|
+
<li><strong>Apprentissage</strong> : Structure simple pour débuter</li>
|
|
29
|
+
<li><strong>Application Web</strong> : Architecture MVC complète</li>
|
|
30
|
+
<li><strong>API Professionnelle</strong> : Production-ready avec Docker</li>
|
|
31
|
+
<li><strong>Startup SaaS</strong> : Scalable et modulaire</li>
|
|
32
|
+
</ul>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div class="card">
|
|
36
|
+
<h3>💻 Technologies utilisées</h3>
|
|
37
|
+
<ul>
|
|
38
|
+
<li>Flask - Framework web Python</li>
|
|
39
|
+
<li>Jinja2 - Moteur de templates</li>
|
|
40
|
+
<li>Python 3.13 - Langage de programmation</li>
|
|
41
|
+
</ul>
|
|
42
|
+
</div>
|
|
43
|
+
</main>
|
|
44
|
+
|
|
45
|
+
<footer>
|
|
46
|
+
<p>Créé avec ❤️ en utilisant Flask</p>
|
|
47
|
+
</footer>
|
|
48
|
+
</body>
|
|
49
|
+
</html>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
<!DOCTYPE html>
|
|
2
2
|
<html lang="fr">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8">
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<body>
|
|
10
10
|
<nav>
|
|
11
11
|
<div class="container">
|
|
12
|
-
<h1
|
|
12
|
+
<h1>🚀 Mon Projet Flask</h1>
|
|
13
13
|
<ul>
|
|
14
14
|
<li><a href="/">Accueil</a></li>
|
|
15
15
|
<li><a href="/a-propos">À propos</a></li>
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<p>Cette application a été générée avec <strong>SEO Dev Env</strong>.</p>
|
|
23
23
|
|
|
24
24
|
<div class="card">
|
|
25
|
-
<h3
|
|
25
|
+
<h3>📝 Prochaines étapes</h3>
|
|
26
26
|
<ul>
|
|
27
27
|
<li>Personnalisez ce template dans <code>templates/index.html</code></li>
|
|
28
28
|
<li>Modifiez le style dans <code>static/style.css</code></li>
|
|
@@ -31,16 +31,17 @@
|
|
|
31
31
|
</div>
|
|
32
32
|
|
|
33
33
|
<div class="card">
|
|
34
|
-
<h3
|
|
34
|
+
<h3>📚 Ressources utiles</h3>
|
|
35
35
|
<ul>
|
|
36
36
|
<li><a href="https://flask.palletsprojects.com/" target="_blank">Documentation Flask</a></li>
|
|
37
37
|
<li><a href="https://jinja.palletsprojects.com/" target="_blank">Documentation Jinja2</a></li>
|
|
38
|
+
<li><a href="https://www.python.org/dev/peps/pep-0008/" target="_blank">PEP 8 - Guide de style Python</a></li>
|
|
38
39
|
</ul>
|
|
39
40
|
</div>
|
|
40
41
|
</main>
|
|
41
42
|
|
|
42
43
|
<footer>
|
|
43
|
-
<p>Créé avec
|
|
44
|
+
<p>Créé avec ❤️ en utilisant Flask</p>
|
|
44
45
|
</footer>
|
|
45
46
|
</body>
|
|
46
|
-
</html>
|
|
47
|
+
</html>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Mon Application Web
|
|
2
|
+
|
|
3
|
+
Application web MVC générée avec **SEO Dev Env**
|
|
4
|
+
|
|
5
|
+
## 🏗️ Structure du Projet
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
mon_app/
|
|
9
|
+
├── run.py # Point d'entrée
|
|
10
|
+
├── config.py # Configuration
|
|
11
|
+
├── app/
|
|
12
|
+
│ ├── __init__.py # Factory pattern
|
|
13
|
+
│ ├── models.py # Modèles partagés
|
|
14
|
+
│ ├── routes.py # Routes principales
|
|
15
|
+
│ ├── static/ # CSS, JS, Images
|
|
16
|
+
│ │ └── css/
|
|
17
|
+
│ │ └── style.css
|
|
18
|
+
│ ├── templates/ # Templates Jinja2
|
|
19
|
+
│ │ ├── base.html
|
|
20
|
+
│ │ └── index.html
|
|
21
|
+
│ ├── utilisateurs/ # Module utilisateurs
|
|
22
|
+
│ │ ├── models.py
|
|
23
|
+
│ │ └── routes.py
|
|
24
|
+
│ └── taches/ # Module tâches
|
|
25
|
+
│ ├── models.py
|
|
26
|
+
│ └── routes.py
|
|
27
|
+
└── requirements.txt
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 🚀 Démarrage
|
|
31
|
+
|
|
32
|
+
### Sans Docker
|
|
33
|
+
|
|
34
|
+
1. **Créer un environnement virtuel** :
|
|
35
|
+
```bash
|
|
36
|
+
python -m venv venv
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
2. **Activer l'environnement** :
|
|
40
|
+
```bash
|
|
41
|
+
# Windows
|
|
42
|
+
venv\Scripts\activate
|
|
43
|
+
|
|
44
|
+
# Linux/Mac
|
|
45
|
+
source venv/bin/activate
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
3. **Installer les dépendances** :
|
|
49
|
+
```bash
|
|
50
|
+
pip install -r requirements.txt
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
4. **Initialiser la base de données** :
|
|
54
|
+
```bash
|
|
55
|
+
flask db init
|
|
56
|
+
flask db migrate -m "Initial migration"
|
|
57
|
+
flask db upgrade
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
5. **Lancer l'application** :
|
|
61
|
+
```bash
|
|
62
|
+
python run.py
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Avec Docker
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
docker compose up --build
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
> **Note** : Utilisez `docker compose` (sans tiret) avec Docker Desktop moderne
|
|
72
|
+
|
|
73
|
+
## 📚 Commandes Utiles
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Base de données
|
|
77
|
+
flask db init # Initialiser les migrations
|
|
78
|
+
flask db migrate -m "msg" # Créer une migration
|
|
79
|
+
flask db upgrade # Appliquer les migrations
|
|
80
|
+
flask db downgrade # Revenir en arrière
|
|
81
|
+
|
|
82
|
+
# Lancement
|
|
83
|
+
python run.py # Mode développement
|
|
84
|
+
gunicorn run:app # Mode production
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## 🔧 Configuration
|
|
88
|
+
|
|
89
|
+
Modifier `config.py` pour ajuster :
|
|
90
|
+
- DATABASE_URL
|
|
91
|
+
- SECRET_KEY
|
|
92
|
+
- DEBUG mode
|
|
93
|
+
- Autres paramètres
|
|
94
|
+
|
|
95
|
+
## 📖 Documentation
|
|
96
|
+
|
|
97
|
+
- [Flask Documentation](https://flask.palletsprojects.com/)
|
|
98
|
+
- [SQLAlchemy ORM](https://docs.sqlalchemy.org/)
|
|
99
|
+
- [Flask-Migrate](https://flask-migrate.readthedocs.io/)
|
|
100
|
+
|
|
101
|
+
## 💡 Bonnes Pratiques
|
|
102
|
+
|
|
103
|
+
- ✅ Utilisez des migrations pour la base de données
|
|
104
|
+
- ✅ Organisez le code par features (modules)
|
|
105
|
+
- ✅ Gardez les modèles, routes et services séparés
|
|
106
|
+
- ✅ Utilisez des variables d'environnement pour les secrets
|
|
107
|
+
- ✅ Testez votre code avant de déployer
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
* {
|
|
2
|
+
margin: 0;
|
|
3
|
+
padding: 0;
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:root {
|
|
8
|
+
--primary: #667eea;
|
|
9
|
+
--primary-dark: #764ba2;
|
|
10
|
+
--text: #333;
|
|
11
|
+
--bg-light: #f7f9fc;
|
|
12
|
+
--shadow: 0 10px 30px rgba(0,0,0,0.1);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
body {
|
|
16
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
17
|
+
line-height: 1.6;
|
|
18
|
+
color: var(--text);
|
|
19
|
+
background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
|
|
20
|
+
min-height: 100vh;
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.container {
|
|
26
|
+
max-width: 1200px;
|
|
27
|
+
margin: 0 auto;
|
|
28
|
+
padding: 0 20px;
|
|
29
|
+
width: 100%;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Navigation */
|
|
33
|
+
.navbar {
|
|
34
|
+
background: rgba(255, 255, 255, 0.95);
|
|
35
|
+
padding: 1rem 0;
|
|
36
|
+
box-shadow: var(--shadow);
|
|
37
|
+
position: sticky;
|
|
38
|
+
top: 0;
|
|
39
|
+
z-index: 100;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.navbar .container {
|
|
43
|
+
display: flex;
|
|
44
|
+
justify-content: space-between;
|
|
45
|
+
align-items: center;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.navbar h1 a {
|
|
49
|
+
color: var(--primary);
|
|
50
|
+
text-decoration: none;
|
|
51
|
+
font-size: 1.5rem;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.nav-menu {
|
|
55
|
+
display: flex;
|
|
56
|
+
list-style: none;
|
|
57
|
+
gap: 2rem;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.nav-menu a {
|
|
61
|
+
color: var(--text);
|
|
62
|
+
text-decoration: none;
|
|
63
|
+
font-weight: 500;
|
|
64
|
+
transition: color 0.3s;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.nav-menu a:hover {
|
|
68
|
+
color: var(--primary);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* Main Content */
|
|
72
|
+
main {
|
|
73
|
+
flex: 1;
|
|
74
|
+
margin: 3rem auto;
|
|
75
|
+
padding: 2rem;
|
|
76
|
+
background: white;
|
|
77
|
+
border-radius: 10px;
|
|
78
|
+
box-shadow: var(--shadow);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.hero {
|
|
82
|
+
text-align: center;
|
|
83
|
+
padding: 2rem 0;
|
|
84
|
+
margin-bottom: 3rem;
|
|
85
|
+
border-bottom: 2px solid var(--bg-light);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.hero h2 {
|
|
89
|
+
color: var(--primary);
|
|
90
|
+
font-size: 2.5rem;
|
|
91
|
+
margin-bottom: 0.5rem;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.hero p {
|
|
95
|
+
color: #666;
|
|
96
|
+
font-size: 1.2rem;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* Features Grid */
|
|
100
|
+
.features {
|
|
101
|
+
display: grid;
|
|
102
|
+
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
|
103
|
+
gap: 2rem;
|
|
104
|
+
margin: 2rem 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* Cards */
|
|
108
|
+
.card {
|
|
109
|
+
background: var(--bg-light);
|
|
110
|
+
padding: 1.5rem;
|
|
111
|
+
border-radius: 8px;
|
|
112
|
+
border-left: 4px solid var(--primary);
|
|
113
|
+
transition: transform 0.3s, box-shadow 0.3s;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.card:hover {
|
|
117
|
+
transform: translateY(-5px);
|
|
118
|
+
box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.card h3 {
|
|
122
|
+
margin-bottom: 1rem;
|
|
123
|
+
color: var(--text);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.card ul, .card ol {
|
|
127
|
+
margin-left: 1.5rem;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.card li {
|
|
131
|
+
margin: 0.5rem 0;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
code {
|
|
135
|
+
background: #e7eaf6;
|
|
136
|
+
padding: 2px 6px;
|
|
137
|
+
border-radius: 3px;
|
|
138
|
+
font-family: "Courier New", monospace;
|
|
139
|
+
color: var(--primary);
|
|
140
|
+
font-size: 0.9em;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* Footer */
|
|
144
|
+
footer {
|
|
145
|
+
text-align: center;
|
|
146
|
+
padding: 2rem;
|
|
147
|
+
color: white;
|
|
148
|
+
background: rgba(0,0,0,0.1);
|
|
149
|
+
margin-top: auto;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/* Responsive */
|
|
153
|
+
@media (max-width: 768px) {
|
|
154
|
+
.navbar .container {
|
|
155
|
+
flex-direction: column;
|
|
156
|
+
gap: 1rem;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.nav-menu {
|
|
160
|
+
gap: 1rem;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.hero h2 {
|
|
164
|
+
font-size: 2rem;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.features {
|
|
168
|
+
grid-template-columns: 1fr;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="fr">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>{% block title %}Mon Application{% endblock %}</title>
|
|
7
|
+
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
|
8
|
+
{% block extra_css %}{% endblock %}
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<nav class="navbar">
|
|
12
|
+
<div class="container">
|
|
13
|
+
<h1><a href="/">🚀 Mon Application</a></h1>
|
|
14
|
+
<ul class="nav-menu">
|
|
15
|
+
<li><a href="/">Accueil</a></li>
|
|
16
|
+
<li><a href="/utilisateurs">Utilisateurs</a></li>
|
|
17
|
+
<li><a href="/taches">Tâches</a></li>
|
|
18
|
+
</ul>
|
|
19
|
+
</div>
|
|
20
|
+
</nav>
|
|
21
|
+
|
|
22
|
+
<main class="container">
|
|
23
|
+
{% block content %}{% endblock %}
|
|
24
|
+
</main>
|
|
25
|
+
|
|
26
|
+
<footer>
|
|
27
|
+
<p>© 2026 Mon Application - Propulsé par Flask</p>
|
|
28
|
+
</footer>
|
|
29
|
+
|
|
30
|
+
{% block extra_js %}{% endblock %}
|
|
31
|
+
</body>
|
|
32
|
+
</html>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{% extends "base.html" %}
|
|
2
|
+
|
|
3
|
+
{% block title %}Accueil - Mon Application{% endblock %}
|
|
4
|
+
|
|
5
|
+
{% block content %}
|
|
6
|
+
<div class="hero">
|
|
7
|
+
<h2>Bienvenue dans votre Application Web</h2>
|
|
8
|
+
<p>Structure MVC complète générée avec SEO Dev Env</p>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div class="features">
|
|
12
|
+
<div class="card">
|
|
13
|
+
<h3>📦 Architecture Modulaire</h3>
|
|
14
|
+
<p>Organisation par features (utilisateurs, tâches, etc.)</p>
|
|
15
|
+
<ul>
|
|
16
|
+
<li>Modèles séparés</li>
|
|
17
|
+
<li>Routes organisées</li>
|
|
18
|
+
<li>Services métier</li>
|
|
19
|
+
</ul>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<div class="card">
|
|
23
|
+
<h3>🗄️ Base de Données</h3>
|
|
24
|
+
<p>SQLAlchemy intégré avec migrations</p>
|
|
25
|
+
<ul>
|
|
26
|
+
<li>PostgreSQL / MySQL / SQLite</li>
|
|
27
|
+
<li>Flask-Migrate pour les migrations</li>
|
|
28
|
+
<li>ORM puissant</li>
|
|
29
|
+
</ul>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div class="card">
|
|
33
|
+
<h3>🔐 Authentification</h3>
|
|
34
|
+
<p>Gestion des utilisateurs intégrée</p>
|
|
35
|
+
<ul>
|
|
36
|
+
<li>Flask-Login</li>
|
|
37
|
+
<li>Hashage sécurisé</li>
|
|
38
|
+
<li>Sessions</li>
|
|
39
|
+
</ul>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div class="card">
|
|
44
|
+
<h3>📝 Prochaines étapes</h3>
|
|
45
|
+
<ol>
|
|
46
|
+
<li>Initialiser la base de données : <code>flask db init</code></li>
|
|
47
|
+
<li>Créer les migrations : <code>flask db migrate</code></li>
|
|
48
|
+
<li>Appliquer les migrations : <code>flask db upgrade</code></li>
|
|
49
|
+
<li>Personnaliser les modèles dans <code>app/*/models.py</code></li>
|
|
50
|
+
<li>Ajouter des routes dans <code>app/*/routes.py</code></li>
|
|
51
|
+
</ol>
|
|
52
|
+
</div>
|
|
53
|
+
{% endblock %}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# API Professionnelle
|
|
2
|
+
|
|
3
|
+
API REST production-ready générée avec **SEO Dev Env**
|
|
4
|
+
|
|
5
|
+
## 🏗️ Architecture
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
mon_api/
|
|
9
|
+
├── app/
|
|
10
|
+
│ ├── __init__.py
|
|
11
|
+
│ ├── api/
|
|
12
|
+
│ │ ├── __init__.py
|
|
13
|
+
│ │ └── v1/
|
|
14
|
+
│ │ ├── __init__.py
|
|
15
|
+
│ │ └── endpoints.py
|
|
16
|
+
│ ├── core/
|
|
17
|
+
│ │ ├── config.py
|
|
18
|
+
│ │ └── security.py
|
|
19
|
+
│ └── db/
|
|
20
|
+
│ ├── base.py
|
|
21
|
+
│ └── models.py
|
|
22
|
+
├── Dockerfile
|
|
23
|
+
├── docker-compose.yml
|
|
24
|
+
└── requirements.txt
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 🚀 Démarrage Rapide
|
|
28
|
+
|
|
29
|
+
### Avec Docker (Recommandé)
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# Démarrer tous les services
|
|
33
|
+
docker compose up --build
|
|
34
|
+
|
|
35
|
+
# En arrière-plan
|
|
36
|
+
docker compose up -d
|
|
37
|
+
|
|
38
|
+
# Voir les logs
|
|
39
|
+
docker compose logs -f
|
|
40
|
+
|
|
41
|
+
# Arrêter
|
|
42
|
+
docker compose down
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
> **Note** : Utilisez `docker compose` (sans tiret) avec Docker Desktop moderne
|
|
46
|
+
|
|
47
|
+
### Sans Docker
|
|
48
|
+
|
|
49
|
+
1. **Créer un environnement virtuel** :
|
|
50
|
+
```bash
|
|
51
|
+
python -m venv venv
|
|
52
|
+
source venv/bin/activate # Linux/Mac
|
|
53
|
+
venv\Scripts\activate # Windows
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
2. **Installer les dépendances** :
|
|
57
|
+
```bash
|
|
58
|
+
pip install -r requirements.txt
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
3. **Configurer les variables d'environnement** :
|
|
62
|
+
```bash
|
|
63
|
+
cp .env.example .env
|
|
64
|
+
# Éditer .env avec vos paramètres
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
4. **Lancer l'application** :
|
|
68
|
+
```bash
|
|
69
|
+
# Développement
|
|
70
|
+
python run.py
|
|
71
|
+
|
|
72
|
+
# Production
|
|
73
|
+
gunicorn --bind 0.0.0.0:5000 --workers 4 run:app
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## 📡 Endpoints API
|
|
77
|
+
|
|
78
|
+
### Documentation Interactive
|
|
79
|
+
|
|
80
|
+
- **Swagger UI** : http://localhost:5000/api/docs
|
|
81
|
+
- **ReDoc** : http://localhost:5000/api/redoc
|
|
82
|
+
|
|
83
|
+
### Endpoints Principaux
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
GET /api/v1/health # Health check
|
|
87
|
+
GET /api/v1/items # Liste des items
|
|
88
|
+
POST /api/v1/items # Créer un item
|
|
89
|
+
GET /api/v1/items/{id} # Détails d'un item
|
|
90
|
+
PUT /api/v1/items/{id} # Mettre à jour un item
|
|
91
|
+
DELETE /api/v1/items/{id} # Supprimer un item
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## 🔐 Authentification
|
|
95
|
+
|
|
96
|
+
L'API utilise JWT (JSON Web Tokens) pour l'authentification.
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# Obtenir un token
|
|
100
|
+
POST /api/v1/auth/login
|
|
101
|
+
{
|
|
102
|
+
"username": "user",
|
|
103
|
+
"password": "password"
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
# Utiliser le token
|
|
107
|
+
Authorization: Bearer <votre-token>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## 🗄️ Base de Données
|
|
111
|
+
|
|
112
|
+
### Migrations
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# Initialiser
|
|
116
|
+
flask db init
|
|
117
|
+
|
|
118
|
+
# Créer une migration
|
|
119
|
+
flask db migrate -m "Description"
|
|
120
|
+
|
|
121
|
+
# Appliquer
|
|
122
|
+
flask db upgrade
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Connexions Supportées
|
|
126
|
+
|
|
127
|
+
- PostgreSQL (Recommandé pour production)
|
|
128
|
+
- MySQL
|
|
129
|
+
- SQLite (Développement uniquement)
|
|
130
|
+
|
|
131
|
+
## 🧪 Tests
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Lancer tous les tests
|
|
135
|
+
pytest
|
|
136
|
+
|
|
137
|
+
# Avec couverture
|
|
138
|
+
pytest --cov=app tests/
|
|
139
|
+
|
|
140
|
+
# Tests spécifiques
|
|
141
|
+
pytest tests/test_api.py
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## 📊 Monitoring
|
|
145
|
+
|
|
146
|
+
### Logs
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
# Voir les logs Docker
|
|
150
|
+
docker compose logs -f web
|
|
151
|
+
|
|
152
|
+
# Logs de l'application
|
|
153
|
+
tail -f logs/app.log
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Métriques
|
|
157
|
+
|
|
158
|
+
- Health check : `/api/v1/health`
|
|
159
|
+
- Prometheus : `/metrics` (si configuré)
|
|
160
|
+
|
|
161
|
+
## 🚢 Déploiement
|
|
162
|
+
|
|
163
|
+
### Variables d'Environnement
|
|
164
|
+
|
|
165
|
+
```env
|
|
166
|
+
FLASK_ENV=production
|
|
167
|
+
SECRET_KEY=votre-cle-secrete-tres-longue
|
|
168
|
+
DATABASE_URL=postgresql://user:pass@host:5432/db
|
|
169
|
+
JWT_SECRET_KEY=votre-cle-jwt
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Production Checklist
|
|
173
|
+
|
|
174
|
+
- [ ] Changer toutes les clés secrètes
|
|
175
|
+
- [ ] Configurer une vraie base de données
|
|
176
|
+
- [ ] Activer HTTPS
|
|
177
|
+
- [ ] Configurer les CORS correctement
|
|
178
|
+
- [ ] Mettre en place le monitoring
|
|
179
|
+
- [ ] Configurer les backups de BDD
|
|
180
|
+
- [ ] Tester la charge
|
|
181
|
+
|
|
182
|
+
## 🛡️ Sécurité
|
|
183
|
+
|
|
184
|
+
- ✅ CORS configuré
|
|
185
|
+
- ✅ JWT pour l'authentification
|
|
186
|
+
- ✅ Validation des données (Marshmallow/Pydantic)
|
|
187
|
+
- ✅ Protection CSRF
|
|
188
|
+
- ✅ Rate limiting (à configurer)
|
|
189
|
+
- ✅ HTTPS recommandé en production
|
|
190
|
+
|
|
191
|
+
## 📚 Documentation
|
|
192
|
+
|
|
193
|
+
- [Flask-RESTX](https://flask-restx.readthedocs.io/)
|
|
194
|
+
- [Flask-JWT-Extended](https://flask-jwt-extended.readthedocs.io/)
|
|
195
|
+
- [SQLAlchemy](https://docs.sqlalchemy.org/)
|
|
196
|
+
- [Docker Compose](https://docs.docker.com/compose/)
|
|
197
|
+
|
|
198
|
+
## 🤝 Contribution
|
|
199
|
+
|
|
200
|
+
1. Créer une branche feature
|
|
201
|
+
2. Ajouter des tests
|
|
202
|
+
3. Créer une Pull Request
|
|
203
|
+
|
|
204
|
+
## 📄 Licence
|
|
205
|
+
|
|
206
|
+
MIT
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
seo/__init__.py,sha256=5_-smvpT5QbwLmxKXc4X-JfmzFuyueswNbCKCQIGftA,174
|
|
2
|
-
seo/cli.py,sha256=
|
|
2
|
+
seo/cli.py,sha256=lQ4Q0-rOyPpdv8iiuMpVPp9uIOJHVfYzG2Vk3YZQJEo,6224
|
|
3
3
|
seo/commandes.py,sha256=IV2adIYBdP8PjZoE6MK9D0ZXrow1M7B6CX2TYQD99Io,3150
|
|
4
|
-
seo/generators.py,sha256=
|
|
4
|
+
seo/generators.py,sha256=G3hT5LKVAzDmi64pm0Eb5DdJdgQ1r_3kLAzLtd5pmnQ,12264
|
|
5
5
|
seo/utils.py,sha256=ssHO8tNVJPKSTcfxRlFfijtNzZ2i1USOzMogQK9OviA,1067
|
|
6
|
+
seo/templates/debutant/README.md,sha256=BTZLHISquCTX1owtiakrXaJEes2Vd_Oxf-gdlETRmlw,1084
|
|
6
7
|
seo/templates/debutant/app.py,sha256=NqLiFgvPttDi_Ce5O-oT0yiPtViTfbkWSuLpN1QRNDU,444
|
|
7
|
-
seo/templates/debutant/
|
|
8
|
-
seo/templates/debutant/style.css,sha256=
|
|
8
|
+
seo/templates/debutant/requirements.txt,sha256=AaOL_yizCwqq1JTbRUPpnMObVpvKsdob0lNBrV_Aem4,34
|
|
9
|
+
seo/templates/debutant/static/style.css,sha256=oQOkRjux1jgliN8gGFkkpv5o-JD0rDr-vTBS5NwqyqQ,1813
|
|
10
|
+
seo/templates/debutant/templates/a_propos.html,sha256=zNlG36_qf6ATPr-L9F9LCJQguxyjN9Zhj5iR8fvXqME,1805
|
|
11
|
+
seo/templates/debutant/templates/index.html,sha256=b5Db1WAAJuAGMbEUV4ATvqFTzP7H5AihJq9Z4DvuNfo,1698
|
|
12
|
+
seo/templates/intermediaire/README.md,sha256=fAUT2_Ekxfpu_wMF_xpYbKLieUljzzp_AZ3BSrULK2k,2496
|
|
9
13
|
seo/templates/intermediaire/config.py,sha256=mKWh1yCEsYS5PG_PBfXO9XQqlXNyC0Jf7X-xZhRvous,326
|
|
10
14
|
seo/templates/intermediaire/docker-compose.yml,sha256=hjtekZDcaxglQ4wNjE_3Yvlvb2YqAXX4KQCUGBiqrHs,805
|
|
11
15
|
seo/templates/intermediaire/run.py,sha256=2l746zNzGoSlxcr1Hk_1ydc3kQ9VS7yvRC0MWJJsu38,487
|
|
@@ -14,13 +18,17 @@ seo/templates/intermediaire/app/models.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
|
|
|
14
18
|
seo/templates/intermediaire/app/routes.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
19
|
seo/templates/intermediaire/app/core/__init__.py,sha256=LgjR9gAK71QXl9AIwFrDb02-v7NsusVhV4jm_MWzAKc,6
|
|
16
20
|
seo/templates/intermediaire/app/core/config.py,sha256=7M0zTUu1uwbbT8mCG5QcELVcmad8m6pHCb2BdL7qEd0,626
|
|
21
|
+
seo/templates/intermediaire/app/static/css/style.css,sha256=Bo5LP4r-pHlrpAXc-ZDgzerpxpanI01U42fgScT2Emk,2872
|
|
17
22
|
seo/templates/intermediaire/app/taches/__init__.py,sha256=LgjR9gAK71QXl9AIwFrDb02-v7NsusVhV4jm_MWzAKc,6
|
|
18
23
|
seo/templates/intermediaire/app/taches/models.py,sha256=0ieYf4AUqFvGb1DIYID5nyRIirQ304jenzVfMB8uECU,582
|
|
19
24
|
seo/templates/intermediaire/app/taches/routes.py,sha256=hnpX9_Ql1amxI8uopWlnF8A6WpGrGKlCSRwd1n888-s,1406
|
|
25
|
+
seo/templates/intermediaire/app/templates/base.html,sha256=9PSdI48AYLub9RQQOERowFdlve9_k1fmcqLjN0LKt7k,944
|
|
26
|
+
seo/templates/intermediaire/app/templates/index.html,sha256=o40wGa_9zYfZMPkDAuo8YNMJI7fTG_LMAQXAef39YH4,1588
|
|
20
27
|
seo/templates/intermediaire/app/utilisateurs/__init__.py,sha256=LgjR9gAK71QXl9AIwFrDb02-v7NsusVhV4jm_MWzAKc,6
|
|
21
28
|
seo/templates/intermediaire/app/utilisateurs/models.py,sha256=-rWh2w4LvwlRLSmwhmEqgxSFrSj2OsfIcmB233y1Yo4,1086
|
|
22
29
|
seo/templates/intermediaire/app/utilisateurs/routes.py,sha256=uUE82cBWLL-PiFFlJd2w5AsbNbh31oOjD2o8GAyXgEg,1246
|
|
23
30
|
seo/templates/pro/Dockerfile,sha256=VlrKrPXWBj8Ohj6BENbgVTvyHGZeDHDB1Ybe8OHqSTI,526
|
|
31
|
+
seo/templates/pro/README.md,sha256=M8g0_UEA0_8m34gWVUqlgws7CuCOBzwi0qj-u4Ed658,3857
|
|
24
32
|
seo/templates/pro/docker-compose.yml,sha256=hjtekZDcaxglQ4wNjE_3Yvlvb2YqAXX4KQCUGBiqrHs,805
|
|
25
33
|
seo/templates/pro/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
34
|
seo/templates/pro/app/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -30,9 +38,9 @@ seo/templates/pro/app/core/config.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
|
30
38
|
seo/templates/pro/app/core/security.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
39
|
seo/templates/pro/app/db/base.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
32
40
|
seo/templates/pro/app/db/models.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
|
-
seo_dev_env-0.1.
|
|
34
|
-
seo_dev_env-0.1.
|
|
35
|
-
seo_dev_env-0.1.
|
|
36
|
-
seo_dev_env-0.1.
|
|
37
|
-
seo_dev_env-0.1.
|
|
38
|
-
seo_dev_env-0.1.
|
|
41
|
+
seo_dev_env-0.1.3.dist-info/licenses/LICENSE.ls,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
42
|
+
seo_dev_env-0.1.3.dist-info/METADATA,sha256=ezHzAIG0ciH9NZ3m9pe6q5YrBGfAxBAIgPHAfdQk2Hk,13942
|
|
43
|
+
seo_dev_env-0.1.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
44
|
+
seo_dev_env-0.1.3.dist-info/entry_points.txt,sha256=tAn_vOcrXDG6ilFg7Zvacd4bf9fQXAhsmimMr9lEU84,96
|
|
45
|
+
seo_dev_env-0.1.3.dist-info/top_level.txt,sha256=5WsA3DhwhBGXTOKiKgDtiTUjXlpLk4oeUvrSKrtRFoQ,4
|
|
46
|
+
seo_dev_env-0.1.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|