├── .firebaserc
├── .idea
├── .gitignore
├── aws.xml
├── ecf-2022-GOODµ.iml
├── modules.xml
└── vcs.xml
├── Documents ECF
├── Charte Graphique ECF.pdf
├── Documentation Technique.pdf
├── ECF_DEVFULLSTACK_déc2022_copiearendre_MAKHLOUF_CHARLY.docx
├── Manuel d’utilisation.pdf
├── Résumé Du Projet.docx
└── script.sql
├── README.md
├── Wireframes
├── WIREFRAME WEB ECF 2022 - Activer ou désactiver un Utilisateur@2x.png
├── WIREFRAME WEB ECF 2022 - Création Utilisateur@2x (1).png
├── WIREFRAME WEB ECF 2022 - Création Utilisateur@2x.png
├── WIREFRAME WEB ECF 2022 - Desactiver Activer un Compte@2x.png
├── WIREFRAME WEB ECF 2022 - LOGIN@2x.png
├── WIREFRAME WEB ECF 2022 - Modifier Utilisateur & Add Permissions@2x.png
├── WIREFRAME WEB ECF 2022 - Modifier Utilisateur & Ajouter Permissions@2x.png
├── WIREFRAME WEB ECF 2022 - Panel Admin@2x (1).png
├── WIREFRAME WEB ECF 2022 - Panel Admin@2x.png
├── WIREFRAME WEB ECF 2022 - Panel Login@2x.png
├── WIREFRAME WEB ECF 2022 - Panel Partenaires@2x.png
├── WIREFRAME WEB ECF 2022 - Panel Structure via Partenaire@2x.png
├── WIREFRAME WEB ECF 2022 - Panel Structure@2x.png
├── WIREFRAME WEB ECF 2022 - Panel Structures@2x.png
├── WIREFRAME WEB ECF 2022 - Panel Vue Partenaires@2x.png
├── WIREFRAME WEB ECF 2022 - Panel Vue Structure via Partenaires@2x.png
├── WIREFRAME WEB ECF 2022 - Premiere Connexion@2x.png
├── WIREFRAME WEB ECF 2022 - Supprimer un Compte@2x.png
├── WIREFRAME WEB ECF 2022 - Supprimer un Utilisateur@2x.png
└── WIREFRAME WEB ECF 2022 - WIREFRAME DESKTOP@2x.png
├── clients
├── .firebase
│ └── hosting.YnVpbGQ.cache
├── .firebaserc
├── .gitignore
├── firebase.js
├── firebase.json
├── package-lock.json
├── package.json
├── postcss.config.js
├── public
│ ├── 404.html
│ ├── favicon.ico
│ └── index.html
├── src
│ ├── App.css
│ ├── App.js
│ ├── api
│ │ └── auth.js
│ ├── components
│ │ ├── Calendar
│ │ │ └── Calendar.js
│ │ ├── Modals
│ │ │ ├── Delete.js
│ │ │ ├── Desactiver.js
│ │ │ ├── ModalAddUser
│ │ │ │ └── AddUser.js
│ │ │ ├── Update.js
│ │ │ ├── ViewInfos.js
│ │ │ └── mailer.js
│ │ ├── Search
│ │ │ └── SearchFilter.js
│ │ ├── SideBarPartner
│ │ │ └── SideBarPartner.js
│ │ ├── Sidebar
│ │ │ └── SideBar.js
│ │ ├── SidebarStructure
│ │ │ └── SideBarStructure.js
│ │ └── TableList
│ │ │ ├── TableList.js
│ │ │ └── TableListStructure.js
│ ├── context
│ │ └── user.context.jsx
│ ├── core
│ │ └── routes
│ │ │ ├── protected.route.js
│ │ │ ├── route-renderer.js
│ │ │ ├── routes-config.js
│ │ │ └── routes.js
│ ├── index.js
│ ├── lib
│ │ └── lib.js
│ └── pages
│ │ ├── AccesDenied
│ │ └── AccessDenied.js
│ │ ├── Admin
│ │ ├── Contact
│ │ │ └── Contact.js
│ │ ├── Home
│ │ │ └── dashboard.js
│ │ ├── Planning
│ │ │ └── Planning.js
│ │ └── Settings
│ │ │ └── Settings.js
│ │ ├── Login
│ │ └── login.js
│ │ ├── NotFound
│ │ └── NotFound.js
│ │ ├── Partner
│ │ ├── Contact
│ │ │ └── ContactPartner.js
│ │ ├── PlanningPartner
│ │ │ └── PlanningPartner.js
│ │ ├── Settings
│ │ │ └── SettingsPartner.js
│ │ └── dashboardPartner.js
│ │ ├── Password
│ │ └── PasswordChange.js
│ │ └── Structure
│ │ ├── Contact
│ │ └── ContactStructure.js
│ │ ├── Planning
│ │ └── PlanningStructure.js
│ │ ├── Settings
│ │ └── SettingsStructure.js
│ │ └── dashboardStrucure.js
└── tailwind.config.js
├── firebase.json
├── functions
├── .firebaserc
├── .gitignore
├── JwtTokenVerify
│ └── verifyToken.js
├── controllers
│ ├── admin.js
│ ├── auth.js
│ ├── partners.js
│ └── structures.js
├── db
│ └── db.cjs
├── error
│ └── error.js
├── index.js
├── package-lock.json
├── package.json
├── routes
│ ├── admin.js
│ ├── auth.js
│ ├── partners.js
│ └── structures.js
└── ui-debug.log
└── package-lock.json
/.firebaserc:
--------------------------------------------------------------------------------
1 | {
2 | "projects": {
3 | "evf": "ecf-2022-21611"
4 | },
5 | "targets": {},
6 | "etags": {}
7 | }
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Editor-based HTTP Client requests
5 | /httpRequests/
6 |
--------------------------------------------------------------------------------
/.idea/aws.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/ecf-2022-GOODµ.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Documents ECF/Charte Graphique ECF.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Documents ECF/Charte Graphique ECF.pdf
--------------------------------------------------------------------------------
/Documents ECF/Documentation Technique.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Documents ECF/Documentation Technique.pdf
--------------------------------------------------------------------------------
/Documents ECF/ECF_DEVFULLSTACK_déc2022_copiearendre_MAKHLOUF_CHARLY.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Documents ECF/ECF_DEVFULLSTACK_déc2022_copiearendre_MAKHLOUF_CHARLY.docx
--------------------------------------------------------------------------------
/Documents ECF/Manuel d’utilisation.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Documents ECF/Manuel d’utilisation.pdf
--------------------------------------------------------------------------------
/Documents ECF/Résumé Du Projet.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Documents ECF/Résumé Du Projet.docx
--------------------------------------------------------------------------------
/Documents ECF/script.sql:
--------------------------------------------------------------------------------
1 | create table clients
2 | (
3 | client_id serial
4 | primary key,
5 | client_name varchar(50) not null,
6 | email varchar(100) not null,
7 | password varchar(100) not null,
8 | active varchar(35) not null,
9 | short_desc varchar(50),
10 | created_at timestamp default now(),
11 | update_at timestamp default CURRENT_TIMESTAMP,
12 | role_as varchar(20) not null
13 | );
14 |
15 | alter table clients
16 | owner to dffwgrxd;
17 |
18 | create table structures
19 | (
20 | structure_id serial
21 | primary key,
22 | structure_name varchar(50) not null,
23 | structure_email varchar(100) not null,
24 | password varchar(100) not null,
25 | structure_active varchar(35) not null,
26 | structure_short_desc varchar(50),
27 | structure_full_desc varchar(255),
28 | structure_logo_url varchar(125),
29 | structure_created_at timestamp default now(),
30 | structure_update_at timestamp default CURRENT_TIMESTAMP,
31 | structure_role varchar(20) not null,
32 | structures_id integer default 0,
33 | adresse_structure varchar(150),
34 | codepostal_structure integer default 0,
35 | ville varchar(20),
36 | sell_newsletter boolean default false,
37 | sell_boissons boolean default false,
38 | sell_vêtements boolean default false,
39 | sell_équipements boolean default false
40 | );
41 |
42 | alter table structures
43 | owner to dffwgrxd;
44 |
45 | create table partenaires
46 | (
47 | client_id serial
48 | primary key,
49 | partner_name varchar(50) not null,
50 | partner_email varchar(100) not null,
51 | password varchar(100) not null,
52 | active varchar(35) not null,
53 | short_desc varchar(50),
54 | full_desc varchar(255),
55 | logo_url varchar(125),
56 | created_at timestamp default now(),
57 | update_at timestamp default CURRENT_TIMESTAMP,
58 | role_as varchar(20) not null,
59 | partner_id integer default 0,
60 | Adresse varchar(150),
61 | code_postal integer default 0,
62 | ville_partner varchar(20),
63 | sell_newsletter_partner boolean default false,
64 | sell_boissons_partner boolean default false,
65 | sell_vêtements_partner boolean default false,
66 | sell_équipements_partner boolean default false
67 | );
68 |
69 | alter table partenaires
70 | owner to dffwgrxd;
71 |
72 |
73 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ECF-API-SPORT
2 | # Bienvenue sur l'application d'administration de FitPark Fitness de Paris.
3 |
4 | Dans le cadre de ma Formation de développeur Web Fullstack avec **Studi**, j'ai eu pour tâche finale le développement d'une application incorporant un système d'administration des partenaires et structures de la marque FITPARK FITNESS
5 |
6 | ## Spécification Techniques
7 |
8 | ### Technologie
9 |
10 | - Express => 5.0
11 | - NodeJs V16.717.0
12 | - Framework : React => 18.2.0
13 | - Base de donnée : PostGreSql (PostGreSql 15.0)
14 |
15 | ### Front
16 |
17 | - TAILWINDCSS (V3.1.8)
18 | - React-Icons (4.4.0)
19 |
20 | ### Back
21 |
22 | - Express 5.0
23 | - NodeJs V16.717.0
24 | - PostGreSql (PostGreSql 15.0)
25 | - Bcrypt
26 | - Jwt Token
27 |
28 | # Installation Locale
29 |
30 | ```
31 | git clone https://github.com/PaleGreenFILE/ECF-API-SPORT
32 | ```
33 | Pour installer les dépendances du front:
34 | ```
35 | cd clients
36 | npm i --save
37 | ```
38 | Pour installer les dépendances du Back:
39 | ```
40 | cd funcitons
41 | npm i --save
42 | ```
43 |
44 | Une fois le projet installé il faut créer un fichier .env avec vos propres informations.
45 |
46 | **Création de la base de donnée :**
47 |
48 | Utiliser le fichier sql présent ou créer la vôtre.
49 |
50 | ```
51 | CREATE DATABASE nom_base_de_données ; Créer une base de données
52 | USE nom_base_de_données ; Indique la BDD à utiliser et dans laquelle on exécute les requêtes.
53 | CREATE TABLE nom_table ; Créer une table dans la BDD utilisée
54 | ```
55 |
56 | **Lancer le serveur Back-back end**
57 |
58 | ```
59 | cd functions
60 | npm run dev
61 | ```
62 |
63 | **Lancer le Front-End :**
64 |
65 | ```
66 | cd clients
67 | npm run start
68 | ```
69 |
70 | Pour la gestion des mails j'ai utilisé personnellement EmailJs principalement pour sa rapidité à mettre en place, sinon vous pouvez utiliser votre mailler habituel,
71 |
72 | ## [Se connecter à l'application](https://ecf-2022.web.app/)
73 |
74 |
75 | Trois Cas de connexion sont possible dans cette application :
76 | - Un administrateur (admin)
77 | - Des Partenaires (partenaires)
78 | - Des Structures (structures)
79 |
80 | |email |mot de passe |
81 | |---|---|
82 | | Administrateur : admin_fitpark@gmail.com | gExoNlS1$iNc |
83 | | Partenraire : crossfit_ninja@gmail.com | gExoNlS1$iNc |
84 | | Structure: body_fit@gmail.com | gExoNlS1$iNc |
85 |
86 | # Les choix Techniques
87 |
88 | ## Connexion sécurisé mise en place
89 | Pour cette application j'ai fais le choix de faire une connexion sécurisée en utilisant Bcrypt pour Hash le mot de passe.
90 | Que vous pouvez retrouver ici ([BcrypJs](https://www.npmjs.com/package/bcryptjs)).
91 | ou installer le directement en tapant:
92 |
93 | ```
94 | npm i bcryptjs
95 | ```
96 | #Dploiement de l'application
97 |
98 | Pour cette application j'ai fais le choix d'utiliser Firebase pour héberger le back-end et le front aussi pour sa rapidité de mise en place.
99 | vous pourrez retrouver la documentation ici
100 |
101 | - [Firebase](https://firebase.google.com/docs).
102 |
103 | ```
104 | Créér un compte sur Firebase.com
105 |
106 | Créér une nouvelle application
107 |
108 | Installer la CLI de Firebase:
109 |
110 | Initialiser votre projet
111 | ```
112 |
113 | retrouvez la procédure de déploiement complète sur [Firebase](https://firebase.google.com/).
114 |
115 | ## Ou trouver les documents
116 |
117 | Dans cette application vous trouverai un dossier **Documentation** vous pouvez y trouver plusieurs documents utiles ( schéma de la base de donnée, charte graphique, manuel d'utilisation etc...) en format .pdf ou via les liens ci-desous.
118 |
119 | ## Lien utiles
120 |
121 | Dans cette section je met à disposition tous ce dont je me suis appuyé pour réaliser cette application :
122 |
123 | - [Trello](https://whimsical.com/ecf-decembre-2022-trello-NfUp8nvFJNPCBk4jGxLFJi)
124 | - [Wireframe Desktop](https://whimsical.com/wireframe-web-ecf-2022-WampAVigaVCERKX5Qy4xQ2)
125 | - [Wireframe Mobile](https://whimsical.com/wireframe-web-ecf-2022-WampAVigaVCERKX5Qy4xQ2)
126 | - [Charte Graphique](https://whimsical.com/charte-graphique-3XQTm5QPZWo2JMStX7xyvv)
127 | - [Cas D'utilisation](https://whimsical.com/uml-cas-d-utilisation-2qQkj9G9NxcAWDjvmBbyNT)
128 | - [Diagramme de séquence](https://whimsical.com/uml-diagramme-de-sequence-ACUzgb77qAp8NvBkWxoq2G)
129 | - [MCD](https://whimsical.com/mcd-ecf-2022-HTz2Z4W4TLfep7VCcbpWDR)
130 | - [Projet Github](https://github.com/PaleGreenFILE/ECF-API-SPORT)
131 |
132 |
133 |
134 |
135 |

136 |

137 |

138 |

139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 | # ECF Studi 2022 - Charly Makhlouf
147 |
--------------------------------------------------------------------------------
/Wireframes/WIREFRAME WEB ECF 2022 - Activer ou désactiver un Utilisateur@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Wireframes/WIREFRAME WEB ECF 2022 - Activer ou désactiver un Utilisateur@2x.png
--------------------------------------------------------------------------------
/Wireframes/WIREFRAME WEB ECF 2022 - Création Utilisateur@2x (1).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Wireframes/WIREFRAME WEB ECF 2022 - Création Utilisateur@2x (1).png
--------------------------------------------------------------------------------
/Wireframes/WIREFRAME WEB ECF 2022 - Création Utilisateur@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Wireframes/WIREFRAME WEB ECF 2022 - Création Utilisateur@2x.png
--------------------------------------------------------------------------------
/Wireframes/WIREFRAME WEB ECF 2022 - Desactiver Activer un Compte@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Wireframes/WIREFRAME WEB ECF 2022 - Desactiver Activer un Compte@2x.png
--------------------------------------------------------------------------------
/Wireframes/WIREFRAME WEB ECF 2022 - LOGIN@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Wireframes/WIREFRAME WEB ECF 2022 - LOGIN@2x.png
--------------------------------------------------------------------------------
/Wireframes/WIREFRAME WEB ECF 2022 - Modifier Utilisateur & Add Permissions@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Wireframes/WIREFRAME WEB ECF 2022 - Modifier Utilisateur & Add Permissions@2x.png
--------------------------------------------------------------------------------
/Wireframes/WIREFRAME WEB ECF 2022 - Modifier Utilisateur & Ajouter Permissions@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Wireframes/WIREFRAME WEB ECF 2022 - Modifier Utilisateur & Ajouter Permissions@2x.png
--------------------------------------------------------------------------------
/Wireframes/WIREFRAME WEB ECF 2022 - Panel Admin@2x (1).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Wireframes/WIREFRAME WEB ECF 2022 - Panel Admin@2x (1).png
--------------------------------------------------------------------------------
/Wireframes/WIREFRAME WEB ECF 2022 - Panel Admin@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Wireframes/WIREFRAME WEB ECF 2022 - Panel Admin@2x.png
--------------------------------------------------------------------------------
/Wireframes/WIREFRAME WEB ECF 2022 - Panel Login@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Wireframes/WIREFRAME WEB ECF 2022 - Panel Login@2x.png
--------------------------------------------------------------------------------
/Wireframes/WIREFRAME WEB ECF 2022 - Panel Partenaires@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Wireframes/WIREFRAME WEB ECF 2022 - Panel Partenaires@2x.png
--------------------------------------------------------------------------------
/Wireframes/WIREFRAME WEB ECF 2022 - Panel Structure via Partenaire@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Wireframes/WIREFRAME WEB ECF 2022 - Panel Structure via Partenaire@2x.png
--------------------------------------------------------------------------------
/Wireframes/WIREFRAME WEB ECF 2022 - Panel Structure@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Wireframes/WIREFRAME WEB ECF 2022 - Panel Structure@2x.png
--------------------------------------------------------------------------------
/Wireframes/WIREFRAME WEB ECF 2022 - Panel Structures@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Wireframes/WIREFRAME WEB ECF 2022 - Panel Structures@2x.png
--------------------------------------------------------------------------------
/Wireframes/WIREFRAME WEB ECF 2022 - Panel Vue Partenaires@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Wireframes/WIREFRAME WEB ECF 2022 - Panel Vue Partenaires@2x.png
--------------------------------------------------------------------------------
/Wireframes/WIREFRAME WEB ECF 2022 - Panel Vue Structure via Partenaires@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Wireframes/WIREFRAME WEB ECF 2022 - Panel Vue Structure via Partenaires@2x.png
--------------------------------------------------------------------------------
/Wireframes/WIREFRAME WEB ECF 2022 - Premiere Connexion@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Wireframes/WIREFRAME WEB ECF 2022 - Premiere Connexion@2x.png
--------------------------------------------------------------------------------
/Wireframes/WIREFRAME WEB ECF 2022 - Supprimer un Compte@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Wireframes/WIREFRAME WEB ECF 2022 - Supprimer un Compte@2x.png
--------------------------------------------------------------------------------
/Wireframes/WIREFRAME WEB ECF 2022 - Supprimer un Utilisateur@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Wireframes/WIREFRAME WEB ECF 2022 - Supprimer un Utilisateur@2x.png
--------------------------------------------------------------------------------
/Wireframes/WIREFRAME WEB ECF 2022 - WIREFRAME DESKTOP@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/Wireframes/WIREFRAME WEB ECF 2022 - WIREFRAME DESKTOP@2x.png
--------------------------------------------------------------------------------
/clients/.firebase/hosting.YnVpbGQ.cache:
--------------------------------------------------------------------------------
1 | 404.html,1657661005000,daa499dd96d8229e73235345702ba32f0793f0c8e5c0d30e40e37a5872be57aa
2 | favicon.ico,1657647659000,527f066d79f0b82d85c8cbc8de452a69d6525fca46e631d4f7680898d0589c1d
3 | asset-manifest.json,1677955130704,8a455d50853e91a5a88c3d367de98806e80041de8d5f6b1c538f9962ba097cf7
4 | index.html,1677955130704,d56dfe43f36a5f75d6a937945e9a109087bdde31bcebf6232f635af5562fb844
5 | static/js/main.3b708d0b.js.LICENSE.txt,1677955130720,80e3561f4bcbd6616fa3114b4730e87536ea03ad5515123456b6916f20e8c63d
6 | static/css/main.40cefb51.css,1677955130720,cd740c6f99dcffad8295d3b8cfb42817f2116fba5032d4967ad2a355aa98f614
7 | static/css/main.40cefb51.css.map,1677955130707,6a248e8ef631ad675a98b8d4ec1f4f4caab6ece75b81a0634495f5db7bead908
8 | static/js/main.3b708d0b.js,1677955130718,d10bd51948623e8b57d230392f660d6b3d5146c08134a94ffa07bd2f8d6bdce2
9 | static/js/main.3b708d0b.js.map,1677955130815,95cc56fa059efea5751e966924e07fbc086697b77aad50cb47dbbdeaca27b035
10 |
--------------------------------------------------------------------------------
/clients/.firebaserc:
--------------------------------------------------------------------------------
1 | {
2 | "projects": {
3 | "default": "ecf-2022-21611"
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/clients/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env
17 | .env.local
18 | .env.development.local
19 | .env.test.local
20 | .env.production.local
21 |
22 | npm-debug.log*
23 | yarn-debug.log*
24 | yarn-error.log*
25 |
--------------------------------------------------------------------------------
/clients/firebase.js:
--------------------------------------------------------------------------------
1 | import { initializeApp } from 'firebase/app';
2 | const firebaseConfig = {
3 | apiKey: process.env.REACT_APP_API_KEY,
4 | authDomain: process.env.REACT_APP_AUTH_DOMAIN,
5 | projectId: process.env.REACT_APP_PROJECT_ID,
6 | storageBucket: process.env.REACT_APP_STORAGE_BUCKET,
7 | messagingSenderId: process.env.REACT_APP_MESSAGING_ID,
8 | appId: process.env.REACT_APP_APP_ID,
9 | };
10 |
11 | // Initialize Firebase
12 | const app = initializeApp(firebaseConfig);
13 |
--------------------------------------------------------------------------------
/clients/firebase.json:
--------------------------------------------------------------------------------
1 | {
2 | "hosting": {
3 | "public": "build",
4 | "ignore": [
5 | "firebase.json",
6 | "**/.*",
7 | "**/node_modules/**"
8 | ],
9 | "rewrites": [
10 | {
11 | "source": "**",
12 | "destination": "/index.html"
13 | }
14 | ]
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/clients/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "clients",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@emailjs/browser": "^3.7.0",
7 | "@emotion/react": "^11.10.4",
8 | "@emotion/styled": "^11.10.4",
9 | "@mui/material": "^5.10.6",
10 | "@mui/x-data-grid": "^5.17.4",
11 | "@reduxjs/toolkit": "^1.9.1",
12 | "@testing-library/jest-dom": "^5.16.5",
13 | "@testing-library/react": "^13.4.0",
14 | "@testing-library/user-event": "^14.4.3",
15 | "antd": "^5.1.2",
16 | "axios": "^1.2.2",
17 | "cors": "^2.8.5",
18 | "date-fns": "^2.29.3",
19 | "eslint-config-next": "^13.1.1",
20 | "firebase": "^9.12.1",
21 | "jwt-decode": "^3.1.2",
22 | "nodemon": "^2.0.20",
23 | "react": "^18.2.0",
24 | "react-dom": "^18.2.0",
25 | "react-helmet": "^6.1.0",
26 | "react-hook-form": "^7.36.1",
27 | "react-icons": "^4.4.0",
28 | "react-router": "^6.4.1",
29 | "react-router-dom": "^6.4.1",
30 | "react-scripts": "^5.0.1",
31 | "react-super-responsive-table": "^5.2.1",
32 | "web-vitals": "^3.0.2"
33 | },
34 | "scripts": {
35 | "start": "react-scripts start",
36 | "build": "react-scripts build",
37 | "deploy": "firebase deploy --only hosting:fitpark-fitnesss",
38 | "eject": "react-scripts eject",
39 | "dev": "nodemon index.js"
40 | },
41 | "eslintConfig": {
42 | "extends": [
43 | "react-app",
44 | "react-app/jest"
45 | ]
46 | },
47 | "browserslist": {
48 | "production": [
49 | ">0.2%",
50 | "not dead",
51 | "not op_mini all"
52 | ],
53 | "development": [
54 | "last 1 chrome version",
55 | "last 1 firefox version",
56 | "last 1 safari version"
57 | ]
58 | },
59 | "devDependencies": {
60 | "autoprefixer": "^10.4.12",
61 | "postcss": "^8.4.16",
62 | "tailwindcss": "^3.1.8"
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/clients/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | }
7 |
--------------------------------------------------------------------------------
/clients/public/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Page Not Found
7 |
8 |
23 |
24 |
25 |
26 |
404
27 |
Page Not Found
28 |
The specified file was not found on this website. Please check the URL for mistakes and try again.
29 |
Why am I seeing this?
30 |
This page was generated by the Firebase Command-Line Interface. To modify it, edit the 404.html
file in your project's configured public
directory.
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/clients/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PaleGreenFILE/ECF-API-SPORT/388816851322c1a7bf658de54f78a4b82ec25f53/clients/public/favicon.ico
--------------------------------------------------------------------------------
/clients/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 | FITPARK FITNESS
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/clients/src/App.css:
--------------------------------------------------------------------------------
1 | @import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap");
2 | @tailwind base;
3 | @tailwind components;
4 | @tailwind utilities;
5 |
6 | * > * {
7 | font-family: "Poppins", sans-serif;
8 | }
9 | @layer base {
10 | body {
11 | @apply bg-[#fffe];
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/clients/src/App.js:
--------------------------------------------------------------------------------
1 | import { BrowserRouter as Router } from 'react-router-dom';
2 | import RouteRenderer from './core/routes/route-renderer';
3 | import './App.css';
4 |
5 | const App = () => {
6 |
7 | return (
8 |
9 |
10 |
11 | );
12 | };
13 |
14 | export default App;
15 |
--------------------------------------------------------------------------------
/clients/src/api/auth.js:
--------------------------------------------------------------------------------
1 | import axios from "axios";
2 | axios.defaults.withCredentials = true;
3 |
4 | // Register Partners, Structures
5 | export const onRegistrationPartners = async (registrationData) => {
6 | return await axios.post(
7 | process.env.REACT_APP_REGISTER_PARTNERS,
8 | registrationData
9 | );
10 | };
11 | export const onRegistrationStructures = async (registrationData) => {
12 | return await axios.post(
13 | process.env.REACT_APP_REGISTER_STRUCTURES,
14 | registrationData
15 | );
16 | };
17 |
18 | // Login Admin ,Partners ,Structures
19 | export const onLoginAdmin = async (loginData) => {
20 | return await axios.post(process.env.REACT_APP_LOGIN_ADMIN, loginData);
21 | };
22 | // Logout All Users request
23 | export const onLogout = async () => {
24 | return await axios.post(process.env.REACT_APP_LOGOUT);
25 | };
26 |
27 | // Get all users request
28 | export const getAllUsers = async () => {
29 | return await axios.get(process.env.REACT_APP_GET_ALLUSER);
30 | };
31 |
32 | // Get Users By Id request
33 | export const getUsersById = async (id) => {
34 | return await axios.get(process.env.REACT_APP_GET_USER_BY_ID + id);
35 | };
36 |
37 | // Get All Partner in Database
38 | export const getPartners = async () => {
39 | return await axios.get(process.env.REACT_APP_GET_ALLUSER_PARTNER);
40 | };
41 |
42 | // Get Structures By id and By Partner in Database
43 | export const getStructureByPartner = async (id) => {
44 | return await axios.get(process.env.REACT_APP_GET_STRUCTURES_BY_ID + id);
45 | };
46 |
47 | //*/* Route CRUD Admin */*
48 | export const updateUser = async (id, updateUserData) => {
49 | return await axios.put(
50 | process.env.REACT_APP_UPDATE_USER + id,
51 | updateUserData
52 | );
53 | };
54 | export const deleteAdmin = async (id) => {
55 | return await axios.delete(process.env.REACT_APP_DELETE_USER_ADMIN + id);
56 | };
57 | export const viewAdmin = async (id) => {
58 | return await axios.get(process.env.REACT_APP_VIEW_USER_ADMIN + id);
59 | };
60 | export const disableUserAdmin = async (id) => {
61 | return await axios.put(process.env.REACT_APP_DISABLE_USER_ADMIN + id);
62 | };
63 | export const enableAdmin = async (id) => {
64 | return await axios.put(process.env.REACT_APP_ENABLE_USER_ADMIN + id);
65 | };
66 |
67 | //*/* Route View Info Partners */*
68 | export const viewPartnersStructures = async (id) => {
69 | return await axios.get(process.env.REACT_APP_VIEW_USER_PARTNERS + id);
70 | };
71 |
72 | // First connexion by id Partners & Structures
73 | export const firstConnexion = async (data) => {
74 | return await axios.put(process.env.REACT_APP_FIRST_CONNEXION, data);
75 | };
76 |
--------------------------------------------------------------------------------
/clients/src/components/Calendar/Calendar.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | const Calendar = () => {
4 | return (
5 | Calendar
6 | )
7 | }
8 |
9 | export default Calendar
--------------------------------------------------------------------------------
/clients/src/components/Modals/Delete.js:
--------------------------------------------------------------------------------
1 | import { useRef } from 'react';
2 |
3 | const Delete = ({ deleteModal, confirmDelete }) => {
4 | const cancelButtonRef = useRef(null);
5 |
6 | return (
7 |
8 |
12 |
deleteModal(false)} ref={cancelButtonRef} className="w-full h-full bg-gray-900 opacity-10 z-0 absolute inset-0" />
13 |
14 |
15 |
29 |
30 |
33 |
Supprimer
34 |
Êtes-vous sûr de vouloir supprimer ce compte ? Attention toutes vos données seront supprimées.
{' '}
35 |
44 |
52 |
53 |
54 |
55 |
56 |
57 | );
58 | };
59 |
60 | export default Delete;
61 |
--------------------------------------------------------------------------------
/clients/src/components/Modals/Desactiver.js:
--------------------------------------------------------------------------------
1 | import { useRef } from 'react';
2 | const Desactiver = ({ disableModal, userDisable, userActivate }) => {
3 | const cancelButtonRef = useRef(null);
4 |
5 | return (
6 |
7 |
74 | );
75 | };
76 |
77 | export default Desactiver;
78 |
--------------------------------------------------------------------------------
/clients/src/components/Modals/ModalAddUser/AddUser.js:
--------------------------------------------------------------------------------
1 | import { useRef, useState, useEffect } from "react";
2 | import { useForm } from "react-hook-form";
3 | import emailjs from "@emailjs/browser";
4 | import {mail} from "../mailer";
5 | import {
6 | EMAIL_REGEX_VALIDATION,
7 | PASSWORD_REGEX_VALIDATION,
8 | } from "./../../../lib/lib";
9 | import {
10 | onRegistrationPartners,
11 | onRegistrationStructures,
12 | getPartners,
13 | } from "./../../../api/auth";
14 | const AddUser = ({ addUserModal, refreshUser }) => {
15 | const [loading, setLoading] = useState("");
16 | const [succes, setSucces] = useState("");
17 | const [emailSucces, setsuccesEmail] = useState("");
18 | const [error, setError] = useState("");
19 | const [errorEmail, setErrorEmail] = useState("");
20 | const active = "activer";
21 | const [partner, setPartner] = useState([]);
22 |
23 | const [valueUser, setValueUser] = useState("");
24 | const [showSecondSelect, setShowSecondSelect] = useState(false);
25 |
26 |
27 | const form = useRef();
28 | const {
29 | register,
30 | setValue,
31 | handleSubmit,
32 | formState: { errors },
33 | } = useForm();
34 | const cancelButtonRef = useRef(null);
35 |
36 | const onSubmit = async (data) => {
37 | try {
38 | if (valueUser === "partenaire" && active) {
39 | console.log(data);
40 | setLoading(true);
41 | alert("Etes-vous sur de vouloir Enregistrer un nouveau Partenaire ?");
42 | await onRegistrationPartners(data).then((res) => {
43 | const { name, email, message } = {
44 | name: data.name,
45 | email: data.email,
46 | message: data.message,
47 | }
48 | if (res.status === 200) {
49 | mail({ name, email, message })
50 | .then(() => {
51 | console.log(res.data);
52 | setSucces("Partenaire enregistré avec succés.");
53 | setsuccesEmail("Email envoyé au Partenaire avec succés.");
54 | setLoading(false);
55 | console.log(valueUser);
56 | console.log(data);
57 | setTimeout(() => {
58 | setsuccesEmail("");
59 | setSucces("");
60 | refreshUser();
61 | }, 4000);
62 | });
63 | }
64 | });
65 | } else if (valueUser === "structure" && active) {
66 | setLoading(true);
67 | alert("Etes-vous sur de vouloir Enregistrer une nouvelle Structure ?");
68 | await onRegistrationStructures(data).then((res) => {
69 | if (res.status === 200) {
70 | emailjs
71 | .sendForm(
72 | "service_1bqo3e6",
73 | "template_c07jq3b",
74 | form.current,
75 | "jUhrdIPj2FJVSlQP_"
76 | )
77 | .then(() => {
78 | console.log(res.data);
79 | setSucces("Structure enregistré avec succés.");
80 | setsuccesEmail("Email envoyé à la Structure avec succés.");
81 | setLoading(false);
82 | console.log(valueUser);
83 | console.log(data);
84 | setTimeout(() => {
85 | setsuccesEmail("");
86 | setSucces("");
87 | }, 4000);
88 | });
89 | }
90 | });
91 | }
92 | } catch (err) {
93 | setError("Erreur lors de l'inscription.");
94 | setErrorEmail("Email non envoyé ! Veuillez recommencer !");
95 | console.log(err.response.data.message);
96 | console.log(
97 | "Erreur lors de l'inscription. Email non envoyé ! Veuillez recommencer ! "
98 | );
99 | setLoading(false);
100 | setTimeout(() => {
101 | setError(false);
102 | setErrorEmail(false);
103 | }, 4000);
104 | }
105 | };
106 |
107 | const handleChange = (e) => {
108 | const value1 = e.target.value;
109 | if (value1 === "structure") {
110 | setValueUser(value1);
111 | setShowSecondSelect(true);
112 | } else if (value1 === "partenaire") {
113 | setValueUser(value1);
114 | setShowSecondSelect(false);
115 | }
116 | };
117 |
118 | const handleSelectChange = (e) => {
119 | const selectedIndex = e.target.selectedIndex;
120 | const selectedOptionText = e.target.options[selectedIndex].text;
121 | setValue("name_partner_linked", selectedOptionText);
122 | };
123 |
124 | const getAllPartners = async () => {
125 | const res = await getPartners();
126 | setPartner(res.data);
127 | };
128 | useEffect(() => {
129 | getAllPartners();
130 | }, []);
131 |
132 | return (
133 |