-
-
- setSearchQuery(e.target.value)}
- />
-
-
-
setActiveFilter('all')}
- className={`px-4 py-2 rounded-lg ${
- activeFilter === 'all' ? 'bg-indigo-600 text-white' : 'bg-white text-gray-600'
- }`}
- >
- All
-
-
setActiveFilter('locations')}
- className={`px-4 py-2 rounded-lg ${
- activeFilter === 'locations' ? 'bg-indigo-600 text-white' : 'bg-white text-gray-600'
- }`}
- >
- Locations
-
-
setActiveFilter('events')}
- className={`px-4 py-2 rounded-lg ${
- activeFilter === 'events' ? 'bg-indigo-600 text-white' : 'bg-white text-gray-600'
- }`}
- >
- Events
-
-
setActiveFilter('transport')}
- className={`px-4 py-2 rounded-lg ${
- activeFilter === 'transport' ? 'bg-indigo-600 text-white' : 'bg-white text-gray-600'
- }`}
- >
- Transport
-
+
+
+
+
+
Evenements locaux
+
+ Restez informé des derniers événements, festivals et rassemblements communautaires dans votre région.
+
+
+ Voir les événements
+
-
- {/* Features Grid */}
-
-
-
-
-
-
Points d'intérêt
-
- Découvrez les meilleurs endroits de votre ville, qu'il s'agisse de restaurants, de parcs ou de lieux culturels.
-
-
- Explorer les lieux
-
-
-
-
-
-
-
-
Evenements locaux
-
- Restez informé des derniers événements, festivals et rassemblements communautaires dans votre région.
-
-
- Voir les événements
-
-
-
-
-
-
-
-
Transports publics
-
- Accédez en temps réel aux horaires et aux itinéraires des bus, des trains et des autres transports publics.
-
-
- Vérifier les horaires
-
+
+
+
+
+
Transports publics
+
+ Accédez en temps réel aux horaires et aux itinéraires des bus, des trains et des autres transports publics.
+
+
+ Vérifier les horaires
+
- );
+
+ );
}
-export default Home;
\ No newline at end of file
+export default Home;
+
\ No newline at end of file
diff --git a/Front-end/src/pages/Login.jsx b/Front-end/src/pages/Login.jsx
new file mode 100644
index 0000000..5aab8e4
--- /dev/null
+++ b/Front-end/src/pages/Login.jsx
@@ -0,0 +1,121 @@
+import React, { useState } from 'react';
+import { Mail, Lock } from 'lucide-react';
+import { useNavigate, Link } from 'react-router-dom';
+import axios from 'axios'; // Assurez-vous d'avoir axios importé
+import { useAuth } from '../AuthContext';
+
+function Login() {
+ const [formData, setFormData] = useState({
+ email: '',
+ password: ''
+ });
+ const { login } = useAuth(); // Utilisation du hook useAuth pour accéder à la fonction login
+ const navigate = useNavigate(); // Initialisation de useNavigate
+
+ const handleChange = (e) => {
+ const { name, value } = e.target;
+ setFormData((prev) => ({
+ ...prev,
+ [name]: value
+ }));
+ };
+
+ const handleSubmit = async (e) => {
+ e.preventDefault();
+
+ try {
+ const response = await fetch("http://localhost:8888/login", {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify(formData),
+ });
+
+ // Récupérer les données JSON de la réponse
+ const data = await response.json();
+
+ // Vérifiez que la réponse contient bien un token
+ if (data.token) {
+ // Appel de la fonction login du contexte pour stocker le token
+ login(data.token);
+
+ // Rediriger vers la page d'accueil après la connexion
+ navigate('/');
+ } else {
+ console.error('Token manquant dans la réponse');
+ }
+ } catch (error) {
+ console.error('Erreur lors de la connexion', error);
+ }
+ };
+ return (
+
+ );
+}
+
+export default Login;
diff --git a/Front-end/src/pages/Settings.jsx b/Front-end/src/pages/Settings.jsx
new file mode 100644
index 0000000..b749a20
--- /dev/null
+++ b/Front-end/src/pages/Settings.jsx
@@ -0,0 +1,161 @@
+import React, { useState } from 'react';
+import { Mail, User, Lock } from 'lucide-react';
+import { useNavigate, Link} from 'react-router-dom'; // Importation du hook useNavigate
+
+function Settings() {
+ const [formData, setFormData] = useState({
+ name: '',
+ surname: '',
+ email: '',
+ gender: '',
+ password: '',
+ confirmPassword: ''
+ });
+ const navigate = useNavigate(); // Initialisation de useNavigate
+
+ const handleChange = (e) => {
+ const { name, value } = e.target;
+ setFormData(prev => ({
+ ...prev,
+ [name]: value
+ }));
+ };
+
+ const handleSubmit = async (e) => {
+ e.preventDefault();
+
+ if (formData.password !== formData.confirmPassword) {
+ alert("Les mots de passe ne correspondent pas !");
+ return;
+ }
+
+ try {
+ const response = await fetch("http://localhost:8888/settings", {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify(formData),
+ });
+
+ const data = await response.json();
+
+ if (!response.ok) {
+ throw new Error(data.error || "Erreur lors de la modification");
+ }
+
+ alert("Modification réussie !");
+
+ // Redirection vers la page d'accueil après une inscription réussie
+ navigate("/home"); // Remplace "/home" par l'URL de ta page d'accueil
+ } catch (error) {
+ alert(error.message);
+ }
+ };
+
+ return (
+
+ );
+}
+
+export default Settings;
diff --git a/Front-end/src/pages/Signup.jsx b/Front-end/src/pages/Signup.jsx
new file mode 100644
index 0000000..595e7ec
--- /dev/null
+++ b/Front-end/src/pages/Signup.jsx
@@ -0,0 +1,217 @@
+import React, { useState } from 'react';
+import { Mail, User, Lock } from 'lucide-react';
+import { useNavigate, Link} from 'react-router-dom'; // Importation du hook useNavigate
+
+function Signup() {
+ const [formData, setFormData] = useState({
+ name: '',
+ surname: '',
+ email: '',
+ gender: '',
+ password: '',
+ confirmPassword: ''
+ });
+ const navigate = useNavigate(); // Initialisation de useNavigate
+
+ const handleChange = (e) => {
+ const { name, value } = e.target;
+ setFormData(prev => ({
+ ...prev,
+ [name]: value
+ }));
+ };
+
+ const handleSubmit = async (e) => {
+ e.preventDefault();
+
+ if (formData.password !== formData.confirmPassword) {
+ alert("Les mots de passe ne correspondent pas !");
+ return;
+ }
+
+ try {
+ const response = await fetch("http://localhost:8888/signup", {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify(formData),
+ });
+
+ const data = await response.json();
+
+ if (!response.ok) {
+ throw new Error(data.error || "Erreur lors de l'inscription");
+ }
+
+ alert("Inscription réussie !");
+
+ // Redirection vers la page d'accueil après une inscription réussie
+ navigate("/home"); // Remplace "/home" par l'URL de ta page d'accueil
+ } catch (error) {
+ alert(error.message);
+ }
+ };
+
+ return (
+
+ );
+}
+
+export default Signup;
diff --git a/sql/export.sql b/sql/export.sql
new file mode 100644
index 0000000..2181aab
--- /dev/null
+++ b/sql/export.sql
@@ -0,0 +1,318 @@
+--
+-- PostgreSQL database dump
+--
+
+-- Dumped from database version 17.4
+-- Dumped by pg_dump version 17.4
+
+-- Started on 2025-04-08 10:16:23
+
+SET statement_timeout = 0;
+SET lock_timeout = 0;
+SET idle_in_transaction_session_timeout = 0;
+SET transaction_timeout = 0;
+SET client_encoding = 'UTF8';
+SET standard_conforming_strings = on;
+SELECT pg_catalog.set_config('search_path', '', false);
+SET check_function_bodies = false;
+SET xmloption = content;
+SET client_min_messages = warning;
+SET row_security = off;
+
+SET default_tablespace = '';
+
+SET default_table_access_method = heap;
+
+--
+-- TOC entry 222 (class 1259 OID 32768)
+-- Name: range_data; Type: TABLE; Schema: public; Owner: postgres
+--
+
+CREATE TABLE public.range_data (
+ station_id integer NOT NULL,
+ temperature_min numeric,
+ temperature_max numeric,
+ pressure_min numeric,
+ pressure_max numeric,
+ humidity_min numeric,
+ humidity_max numeric
+);
+
+
+ALTER TABLE public.range_data OWNER TO postgres;
+
+--
+-- TOC entry 221 (class 1259 OID 16479)
+-- Name: weather_data; Type: TABLE; Schema: public; Owner: postgres
+--
+
+CREATE TABLE public.weather_data (
+ id integer NOT NULL,
+ station_id integer NOT NULL,
+ temperature numeric(5,2),
+ humidity numeric(5,2),
+ pressure numeric(7,2),
+ wind_speed numeric(5,2),
+ wind_direction character varying(50),
+ "timestamp" timestamp without time zone DEFAULT CURRENT_TIMESTAMP
+);
+
+
+ALTER TABLE public.weather_data OWNER TO postgres;
+
+--
+-- TOC entry 220 (class 1259 OID 16478)
+-- Name: weather_data_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
+--
+
+CREATE SEQUENCE public.weather_data_id_seq
+ AS integer
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+ALTER SEQUENCE public.weather_data_id_seq OWNER TO postgres;
+
+--
+-- TOC entry 4921 (class 0 OID 0)
+-- Dependencies: 220
+-- Name: weather_data_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
+--
+
+ALTER SEQUENCE public.weather_data_id_seq OWNED BY public.weather_data.id;
+
+
+--
+-- TOC entry 219 (class 1259 OID 16468)
+-- Name: weather_objects; Type: TABLE; Schema: public; Owner: postgres
+--
+
+CREATE TABLE public.weather_objects (
+ id integer NOT NULL,
+ name character varying(500) NOT NULL,
+ description text,
+ type character varying(100) NOT NULL,
+ location character varying(255),
+ last_update timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
+ status character varying(50) DEFAULT 'active'::character varying,
+ batterie integer,
+ type_batterie character varying(50),
+ CONSTRAINT weather_objects_batterie_check CHECK (((batterie >= 0) AND (batterie <= 100)))
+);
+
+
+ALTER TABLE public.weather_objects OWNER TO postgres;
+
+--
+-- TOC entry 217 (class 1259 OID 16466)
+-- Name: weather_objects_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
+--
+
+CREATE SEQUENCE public.weather_objects_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+ALTER SEQUENCE public.weather_objects_id_seq OWNER TO postgres;
+
+--
+-- TOC entry 218 (class 1259 OID 16467)
+-- Name: weather_objects_id_seq1; Type: SEQUENCE; Schema: public; Owner: postgres
+--
+
+CREATE SEQUENCE public.weather_objects_id_seq1
+ AS integer
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+ALTER SEQUENCE public.weather_objects_id_seq1 OWNER TO postgres;
+
+--
+-- TOC entry 4922 (class 0 OID 0)
+-- Dependencies: 218
+-- Name: weather_objects_id_seq1; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
+--
+
+ALTER SEQUENCE public.weather_objects_id_seq1 OWNED BY public.weather_objects.id;
+
+
+--
+-- TOC entry 4755 (class 2604 OID 16482)
+-- Name: weather_data id; Type: DEFAULT; Schema: public; Owner: postgres
+--
+
+ALTER TABLE ONLY public.weather_data ALTER COLUMN id SET DEFAULT nextval('public.weather_data_id_seq'::regclass);
+
+
+--
+-- TOC entry 4752 (class 2604 OID 16471)
+-- Name: weather_objects id; Type: DEFAULT; Schema: public; Owner: postgres
+--
+
+ALTER TABLE ONLY public.weather_objects ALTER COLUMN id SET DEFAULT nextval('public.weather_objects_id_seq1'::regclass);
+
+
+--
+-- TOC entry 4915 (class 0 OID 32768)
+-- Dependencies: 222
+-- Data for Name: range_data; Type: TABLE DATA; Schema: public; Owner: postgres
+--
+
+COPY public.range_data (station_id, temperature_min, temperature_max, pressure_min, pressure_max, humidity_min, humidity_max) FROM stdin;
+1 -33 42 980 1040 30 84
+2 -15 50 980 1040 30 90
+3 -15 50 980 1040 30 90
+4 -15 50 980 1040 30 90
+5 -15 50 980 1040 30 90
+6 -15 50 980 1040 30 90
+7 -15 50 980 1040 30 90
+8 -15 50 980 1040 30 90
+9 -15 50 980 1040 30 90
+10 -15 50 980 1040 30 90
+\.
+
+
+--
+-- TOC entry 4914 (class 0 OID 16479)
+-- Dependencies: 221
+-- Data for Name: weather_data; Type: TABLE DATA; Schema: public; Owner: postgres
+--
+
+COPY public.weather_data (id, station_id, temperature, humidity, pressure, wind_speed, wind_direction, "timestamp") FROM stdin;
+1 1 21.50 60.20 1013.10 5.40 Nord-Ouest 2025-03-29 18:47:46.685241
+2 2 22.30 55.00 1012.50 3.20 Sud-Ouest 2025-03-29 18:47:46.685241
+3 3 24.10 50.00 1010.80 6.00 Est 2025-03-29 18:47:46.685241
+4 1 19.80 65.40 1014.00 4.50 Ouest 2025-03-29 18:47:46.685241
+5 2 20.60 59.30 1013.50 2.80 Nord 2025-03-29 18:47:46.685241
+6 1 22.50 60.00 1012.50 12.30 Nord-Ouest 2025-03-29 08:00:00
+7 1 23.00 65.00 1013.25 14.00 Ouest 2025-03-29 09:00:00
+8 1 24.00 70.00 1014.75 15.20 Nord 2025-03-29 10:00:00
+9 2 21.50 55.00 1011.30 11.00 Sud 2025-03-29 08:30:00
+10 2 22.00 60.00 1012.80 13.00 Est 2025-03-29 09:30:00
+11 2 23.50 63.00 1013.50 14.50 Sud-Est 2025-03-29 10:30:00
+12 3 26.00 58.00 1012.90 17.00 Ouest 2025-03-29 11:00:00
+13 3 27.00 60.00 1014.00 18.50 Nord-Ouest 2025-03-29 12:00:00
+14 3 28.00 62.00 1015.10 16.00 Nord 2025-03-29 13:00:00
+15 4 19.50 75.00 1010.00 9.50 Sud-Ouest 2025-03-29 08:00:00
+16 4 20.00 80.00 1010.50 10.00 Sud 2025-03-29 09:00:00
+17 4 21.50 85.00 1011.00 11.50 Est 2025-03-29 10:00:00
+18 5 18.00 90.00 1010.70 8.00 Ouest 2025-03-29 08:30:00
+19 5 18.50 92.00 1011.20 7.00 Nord-Ouest 2025-03-29 09:30:00
+20 5 19.00 95.00 1011.80 6.50 Nord 2025-03-29 10:30:00
+21 6 24.50 65.00 1013.90 13.00 Sud 2025-03-29 11:00:00
+22 6 25.00 66.00 1014.20 14.50 Ouest 2025-03-29 12:00:00
+23 6 26.50 68.00 1015.50 16.00 Sud-Ouest 2025-03-29 13:00:00
+24 7 21.00 60.00 1012.50 11.50 Est 2025-03-29 08:00:00
+25 7 22.50 62.00 1013.00 12.00 Nord-Ouest 2025-03-29 09:00:00
+26 7 23.00 64.00 1013.75 13.50 Sud-Est 2025-03-29 10:00:00
+27 8 25.00 58.00 1012.10 16.50 Nord 2025-03-29 08:30:00
+28 8 26.00 60.00 1013.30 17.50 Ouest 2025-03-29 09:30:00
+29 8 27.00 62.00 1014.50 18.00 Sud-Ouest 2025-03-29 10:30:00
+30 9 22.00 67.00 1011.40 14.00 Est 2025-03-29 11:00:00
+31 9 23.00 69.00 1012.60 15.00 Nord-Ouest 2025-03-29 12:00:00
+32 9 24.00 72.00 1013.80 16.00 Nord 2025-03-29 13:00:00
+33 10 18.00 55.00 1010.20 10.00 Ouest 2025-03-29 08:00:00
+34 10 19.00 58.00 1011.00 11.50 Sud-Ouest 2025-03-29 09:00:00
+35 10 20.00 60.00 1011.70 12.50 Est 2025-03-29 10:00:00
+\.
+
+
+--
+-- TOC entry 4912 (class 0 OID 16468)
+-- Dependencies: 219
+-- Data for Name: weather_objects; Type: TABLE DATA; Schema: public; Owner: postgres
+--
+
+COPY public.weather_objects (id, name, description, type, location, last_update, status, batterie, type_batterie) FROM stdin;
+1 Station Paris Station météo située à Paris, France. Mesures de température, humidité, pression et vent. station Paris, France 2025-04-07 20:47:06.264847 active 100 solaire
+9 Station Nice Station météo située à Nice, France. Elle mesure la température, l'humidité et la pression. station Nice, France 2025-03-31 18:31:23.038047 active 100 solaire
+2 Station Lyon Station météo située à Lyon, France. Mesures de température, humidité, pression et vent. station Lyon, France 2025-03-30 12:16:00.835834 active 100 solaire
+3 Station Marseille Station météo située à Marseille, France. Mesures de température, humidité, pression et vent. station Marseille, France 2025-03-30 17:01:10.631653 inactive 100 solaire
+4 Capteur Bordeaux Capteur de température et d'humidité à Bordeaux. capteur Bordeaux, France 2025-03-30 17:53:01.42853 active 100 solaire
+5 Capteur Lille Capteur de pression atmosphérique à Lille. capteur Lille, France 2025-03-31 21:32:04.955306 inactive 100 solaire
+6 Capteur Nantes Capteur de vent à Nantes. capteur Nantes, France 2025-03-30 20:10:18.547523 active 100 solaire
+7 Station Toulouse Station météo à Toulouse mesurant la température, l'humidité, la pression et la vitesse du vent. station Toulouse, France 2025-04-02 15:43:34.803703 active 100 solaire
+10 Capteur Paris Sud Capteur de température et humidité à Paris Sud. capteur Paris, France 2025-04-02 23:09:38.725522 inactive 100 solaire
+8 Capteur Grenoble Capteur de température à Grenoble. capteur Grenoble, France 2025-04-04 10:40:08.247433 active 100 solaire
+\.
+
+
+--
+-- TOC entry 4923 (class 0 OID 0)
+-- Dependencies: 220
+-- Name: weather_data_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
+--
+
+SELECT pg_catalog.setval('public.weather_data_id_seq', 35, true);
+
+
+--
+-- TOC entry 4924 (class 0 OID 0)
+-- Dependencies: 217
+-- Name: weather_objects_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
+--
+
+SELECT pg_catalog.setval('public.weather_objects_id_seq', 1, false);
+
+
+--
+-- TOC entry 4925 (class 0 OID 0)
+-- Dependencies: 218
+-- Name: weather_objects_id_seq1; Type: SEQUENCE SET; Schema: public; Owner: postgres
+--
+
+SELECT pg_catalog.setval('public.weather_objects_id_seq1', 17, true);
+
+
+--
+-- TOC entry 4763 (class 2606 OID 32774)
+-- Name: range_data station_meteo_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
+--
+
+ALTER TABLE ONLY public.range_data
+ ADD CONSTRAINT station_meteo_pkey PRIMARY KEY (station_id);
+
+
+--
+-- TOC entry 4761 (class 2606 OID 16485)
+-- Name: weather_data weather_data_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
+--
+
+ALTER TABLE ONLY public.weather_data
+ ADD CONSTRAINT weather_data_pkey PRIMARY KEY (id);
+
+
+--
+-- TOC entry 4759 (class 2606 OID 16477)
+-- Name: weather_objects weather_objects_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
+--
+
+ALTER TABLE ONLY public.weather_objects
+ ADD CONSTRAINT weather_objects_pkey PRIMARY KEY (id);
+
+
+--
+-- TOC entry 4764 (class 2606 OID 16486)
+-- Name: weather_data weather_data_station_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
+--
+
+ALTER TABLE ONLY public.weather_data
+ ADD CONSTRAINT weather_data_station_id_fkey FOREIGN KEY (station_id) REFERENCES public.weather_objects(id);
+
+
+-- Completed on 2025-04-08 10:16:23
+
+--
+-- PostgreSQL database dump complete
+--
+