feat: gestion-utilisateur #14

Closed
Clement wants to merge 38 commits from feat/gestion-utilisateur into master
19 changed files with 1233 additions and 92 deletions
Showing only changes of commit eed351df0a - Show all commits

53
.github/workflows/build_docker.yml vendored Normal file
View File

@ -0,0 +1,53 @@
name: Build Docker Image # nom du workflow
on: #declancheur
push:
branches:
- '*'
tags:
- v*
pull_request:
branches:
- master
jobs:
run: #jobs ID (nom du jobs)
runs-on: ubuntu-latest # environement de run
steps: # liste des étapes
- name: Checkout # rapatrie le depot
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
git.lab-ouest.org/Epitech/ratrapage_T-WEB_front
tags: |
type=edge
type=ref,event=pr
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=semver,pattern=latest
- name: Login to Gitea
uses: docker/login-action@v3
with:
registry: git.lab-ouest.org
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
- name: Build and push front
uses: docker/build-push-action@v5
with:
context: ./front
push: true
file: ./front/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "datatourisme"]
path = datatourisme
url = https://git.lab-ouest.org/Epitech/fork-open-data-tourism

View File

@ -1 +1,4 @@
Original repo : https://git.lab-ouest.org/Epitech/ratrapage_T-WEB
Submodule repo : https://git.lab-ouest.org/Epitech/fork-open-data-tourism/

View File

@ -0,0 +1,5 @@
{
"version": "1",
"name": "OpenData datatourisme",
"type": "collection"
}

View File

@ -0,0 +1,3 @@
vars:secret [
app_key
]

View File

@ -0,0 +1,11 @@
meta {
name: test opendata
type: http
seq: 1
}
get {
url: https://diffuseur.datatourisme.fr/webservice/adb00e7893763e3196afe9a3da1c9e41/{{app_key}}
body: none
auth: none
}

View File

@ -0,0 +1,15 @@
meta {
name: test pays de la loire
type: graphql
seq: 2
}
post {
url: http://localhost:8080
body: graphql
auth: none
}
body:graphql {
{poi() {results{dc_identifier rdfs_label}}}
}

1
datatourisme Submodule

@ -0,0 +1 @@
Subproject commit 5175e1fdf116eb7c370b629ff96aee7b308d250f

View File

@ -8,3 +8,22 @@ services:
- ./.pb/pocketbase-hooks:/app/pb_hooks
ports:
- 3001:8080
blazegraph:
image: conjecto/blazegraph:2.1.5
ports:
- 9999:9999
environment:
JAVA_OPTS: "-Xms6G -Xmx6G"
volumes:
- ./datatourisme/dataset:/docker-entrypoint-initdb.d
ulimits:
nofile:
soft: 65536
hard: 65536
datatourisme:
build: datatourisme/docker
ports:
- "8080:80"
depends_on:
- blazegraph

34
docker-compose.yml Normal file
View File

@ -0,0 +1,34 @@
version: "3.8"
services:
pocketbase:
image: ghcr.io/coollabsio/pocketbase:latest
environment:
- SERVICE_FQDN_POCKETBASE_8080
volumes:
- ./.pb/pocketbase-data:/app/pb_data
- ./.pb/pocketbase-hooks:/app/pb_hooks
labels:
- traefik.enable=true
- traefik.http.routers.poketBaseTweb.rule=Host(`${POCKET_BASE_URL}`)
- traefik.http.services.poketBaseTweb.loadbalancer.server.port=${POCKET_BASE_PORT}
- traefik.http.routers.poketBaseTweb.tls.certresolver=le
networks:
- public
front:
image: git.lab-ouest.org/epitech/ratrapage_t-web_front:pr-7-head
depends_on:
- pocketbase
labels:
- traefik.enable=true
- traefik.http.routers.astroTweb.rule=Host(`${FRONT_URL}`)
- traefik.http.services.astroTweb.loadbalancer.server.port=${FRONT_BASE_PORT}
- traefik.http.routers.astroTweb.tls.certresolver=le
networks:
- public
networks:
public:
external: true
x-dockge:
urls:
- https://${POCKET_BASE_URL}/
- https://${FRONT_URL}/

64
front/Dockerfile Normal file
View File

