Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 43 consider directus #44

Merged
merged 30 commits into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f6ba22b
feat: integrate directus in docker compose
Thechi2000 Feb 8, 2024
70283b3
feat: add directus working example
Thechi2000 Feb 8, 2024
3de5b69
feat: add directus type generation
Thechi2000 Feb 9, 2024
447467d
feat: specify data model for directus
Thechi2000 Feb 12, 2024
5476b08
refactor: cleanup save-directus
Thechi2000 Feb 12, 2024
6719932
refactor: remove strapi
Thechi2000 Feb 12, 2024
512dea1
feat: create directus data model
Thechi2000 Feb 15, 2024
e79e5d2
feat: add sample data for directus
Thechi2000 Feb 15, 2024
ce9ab86
fix: schema.d.ts generation
Thechi2000 Feb 15, 2024
0cec188
feat: improve data model
Thechi2000 Feb 15, 2024
567911f
fix: badly generated types
Feb 19, 2024
bd92c6f
feat: add type aliases for data model
Feb 19, 2024
e4f6246
feat: add util function for translation fetching
Feb 19, 2024
505acd3
feat: move banner to translated content for news
Feb 19, 2024
9137ebb
fix: hardfix for singleton type generation
Feb 19, 2024
c9421fb
refactor: update queryTranslations
Feb 19, 2024
d93d864
refactor: replace Strapi with Directus in API calls
Feb 19, 2024
086289e
feat: refractor website for directus use
NoeTerrier Feb 20, 2024
3bd941b
feat: refractor website for directus use
NoeTerrier Feb 20, 2024
0b9f221
feat: refractor website for directus use
NoeTerrier Feb 20, 2024
03da585
Merge branch '32-add-react-components' of github.com:clicepfl/clic-we…
NoeTerrier Feb 20, 2024
5154f7a
fix: refractor News function name to NewsComponent
NoeTerrier Feb 20, 2024
7f4a81d
fix: fix image displaying with directus
NoeTerrier Feb 20, 2024
44d3e9a
fix: fix image displaying with directus
NoeTerrier Feb 20, 2024
90a8c2c
refactor: remove strapi
Thechi2000 Feb 20, 2024
d7b440e
fix: image style & typing
Thechi2000 Feb 20, 2024
610367f
fix: add images to Card component
NoeTerrier Feb 20, 2024
6b03690
fix: fix news banner
NoeTerrier Feb 20, 2024
ee37512
feat: remove strapi entirely
NoeTerrier Feb 22, 2024
32a7d6e
feat: remove strapi entirely
NoeTerrier Feb 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 31 additions & 32 deletions .devcontainer/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,40 @@
name: clic-website-devcontainer

services:
# Custom strapi service
strapi:
# Build the strapi service from its folder
container_name: clic-strapi
build:
# Build context, relative to the current file
context: ../strapi/.devcontainer
# Path to Dockerfile, relative to context
dockerfile: Dockerfile
args:
VARIANT: ${VARIANT:-18-bullseye}
# Directus service
directus:
image: directus/directus
container_name: clic-directus
environment:
DATABASE_CLIENT: postgres
DATABASE_HOST: strapi-postgres
DATABASE_PORT: 5432
DATABASE_NAME: strapi_data
DATABASE_USER: strapi_user
DATABASE_PASSWORD: strapi_pw
NODE_ENV: development
volumes:
# Bind-mount the strapi project folder into the container
- type: bind
source: ../strapi
target: /app
SECRET: secret
KEY: key
DB_CLIENT: postgres
DB_HOST: directus-postgres
DB_PORT: 5432
DB_DATABASE: directus_data
DB_USER: directus_user
DB_PASSWORD: directus_pw
PUBLIC_URL: http://localhost/directus
ROOT_REDIRECT: /directus/admin
ADMIN_EMAIL: clic@epfl.ch
ADMIN_PASSWORD: 1234
depends_on:
- strapi-postgres
- directus-postgres
volumes:
- ../directus:/share
- directus-uploads:/directus/uploads
- directus-extensions:/directus-extensions

# Database service for strapi
strapi-postgres:
# Database for directus
directus-postgres:
container_name: clic-postgres
image: postgres
environment:
POSTGRES_DB: strapi_data
POSTGRES_USER: strapi_user
POSTGRES_PASSWORD: strapi_pw
POSTGRES_DB: directus_data
POSTGRES_USER: directus_user
POSTGRES_PASSWORD: directus_pw
volumes:
- "strapi-data:/var/lib/postgresql/data"
- "directus-data:/var/lib/postgresql/data"

app:
# Build the app service from its folder
Expand All @@ -67,5 +64,7 @@ services:
- "80:80"

volumes:
# Persist strapi database
strapi-data:
# Persist directus database
directus-data:
directus-uploads:
directus-extensions:
5 changes: 1 addition & 4 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ env:

jobs:
build:
strategy:
matrix:
directory: [strapi, app]
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -77,7 +74,7 @@ jobs:
id: build-and-push
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
with:
context: ${{ matrix.directory }}
context: app
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
node_modules/
oas.json
3 changes: 1 addition & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@

app/.next

strapi/.strapi-updater.json
strapi/src/api
oas.json
12 changes: 6 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
},
"todohighlight.keywordsPattern": "(todo|TODO|fixme|FIXME)(:?)",
"terminal.integrated.profiles.linux": {
"strapi": {
"directus": {
"path": "docker",
"args": ["exec", "-it", "clic-strapi", "/bin/bash"],
"args": ["exec", "-it", "clic-directus", "/bin/bash"],
"overrideName": true
},
"postgres": {
Expand All @@ -35,9 +35,9 @@
}
},
"terminal.integrated.profiles.windows": {
"strapi": {
"directus": {
"path": "docker",
"args": ["exec", "-it", "clic-strapi", "/bin/bash"],
"args": ["exec", "-it", "clic-directus", "/bin/bash"],
"overrideName": true
},
"postgres": {
Expand All @@ -52,9 +52,9 @@
}
},
"terminal.integrated.profiles.osx": {
"strapi": {
"directus": {
"path": "docker",
"args": ["exec", "-it", "clic-strapi", "/bin/bash"],
"args": ["exec", "-it", "clic-directus", "/bin/bash"],
"overrideName": true
},
"postgres": {
Expand Down
1 change: 0 additions & 1 deletion app/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// strapi service devcontainer
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.238.0/containers/typescript-node
{
Expand Down
4 changes: 3 additions & 1 deletion app/.env.example
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
STRAPI_TOKEN=1234
DIRECTUS_URL=http://localhost/directus
NEXT_PUBLIC_DIRECTUS_URL=http://localhost/directus
DIRECTUS_TOKEN=1234
4 changes: 1 addition & 3 deletions app/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const path = require("path");

const nextConfig = {
module.exports = {
reactStrictMode: true,
sassOptions: {
includePaths: [path.join(__dirname, "styles")],
Expand Down Expand Up @@ -39,5 +39,3 @@ const nextConfig = {
defaultLocale: "en",
},
};

module.exports = nextConfig;
Loading
Loading