diff --git a/Express/barAndCafe/jest.config.js b/Express/barAndCafe/jest.config.js index 2c8a283..4d6a8c8 100644 --- a/Express/barAndCafe/jest.config.js +++ b/Express/barAndCafe/jest.config.js @@ -1,5 +1,8 @@ /** @type {import('ts-jest').JestConfigWithTsJest} */ module.exports = { + testPathIgnorePatterns: [ + "/dist/" + ], testTimeout: 10000, preset: 'ts-jest', testEnvironment: 'node', diff --git a/Express/barAndCafe/package-lock.json b/Express/barAndCafe/package-lock.json index 42ae426..3a327db 100644 --- a/Express/barAndCafe/package-lock.json +++ b/Express/barAndCafe/package-lock.json @@ -8,6 +8,7 @@ "@types/express": "^4.17.21", "@types/node": "^20.12.7", "axios": "^1.6.8", + "cors": "^2.8.5", "dotenv": "^16.4.5", "express": "^4.19.2", "rimraf": "^5.0.5", @@ -15,6 +16,7 @@ "swagger-ui-express": "^5.0.0" }, "devDependencies": { + "@types/cors": "^2.8.17", "@types/jest": "^29.5.12", "@types/rewire": "^2.5.30", "@types/supertest": "^6.0.2", @@ -1968,6 +1970,15 @@ "integrity": "sha512-he+DHOWReW0nghN24E1WUqM0efK4kI9oTqDm6XmK8ZPe2djZ90BSNdGnIyCLzCPw7/pogPlGbzI2wHGGmi4O/Q==", "dev": true }, + "node_modules/@types/cors": { + "version": "2.8.17", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.17.tgz", + "integrity": "sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/express": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", @@ -4745,6 +4756,18 @@ "dev": true, "optional": true }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/create-jest": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", @@ -9248,7 +9271,6 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, "engines": { "node": ">=0.10.0" } diff --git a/Express/barAndCafe/package.json b/Express/barAndCafe/package.json index 89ee4da..4ab1c22 100644 --- a/Express/barAndCafe/package.json +++ b/Express/barAndCafe/package.json @@ -14,6 +14,7 @@ "@types/express": "^4.17.21", "@types/node": "^20.12.7", "axios": "^1.6.8", + "cors": "^2.8.5", "dotenv": "^16.4.5", "express": "^4.19.2", "rimraf": "^5.0.5", @@ -21,6 +22,7 @@ "swagger-ui-express": "^5.0.0" }, "devDependencies": { + "@types/cors": "^2.8.17", "@types/jest": "^29.5.12", "@types/rewire": "^2.5.30", "@types/supertest": "^6.0.2", diff --git a/Express/barAndCafe/src/app.ts b/Express/barAndCafe/src/app.ts index 400e92f..3b08a38 100644 --- a/Express/barAndCafe/src/app.ts +++ b/Express/barAndCafe/src/app.ts @@ -1,11 +1,13 @@ import { getCity, getRadius, getPoiId, getBox } from "./openTripMaps" import express from "express" +import cors from "cors" /** * Initialize Express application instance. * @returns An initialized Express application object. */ const app = express() +app.use(cors()) /** diff --git a/Express/barAndCafe/src/openTripMaps.ts b/Express/barAndCafe/src/openTripMaps.ts index dd5dd90..3e29bb3 100644 --- a/Express/barAndCafe/src/openTripMaps.ts +++ b/Express/barAndCafe/src/openTripMaps.ts @@ -13,7 +13,7 @@ const key = process.env.OPEN_TRIP_MAPS_KEY * @param {string} lat2 Latitude of the 2nd point of the box * @returns {FeatureCollection} a list of POIs with their type, id, etc. (cf: [opentripmap](https://dev.opentripmap.org/docs#)) */ -async function callBox(lon1:string, lat1:string, lon2: string, lat2: string) { +async function callBox(lon1:string, lat1:string, lon2: string, lat2: string, rate: string) { const lonMin = Math.min(parseFloat(lon1), parseFloat(lon2)) const lonMax = Math.max(parseFloat(lon1), parseFloat(lon2)) const latMin = Math.min(parseFloat(lat1), parseFloat(lat2)) @@ -27,6 +27,7 @@ async function callBox(lon1:string, lat1:string, lon2: string, lat2: string) { lon_max: lonMax, lat_min: latMin, lat_max: latMax, + rate: rate, apikey: key, kinds: 'bars,cafes,pubs,biergartens' }, @@ -182,11 +183,16 @@ export async function getBox(req:express.Request, res: express.Response) { const lat1 = req.query["lat1"] as string const lon2 = req.query["lon2"] as string const lat2 = req.query["lat2"] as string + let rate = req.query["rate"] as string if(!lon1 || !lat1 || !lon2 || !lat2){ res.status(400).send("Missing Argument") return } - res.send( await callBox(lon1, lat1, lon2, lat2)) + if(!rate){ + rate = "1"; + } + + res.send( await callBox(lon1, lat1, lon2, lat2, rate)) } diff --git a/Express/barAndCafe/src/swaggerDef.ts b/Express/barAndCafe/src/swaggerDef.ts index 7194263..654e615 100644 --- a/Express/barAndCafe/src/swaggerDef.ts +++ b/Express/barAndCafe/src/swaggerDef.ts @@ -21,7 +21,7 @@ const options = { } ], }, - apis: ['./src/*.ts'], + apis: ['./src/*.ts','./dist/src/*.js'], explorer: true } diff --git a/Express/barAndCafe/test/openTripMaps.test.ts b/Express/barAndCafe/test/openTripMaps.test.ts index 44fdc1f..8b98543 100644 --- a/Express/barAndCafe/test/openTripMaps.test.ts +++ b/Express/barAndCafe/test/openTripMaps.test.ts @@ -219,6 +219,14 @@ describe("Test the otm city path", () => { } ] } + function sleep(milliseconds: number) { + const date = Date.now(); + let currentDate = null; + do { + currentDate = Date.now(); + } while (currentDate - date < milliseconds); + } + sleep(2000); request(app) .get("/otm/box") .query({'lon1':'-1.435199','lon2':'-1.43519', 'lat1':'46.668460', 'lat2':'46.668461'}) diff --git a/Ratrapage_WEB.code-workspace b/Ratrapage_WEB.code-workspace new file mode 100644 index 0000000..f6c581d --- /dev/null +++ b/Ratrapage_WEB.code-workspace @@ -0,0 +1,18 @@ +{ + "folders": [ + { + "name": "Ratrapage_WEB", + "path": "." + }, + { + "name": "barAndCafe", + "path": "Express/barAndCafe" + }, + { + "path": "front" + } + ], + "settings": { + "typescript.tsdk": "node_modules/typescript/lib" + } +} \ No newline at end of file diff --git a/bruno/OpenData datatourisme/environments/dev.bru b/bruno/OpenData datatourisme/environments/dev.bru index 4226836..08d7ebb 100644 --- a/bruno/OpenData datatourisme/environments/dev.bru +++ b/bruno/OpenData datatourisme/environments/dev.bru @@ -1,5 +1,6 @@ vars { TRIPMAP_URL: https://api.opentripmap.com/0.1 + EXPRESS_API: http://localhost:3001 } vars:secret [ app_key, diff --git a/bruno/OpenData datatourisme/environments/prod.bru b/bruno/OpenData datatourisme/environments/prod.bru new file mode 100644 index 0000000..e18cdae --- /dev/null +++ b/bruno/OpenData datatourisme/environments/prod.bru @@ -0,0 +1,8 @@ +vars { + EXPRESS_API: https://drink-tweb.cb85.fr + PB_URL: https://pb-tweb.cb85.fr + TRIPMAP_URL: https://api.opentripmap.com/0.1/ +} +vars:secret [ + OTM_KEY +] diff --git a/bruno/OpenData datatourisme/express/otm_ex_city.bru b/bruno/OpenData datatourisme/express/otm_ex_city.bru index 15bda16..5904d18 100644 --- a/bruno/OpenData datatourisme/express/otm_ex_city.bru +++ b/bruno/OpenData datatourisme/express/otm_ex_city.bru @@ -5,7 +5,7 @@ meta { } get { - url: http://localhost:3001/otm/city?name=La roche sur yon&radius=300 + url: {{EXPRESS_API}}/otm/city?name=La roche sur yon&radius=300 body: none auth: none } diff --git a/bruno/OpenData datatourisme/otm/otm_city.bru b/bruno/OpenData datatourisme/otm/otm_city.bru new file mode 100644 index 0000000..e558ec5 --- /dev/null +++ b/bruno/OpenData datatourisme/otm/otm_city.bru @@ -0,0 +1,16 @@ +meta { + name: otm_city + type: http + seq: 5 +} + +get { + url: {{TRIPMAP_URL}}/en/places/geoname?name=paris&apikey={{OTM_KEY}} + body: none + auth: none +} + +query { + name: paris + apikey: {{OTM_KEY}} +} diff --git a/bruno/OpenData datatourisme/poketBase_api/connexion.bru b/bruno/OpenData datatourisme/poketBase_api/connexion.bru new file mode 100644 index 0000000..dde343c --- /dev/null +++ b/bruno/OpenData datatourisme/poketBase_api/connexion.bru @@ -0,0 +1,18 @@ +meta { + name: connexion + type: http + seq: 1 +} + +post { + url: {{PB_URL}}/api/collections/users/auth-with-password + body: json + auth: none +} + +body:json { + { + "identity": "michel.biche@aptatio.com", + "password": "123456789" + } +} diff --git a/bruno/OpenData datatourisme/poketBase_api/get all poi.bru b/bruno/OpenData datatourisme/poketBase_api/get all poi.bru new file mode 100644 index 0000000..9f57130 --- /dev/null +++ b/bruno/OpenData datatourisme/poketBase_api/get all poi.bru @@ -0,0 +1,27 @@ +meta { + name: get all poi + type: http + seq: 5 +} + +get { + url: {{PB_URL}}/api/collections/user_poi/records?filter=owner='vvy93m1hoaeshwy'&&poi_list='cabkkovmjsfoapa' + body: json + auth: bearer +} + +query { + filter: owner + poi_list: 'cabkkovmjsfoapa' +} + +auth:bearer { + token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb2xsZWN0aW9uSWQiOiJfcGJfdXNlcnNfYXV0aF8iLCJleHAiOjE3MTg4Mjg0NzEsImlkIjoidnZ5OTNtMWhvYWVzaHd5IiwidHlwZSI6ImF1dGhSZWNvcmQifQ.pC7u-QaZ_BYqWA5wG8wu1lRbbd4mKuKeAveWe_IBnfU +} + +body:json { + { + "owner": "vvy93m1hoaeshwy", + "poi_list": "sh430u0im37cxm5" + } +} diff --git a/bruno/OpenData datatourisme/poketBase_api/link user to poi.bru b/bruno/OpenData datatourisme/poketBase_api/link user to poi.bru new file mode 100644 index 0000000..bb6a5bd --- /dev/null +++ b/bruno/OpenData datatourisme/poketBase_api/link user to poi.bru @@ -0,0 +1,22 @@ +meta { + name: link user to poi + type: http + seq: 3 +} + +post { + url: {{PB_URL}}/api/collections/user_poi/records + body: json + auth: bearer +} + +auth:bearer { + token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb2xsZWN0aW9uSWQiOiJfcGJfdXNlcnNfYXV0aF8iLCJleHAiOjE3MTg4Mjg0NzEsImlkIjoidnZ5OTNtMWhvYWVzaHd5IiwidHlwZSI6ImF1dGhSZWNvcmQifQ.pC7u-QaZ_BYqWA5wG8wu1lRbbd4mKuKeAveWe_IBnfU +} + +body:json { + { + "owner": "vvy93m1hoaeshwy", + "poi_list": "sh430u0im37cxm5" + } +} diff --git a/bruno/OpenData datatourisme/poketBase_api/send a poi.bru b/bruno/OpenData datatourisme/poketBase_api/send a poi.bru new file mode 100644 index 0000000..c75c300 --- /dev/null +++ b/bruno/OpenData datatourisme/poketBase_api/send a poi.bru @@ -0,0 +1,40 @@ +meta { + name: send a poi + type: http + seq: 2 +} + +post { + url: {{PB_URL}}/api/collections/POI/records + body: json + auth: bearer +} + +auth:bearer { + token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb2xsZWN0aW9uSWQiOiJfcGJfdXNlcnNfYXV0aF8iLCJleHAiOjE3MTg4Mjg0NzEsImlkIjoidnZ5OTNtMWhvYWVzaHd5IiwidHlwZSI6ImF1dGhSZWNvcmQifQ.pC7u-QaZ_BYqWA5wG8wu1lRbbd4mKuKeAveWe_IBnfU +} + +body:json { + { + "Poi_id": "11472887", + "Poi": { + "type": "Feature", + "id": "11472887", + "geometry": { + "type": "Point", + "coordinates": [ + -0.0626024, + 51.4924088 + ] + }, + "properties": { + "xid": "W544344833", + "name": "The Blue Anchor", + "rate": 2, + "osm": "way/544344833", + "wikidata": "Q7718716", + "kinds": "pubs,foods,shops,marketplaces,tourist_facilities" + } + } + } +} diff --git a/bruno/OpenData datatourisme/poketBase_api/send fav to astro.bru b/bruno/OpenData datatourisme/poketBase_api/send fav to astro.bru new file mode 100644 index 0000000..7059294 --- /dev/null +++ b/bruno/OpenData datatourisme/poketBase_api/send fav to astro.bru @@ -0,0 +1,37 @@ +meta { + name: send fav to astro + type: http + seq: 4 +} + +post { + url: http://localhost:3000/maps/save_poi + body: json + auth: bearer +} + +auth:bearer { + token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb2xsZWN0aW9uSWQiOiJfcGJfdXNlcnNfYXV0aF8iLCJleHAiOjE3MTg4ODY2OTIsImlkIjoidnZ5OTNtMWhvYWVzaHd5IiwidHlwZSI6ImF1dGhSZWNvcmQifQ.R9PBGlHn6aBHt89g6G0NykMh_Vye24OpKEUYtz6R6Og +} + +body:json { + { + "type": "Feature", + "id": "11472888", + "geometry": { + "type": "Point", + "coordinates": [ + -0.0626024, + 51.4924088 + ] + }, + "properties": { + "xid": "W544344833", + "name": "The Blue Anchor", + "rate": 2, + "osm": "way/544344833", + "wikidata": "Q7718716", + "kinds": "pubs,foods,shops,marketplaces,tourist_facilities" + } + } +} diff --git a/docker-compose.yml b/docker-compose.yml index 6d262d5..0fc6b8c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,7 +18,9 @@ services: - public front: - image: git.lab-ouest.org/epitech/ratrapage_t-web_front:pr-1-head + image: git.lab-ouest.org/epitech/ratrapage_t-web_front:pr-16-head + environment: + - POCKETBASE_URL=https://${POCKET_BASE_URL} depends_on: - pocketbase labels: @@ -30,9 +32,10 @@ services: - public back_drink: - image: git.lab-ouest.org/epitech/ratrapage_t-web_back:pr-6-head + image: git.lab-ouest.org/epitech/ratrapage_t-web_back:master environment: - port=${BACK_BASE_PORT} + - OPEN_TRIP_MAPS_KEY=${OPEN_TRIP_MAPS_KEY} labels: - traefik.enable=true - traefik.http.routers.expressDrinkTweb.rule=Host(`${DRINK_URL}`) @@ -92,4 +95,4 @@ x-dockge: - https://${FRONT_URL}/ - https://${DOCS_DRINK_URL}/ - https://${DRINK_URL}/ - - https://${DATA_TOURISME_URL}/ \ No newline at end of file + - https://${DATA_TOURISME_URL}/ diff --git a/front/astro.config.mjs b/front/astro.config.mjs index 159bf75..112ae4f 100644 --- a/front/astro.config.mjs +++ b/front/astro.config.mjs @@ -26,7 +26,8 @@ const whenExternalScripts = (items = []) => hasExternalScripts ? (Array.isArray(items) ? items.map((item) => item()) : [items()]) : []; export default defineConfig({ - + + output: 'server', compressHTML: true, build: { assets: 'assets', @@ -37,7 +38,6 @@ export default defineConfig({ port: 3000 }, trailingSlash: 'never', - output: 'server', adapter: node({ mode: 'standalone' }), diff --git a/front/package-lock.json b/front/package-lock.json index 1f1732a..3b38388 100644 --- a/front/package-lock.json +++ b/front/package-lock.json @@ -20,12 +20,16 @@ "astro-embed": "^0.7.2", "astro-icon": "^1.1.0", "leaflet": "^1.9.4", + "leaflet-control-geocoder": "^2.4.0", + "leaflet-geosearch": "^4.0.0", + "leaflet-routing-machine": "^3.2.12", "limax": "4.1.0", "lodash.merge": "^4.6.2", "lucide-astro": "^0.372.0", "pocketbase": "^0.21.1", "react-leaflet": "^4.2.1", "simple-icons-astro": "^11.12.0", + "tailwind-merge": "^2.3.0", "tailwindcss": "^3.4.3", "unpic": "^3.18.0" }, @@ -42,6 +46,7 @@ "@types/eslint__js": "^8.42.3", "@types/js-yaml": "^4.0.9", "@types/leaflet": "^1.9.12", + "@types/leaflet-routing-machine": "^3.2.8", "@types/lodash.merge": "^4.6.9", "@types/node": "^20", "@typescript-eslint/eslint-plugin": "^6.21.0", @@ -59,7 +64,6 @@ "reading-time": "^1.5.0", "rehype-plugin-image-native-lazy-loading": "^1.2.0", "sharp": "0.33.3", - "tailwind-merge": "^2.3.0", "tailwindcss": "^3.4.3", "typescript": "^5", "typescript-eslint": "^7.9.0", @@ -1129,7 +1133,6 @@ "version": "7.24.5", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.5.tgz", "integrity": "sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==", - "dev": true, "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -1746,6 +1749,15 @@ "resolved": "https://registry.npmjs.org/@fontsource-variable/inter/-/inter-5.0.18.tgz", "integrity": "sha512-rJzSrtJ3b7djiGFvRuTe6stDfbYJGhdQSfn2SI2WfXviee7Er0yKAHE5u7FU7OWVQQQ1x3+cxdmx9NdiAkcrcA==" }, + "node_modules/@googlemaps/js-api-loader": { + "version": "1.16.6", + "resolved": "https://registry.npmjs.org/@googlemaps/js-api-loader/-/js-api-loader-1.16.6.tgz", + "integrity": "sha512-V8p5W9DbPQx74jWUmyYJOerhiB4C+MHekaO0ZRmc6lrOYrvY7+syLhzOWpp55kqSPeNb+qbC2h8i69aLIX6krQ==", + "optional": true, + "dependencies": { + "fast-deep-equal": "^3.1.3" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.14", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", @@ -2459,6 +2471,22 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@mapbox/corslite": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/@mapbox/corslite/-/corslite-0.0.7.tgz", + "integrity": "sha512-w/uS474VFjmqQ7fFWIMZINQM1BAQxDLuoJaZZIPES1BmeYpCtlh9MtbFxKGGDAsfvut8/HircIsVvEYRjQ+iMg==" + }, + "node_modules/@mapbox/polyline": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@mapbox/polyline/-/polyline-0.2.0.tgz", + "integrity": "sha512-GCddO0iw6AzOQqZgBmjEQI9Pgo40/yRgkTkikGctE01kNBN0ThWYuAnTD+hRWrAWMV6QJ0rNm4m8DAsaAXE7Pg==", + "bin": { + "polyline": "bin/polyline.bin.js" + }, + "engines": { + "node": "*" + } + }, "node_modules/@mdx-js/mdx": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-3.0.1.tgz", @@ -3061,6 +3089,15 @@ "@types/geojson": "*" } }, + "node_modules/@types/leaflet-routing-machine": { + "version": "3.2.8", + "resolved": "https://registry.npmjs.org/@types/leaflet-routing-machine/-/leaflet-routing-machine-3.2.8.tgz", + "integrity": "sha512-v2pJDv/nqbB769SsytHemhLkqwjVor9UdWvZ1l6Y2SEaXNt1yDwVrktc4sCT8/4n7npuEb8VP+UAk8xrPePqSQ==", + "dev": true, + "dependencies": { + "@types/leaflet": "*" + } + }, "node_modules/@types/lodash": { "version": "4.17.4", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.4.tgz", @@ -6318,7 +6355,7 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "devOptional": true }, "node_modules/fast-glob": { "version": "3.3.2", @@ -8117,6 +8154,36 @@ "resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.9.4.tgz", "integrity": "sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA==" }, + "node_modules/leaflet-control-geocoder": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/leaflet-control-geocoder/-/leaflet-control-geocoder-2.4.0.tgz", + "integrity": "sha512-b2QlxuFd40uIDbnoUI3U9fzfnB4yKUYlmsXjquJ2d2YjoJqnyVYcIJeErAVv3kPvX3nI0gzvBq1XHMgSVFrGkQ==", + "optionalDependencies": { + "open-location-code": "^1.0.0" + }, + "peerDependencies": { + "leaflet": "^1.6.0" + } + }, + "node_modules/leaflet-geosearch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/leaflet-geosearch/-/leaflet-geosearch-4.0.0.tgz", + "integrity": "sha512-a92VNY9gxyv3oyEDqIWoCNoBllajWRYejztzOSNmpLRtzpA6JtGgy/wwl9tsB8+6Eek1fe+L6+W0MDEOaidbXA==", + "optionalDependencies": { + "@googlemaps/js-api-loader": "^1.16.6", + "leaflet": "^1.6.0" + } + }, + "node_modules/leaflet-routing-machine": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/leaflet-routing-machine/-/leaflet-routing-machine-3.2.12.tgz", + "integrity": "sha512-HLde58G1YtD9xSIzZavJ6BPABZaV1hHeGst8ouhzuxmSC3s32NVtADT+njbIUMW1maHRCrsgTk/E4hz5QH7FrA==", + "dependencies": { + "@mapbox/corslite": "0.0.7", + "@mapbox/polyline": "^0.2.0", + "osrm-text-instructions": "^0.13.2" + } + }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -8164,7 +8231,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "darwin" @@ -8184,7 +8250,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "darwin" @@ -8204,7 +8269,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "freebsd" @@ -8224,7 +8288,6 @@ "cpu": [ "arm" ], - "dev": true, "optional": true, "os": [ "linux" @@ -8244,7 +8307,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -8264,7 +8326,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -8284,7 +8345,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -8304,7 +8364,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -8324,7 +8383,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "win32" @@ -10006,6 +10064,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/open-location-code": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/open-location-code/-/open-location-code-1.0.3.tgz", + "integrity": "sha512-DBm14BSn40Ee241n80zIFXIT6+y8Tb0I+jTdosLJ8Sidvr2qONvymwqymVbHV2nS+1gkDZ5eTNpnOIVV0Kn2fw==", + "optional": true + }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", @@ -10056,6 +10120,11 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/osrm-text-instructions": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/osrm-text-instructions/-/osrm-text-instructions-0.13.4.tgz", + "integrity": "sha512-ge4ZTIetMQKAHKq2MwWf83ntzdJN20ndRKRaVNoZ3SkDkBNO99Qddz7r6+hrVx38I+ih6Rk5T1yslczAB6Q9Pg==" + }, "node_modules/p-limit": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", @@ -10899,8 +10968,7 @@ "node_modules/regenerator-runtime": { "version": "0.14.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", - "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", - "dev": true + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" }, "node_modules/regexp.prototype.flags": { "version": "1.5.2", @@ -12272,7 +12340,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-2.3.0.tgz", "integrity": "sha512-vkYrLpIP+lgR0tQCG6AP7zZXCTLc1Lnv/CCRT3BqJ9CZ3ui2++GPaGb1x/ILsINIMSYqqvrpqjUFsMNLlW99EA==", - "dev": true, "dependencies": { "@babel/runtime": "^7.24.1" }, diff --git a/front/package.json b/front/package.json index 4e12158..8d8b423 100644 --- a/front/package.json +++ b/front/package.json @@ -16,37 +16,32 @@ }, "dependencies": { "@astrojs/node": "^8.2.5", + "@astrojs/rss": "^4.0.5", + "@astrojs/sitemap": "^3.1.4", "@astrojs/tailwind": "^5.1.0", + "@astrolib/analytics": "^0.5.0", + "@astrolib/seo": "^1.0.0-beta.5", + "@fontsource-variable/inter": "^5.0.18", "@tailwindcss/typography": "^0.5.12", + "astro": "^4.8.3", + "astro-embed": "^0.7.2", + "astro-icon": "^1.1.0", "leaflet": "^1.9.4", + "leaflet-control-geocoder": "^2.4.0", + "leaflet-geosearch": "^4.0.0", + "leaflet-routing-machine": "^3.2.12", + "limax": "4.1.0", + "lodash.merge": "^4.6.2", "lucide-astro": "^0.372.0", "pocketbase": "^0.21.1", "react-leaflet": "^4.2.1", "simple-icons-astro": "^11.12.0", + "tailwind-merge": "^2.3.0", "tailwindcss": "^3.4.3", - "@astrojs/rss": "^4.0.5", - "@astrojs/sitemap": "^3.1.4", - "@astrolib/analytics": "^0.5.0", - "@astrolib/seo": "^1.0.0-beta.5", - "@fontsource-variable/inter": "^5.0.18", - "astro": "^4.8.3", - "astro-embed": "^0.7.2", - "astro-icon": "^1.1.0", - "limax": "4.1.0", - "lodash.merge": "^4.6.2", "unpic": "^3.18.0" }, "devDependencies": { "@astrojs/check": "^0", - "@types/leaflet": "^1.9.12", - "@types/node": "^20", - "@typescript-eslint/eslint-plugin": "^6.21.0", - "@typescript-eslint/parser": "^6.21.0", - "@vitest/coverage-v8": "^1", - "eslint": "^8.57.0", - "eslint-plugin-astro": "^0.31.4", - "typescript": "^5", - "vitest": "^1", "@astrojs/mdx": "^3.0.0", "@astrojs/partytown": "^2.1.0", "@astrojs/tailwind": "5.1.0", @@ -57,8 +52,16 @@ "@tailwindcss/typography": "^0.5.13", "@types/eslint__js": "^8.42.3", "@types/js-yaml": "^4.0.9", + "@types/leaflet": "^1.9.12", + "@types/leaflet-routing-machine": "^3.2.8", "@types/lodash.merge": "^4.6.9", + "@types/node": "^20", + "@typescript-eslint/eslint-plugin": "^6.21.0", + "@typescript-eslint/parser": "^6.21.0", + "@vitest/coverage-v8": "^1", "astro-eslint-parser": "^1.0.2", + "eslint": "^8.57.0", + "eslint-plugin-astro": "^0.31.4", "eslint-plugin-jsx-a11y": "^6.8.0", "globals": "^15.2.0", "js-yaml": "^4.1.0", @@ -68,8 +71,9 @@ "reading-time": "^1.5.0", "rehype-plugin-image-native-lazy-loading": "^1.2.0", "sharp": "0.33.3", - "tailwind-merge": "^2.3.0", "tailwindcss": "^3.4.3", - "typescript-eslint": "^7.9.0" + "typescript": "^5", + "typescript-eslint": "^7.9.0", + "vitest": "^1" } } diff --git a/front/src/components/CheckBox.astro b/front/src/components/CheckBox.astro new file mode 100644 index 0000000..8c89de6 --- /dev/null +++ b/front/src/components/CheckBox.astro @@ -0,0 +1,30 @@ +--- +import type { Input as Props } from 'types'; + +const {value, checked ,name, label, autocomplete, placeholder, divClass, inputClass} = Astro.props; + +--- + +<> + { + name && ( +
+ + {label && ( + + )} +
+ ) + } + diff --git a/front/src/components/Input.astro b/front/src/components/Input.astro new file mode 100644 index 0000000..a565dd4 --- /dev/null +++ b/front/src/components/Input.astro @@ -0,0 +1,28 @@ +--- +import type { Input as Props } from 'types'; + +const { type, name, label, autocomplete, placeholder, divClass, inputClass} = Astro.props; + +--- + +<> + { + name && ( +
+ {label && ( + + )} + +
+ ) + } + diff --git a/front/src/components/Radios.astro b/front/src/components/Radios.astro new file mode 100644 index 0000000..781f90a --- /dev/null +++ b/front/src/components/Radios.astro @@ -0,0 +1,19 @@ +--- + +export interface Props { + values: Array<{label:String, name:string, checked?:boolean | undefined}> +} + + +const fields = Astro.props.values + +--- + +<> +
+ {fields.map(value => ( + +
+ ))} +
+ diff --git a/front/src/components/widgets/Footer.astro b/front/src/components/widgets/Footer.astro index fa91dd0..a599610 100644 --- a/front/src/components/widgets/Footer.astro +++ b/front/src/components/widgets/Footer.astro @@ -26,7 +26,7 @@ export interface Props { const { socialLinks = [], secondaryLinks = [], links = [], footNote = '', theme = 'light' } = Astro.props; --- -