@ -0,0 +1,64 @@
# This Dockerfile allows you to run AstroJS in server mode
#########
# Build #
#########
FROM docker.io/node:20-alpine as BUILD_IMAGE
# Disable telemetry
ENV ASTRO_TELEMETRY_DISABLED=1
# External deps (for node-gyp add: "python3 make g++")
RUN apk add --no-cache git
# run as non root user
USER node
# go to user repository
WORKDIR /home/node
# Add package json
ADD --chown=node:node package.json package-lock.json ./
# install dependencies from package lock
RUN npm ci
# Add project files
ADD --chown=node:node . .
# build
RUN npm run build
# remove dev deps
RUN npm prune --omit=dev
##############
# Production #
##############
FROM docker.io/node:20-alpine as PROD_IMAGE
# inform software to be in production
ENV NODE_ENV=production
ENV HOST=0.0.0.0
ENV RESOURCES_FOLDER=/home/node/.loop/uploads
ENV ASTRO_TELEMETRY_DISABLED=1
# run as non root user
USER node
# go to work folder
WORKDIR /home/node
# Expose port
EXPOSE 3000
# Add Healthcheck
HEALTHCHECK --interval=10s --timeout=10s --start-period=5s --retries=3 CMD wget --no-verbose --tries=1 --spider http://localhost:3000 || exit 1
# copy from build image
COPY --chown=node:node --from=BUILD_IMAGE /home/node/node_modules ./node_modules
COPY --chown=node:node --from=BUILD_IMAGE /home/node/dist ./dist
COPY --chown=node:node --from=BUILD_IMAGE /home/node/package.json /home/node/.env* ./
# run it !
CMD ["npm", "run", "start"]

View File

@ -1,5 +1,8 @@
import { defineConfig } from 'astro/config';
import node from '@astrojs/node';
import tailwind from "@astrojs/tailwind";
import react from "@astrojs/react";
// https://astro.build/config
export default defineConfig({
@ -18,4 +21,10 @@ export default defineConfig({
adapter: node({
mode: 'standalone'
}),
integrations: [tailwind(), react()],
vite: {
optimizeDeps: {
include: ['leaflet']
}
}
});

999
front/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -3,32 +3,42 @@
"type": "module",
"version": "0.0.1",
"private": "true",
"private": "true",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"start": "node ./dist/server/entry.mjs",
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro"
"astro": "astro",
"check:lint": "eslint src"
},
"dependencies": {
"@astrojs/node": "^8.2.5",
"@astrojs/react": "^3.3.1",
"@astrojs/tailwind": "^5.1.0",
"@tailwindcss/typography": "^0.5.12",
"astro": "^4.6.3",
"@types/react": "^18.2.79",
"@types/react-dom": "^18.2.25",
"astro": "4.5.12",
"leaflet": "^1.9.4",
"lucide-astro": "^0.372.0",
"pocketbase": "^0.21.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-leaflet": "^4.2.1",
"simple-icons-astro": "^11.12.0",
"tailwindcss": "^3.4.3",
"typescript": "^5.2.2"
},
"devDependencies": {
"@astrojs/check": "^0",
"@types/leaflet": "^1.9.12",
"@types/node": "^20",
"@typescript-eslint/eslint-plugin": "^6",
"@typescript-eslint/parser": "^6",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@vitest/coverage-v8": "^1",
"eslint": "^8",
"eslint-plugin-astro": "^0.31",
"eslint": "^8.57.0",
"eslint-plugin-astro": "^0.31.4",
"typescript": "^5",
"vitest": "^1"
}

View File

@ -0,0 +1,12 @@
//référence a loop
//fonction get user pour récupéré un utilisateur (notament coté client)
//sessionID = JWS
//fonction set user crée un cookies de session
//passé le cookies astro dans les paramètre
//utiliser cookie.set pour crée un nouveau cookies

View File

@ -1,6 +1,6 @@
---
import Layout from '../layouts/Layout.astro';
import Card from '../components/Card.astro';
import Layout from 'layouts/Layout.astro';
import Card from 'components/Card.astro';
---
<Layout title="Welcome to Astro.">

View File

@ -0,0 +1,17 @@
---
import Layout from 'layouts/Layout.astro';
import { Marker, Popup } from 'leaflet';
import { MapContainer } from 'react-leaflet'
---
<Layout title="maps test">
<MapContainer client:load center={[51.505, -0.09]} zoom={13} scrollWheelZoom={false}>
<Marker client:load lat={51.505} lng={-0.09}>
<Popup client:load>
A pretty CSS3 popup. <br /> Easily customizable.
</Popup>
</Marker>
</MapContainer>
</Layout>

View File

@ -0,0 +1,8 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'],
theme: {
extend: {},
},
plugins: [],
}

View File

@ -1,3 +1,8 @@
{
"extends": "astro/tsconfigs/strict"
"extends": "astro/tsconfigs/strict",
"compilerOptions": {
"baseUrl": "src",
// hide an issue with typescript
"noUnusedLocals": false
},
}