Skip to content

Commit

Permalink
refactor: rename overige-object-api to overige-objecten-api
Browse files Browse the repository at this point in the history
  • Loading branch information
AliKdhim87 authored and Robbert committed Oct 25, 2024
1 parent aac3938 commit aea8d46
Show file tree
Hide file tree
Showing 46 changed files with 44 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .changeset/khaki-bobcats-join.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@frameless/overige-object-api": major
"@frameless/overige-objecten-api": major
---

Create Overige Objecten API applicatie
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ gql
**/yarn-error.log
**/.strapi-updater.json
**/generated
apps/overige-object-api/src/types
apps/overige-objecten-api/src/types
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: [
'./apps/overige-object-api/tsconfig.json',
'./apps/overige-object-api/tsconfig.test.json',
'./apps/overige-objecten-api/tsconfig.json',
'./apps/overige-objecten-api/tsconfig.test.json',
'./apps/kennisbank-dashboard/src/admin/tsconfig.json',
'./apps/kennisbank-dashboard/tsconfig.json',
'./apps/kennisbank-frontend/tsconfig.json',
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,6 @@ dist/
**/**/public/*.txt

############################
# overige-object-api
# overige-objecten-api
############################
apps/overige-object-api/src/types
apps/overige-objecten-api/src/types
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ yarn.lock
.strapi-updater.json
generated
gql
apps/overige-object-api/src/types
apps/overige-objecten-api/src/types
4 changes: 2 additions & 2 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ COPY ./apps/pdc-sc/package.json apps/pdc-sc/package.json
COPY ./apps/vth-dashboard/package.json apps/vth-dashboard/package.json
COPY ./apps/vth-frontend/package.json apps/vth-frontend/package.json
COPY ./apps/kennisbank-dashboard/package.json apps/kennisbank-dashboard/package.json
COPY ./apps/overige-object-api/package.json apps/overige-object-api/package.json
COPY ./apps/overige-objecten-api/package.json apps/overige-objecten-api/package.json
COPY ./apps/kennisbank-frontend/package.json apps/kennisbank-frontend/package.json
COPY ./packages/catalogi-data/package.json packages/catalogi-data/package.json
COPY ./packages/preview-button/package.json packages/preview-button/package.json
Expand Down Expand Up @@ -55,7 +55,7 @@ RUN npm run build --workspace @frameless/upl && \
npm run build --workspace @frameless/strapi-plugin-uuid-field && \
npm run build --workspace @frameless/strapi-plugin-env-label && \
npm run build --workspace @frameless/strapi-plugin-language && \
npm run build --workspace @frameless/overige-object-api
npm run build --workspace @frameless/overige-objecten-api

# Build target production #
###########################
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# overige-object-api
# overige-objecten-api

The **overige-object-api** is a microservice built with Node.js that maps certain PDC product fields to the **kennisartikel** and **VAC** fields.
The **overige-objecten-api** is a microservice built with Node.js that maps certain PDC product fields to the **kennisartikel** and **VAC** fields.

## Features

Expand Down Expand Up @@ -31,8 +31,8 @@ Authorization: Bearer API_TOKEN
Ensure that you have the following environment variables in the `.pdc.prod.env` file before starting:

```shell
OVERIGE_OBJECT_API_PORT=4001
OVERIGE_OBJECT_API_CORS=http://localhost:3000 # If using multiple domains, separate them with a comma (e.g., 'http://localhost:3000, http://localhost:3001').
OVERIGE_OBJECTEN_API_PORT=4001
OVERIGE_OBJECTEN_API_CORS=http://localhost:3000 # If using multiple domains, separate them with a comma (e.g., 'http://localhost:3000, http://localhost:3001').
```

To start the service, open a terminal in the project root and run:
Expand All @@ -43,12 +43,12 @@ cd bin && bash ./deploy.sh pdc-dashboard prod up --build

### 2. Start without Docker

Create an .env file in the apps/overige-object-api directory with the following environment variables:
Create an .env file in the apps/overige-objecten-api directory with the following environment variables:

```shell
STRAPI_PRIVATE_URL=http://127.0.0.1:1337/
OVERIGE_OBJECT_API_PORT=4001
OVERIGE_OBJECT_API_CORS='' # Required for client-side application
OVERIGE_OBJECTEN_API_PORT=4001
OVERIGE_OBJECTEN_API_CORS='' # Required for client-side application
```

Then, follow these steps:
Expand All @@ -67,10 +67,10 @@ Then, follow these steps:
```

3. Start the overige-object-api server:
3. Start the overige-objecten-api server:

```shell
yarn workspace @frameless/overige-object-api dev
yarn workspace @frameless/overige-objecten-api dev
```

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@frameless/overige-object-api",
"name": "@frameless/overige-objecten-api",
"version": "0.0.0",
"private": true,
"author": "@frameless",
"description": "Overige Object API for PDC",
"description": "Overige Objecten API for PDC",
"license": "EUPL-1.2",
"keywords": [],
"scripts": {
Expand All @@ -16,8 +16,8 @@
"dev": "NODE_ENV=development nodemon src/server.ts",
"clean": "rimraf dist src/types",
"generate-types": "openapi-typescript src/docs/openapi.yaml --output src/types/openapi.ts",
"test": "OVERIGE_OBJECT_API_PORT=3000 jest --coverage --forceExit --verbose",
"test:watch": "OVERIGE_OBJECT_API_PORT=3000 jest --watch"
"test": "OVERIGE_OBJECTEN_API_PORT=3000 jest --coverage --forceExit --verbose",
"test:watch": "OVERIGE_OBJECTEN_API_PORT=3000 jest --watch"
},
"dependencies": {
"cors": "2.8.5",
Expand Down Expand Up @@ -46,6 +46,6 @@
"repository": {
"type": "git+ssh",
"url": "[email protected]:frameless/strapi.git",
"directory": "apps/overige-object-api"
"directory": "apps/overige-objecten-api"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
openapi: "3.0.0"
info:
title: Overige Object API
description: API to manage Overige Object resources
title: Overige Objecten API
description: API to manage Overige Objecten resources
version: 1.0.0
servers:
- url: http://localhost:4001/api/v1
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ interface OpenApiValidationErrorTypes {
// Validate environment variables
envAvailability({
env: process.env,
keys: ['STRAPI_PRIVATE_URL', 'OVERIGE_OBJECT_API_PORT'],
keys: ['STRAPI_PRIVATE_URL', 'OVERIGE_OBJECTEN_API_PORT'],
});

const swaggerDocument: any = yaml.load(fs.readFileSync(path.join(__dirname, './docs/openapi.yaml'), 'utf8'));
const whitelist = process.env.OVERIGE_OBJECT_API_CORS?.split(', ') || [];
const whitelist = process.env.OVERIGE_OBJECTEN_API_CORS?.split(', ') || [];
const corsOption: CorsOptions = {
origin: (origin, callback) => {
if (!origin || whitelist.indexOf(origin) !== -1) {
Expand All @@ -48,7 +48,7 @@ const apiSpec = path.join(__dirname, './docs/openapi.yaml');
const app = express();
app.use(express.json());

const port = process.env.OVERIGE_OBJECT_API_PORT;
const port = process.env.OVERIGE_OBJECTEN_API_PORT;
// Centralized error handler middleware
const globalErrorHandler = (err: ErrorHandler, _req: Request, res: Response, _next: NextFunction) => {
if (err instanceof ErrorHandler || (err as ErrorHandler)?.isOperational) {
Expand Down Expand Up @@ -127,7 +127,7 @@ app.use(globalErrorHandler);
if (process.env.NODE_ENV !== 'test') {
app.listen(port, () => {
// eslint-disable-next-line no-console
console.log(`Overige Object app listening on port ${port}!`);
console.log(`Overige Objecten app listening on port ${port}!`);
});
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 7 additions & 6 deletions docker-compose.pdc.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,19 @@ services:
depends_on:
- pdc_strapi
- pdc_strapi_db
overige-object-api:
container_name: overige-object-api
overige-objecten-api:
container_name: overige-objecten-api
build:
context: .
dockerfile: Dockerfile.dev
restart: unless-stopped
command: yarn workspace @frameless/overige-object-api start
volumes:
- ./apps/overige-objecten-api/src/docs:/opt/app/apps/overige-objecten-api/dist/src/docs
command: yarn workspace @frameless/overige-objecten-api start
environment:
STRAPI_PRIVATE_URL: ${STRAPI_PRIVATE_URL}
FRONTEND_PUBLIC_URL: ${FRONTEND_PUBLIC_URL}
OVERIGE_OBJECT_API_PORT: ${OVERIGE_OBJECT_API_PORT}
OVERIGE_OBJECT_API_CORS: ${OVERIGE_OBJECT_API_CORS}
OVERIGE_OBJECTEN_API_PORT: ${OVERIGE_OBJECTEN_API_PORT}
OVERIGE_OBJECTEN_API_CORS: ${OVERIGE_OBJECTEN_API_CORS}
ports:
- "4001:4001"
networks:
Expand Down
13 changes: 7 additions & 6 deletions docker-compose.pdc.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,19 @@ services:
depends_on:
- pdc_strapi
- pdc_strapi_db
overige-object-api:
container_name: overige-object-api
overige-objecten-api:
container_name: overige-objecten-api
build:
context: .
dockerfile: Dockerfile.prod
restart: unless-stopped
command: yarn start:overige-object-api
volumes:
- ./apps/overige-objecten-api/src/docs:/opt/app/apps/overige-objecten-api/dist/src/docs
command: yarn start:overige-objecten-api
environment:
STRAPI_PRIVATE_URL: ${STRAPI_PRIVATE_URL}
FRONTEND_PUBLIC_URL: ${FRONTEND_PUBLIC_URL}
OVERIGE_OBJECT_API_PORT: ${OVERIGE_OBJECT_API_PORT}
OVERIGE_OBJECT_API_CORS: ${OVERIGE_OBJECT_API_CORS}
OVERIGE_OBJECTEN_API_PORT: ${OVERIGE_OBJECTEN_API_PORT}
OVERIGE_OBJECTEN_API_CORS: ${OVERIGE_OBJECTEN_API_CORS}
ports:
- "4001:4001"
networks:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"start:kennisbank-frontend": "npm run --workspace @frameless/kennisbank-frontend start",
"start:kennisbank-dashboard": "npm run --workspace @frameless/kennisbank-dashboard start",
"start:pdc-sc": "npm run --workspace @frameless/pdc-sc start",
"start:overige-object-api": "yarn workspace @frameless/overige-object-api start",
"start:overige-objecten-api": "yarn workspace @frameless/overige-objecten-api start",
"build": "npm run --workspaces build --if-present",
"build:frontend": "npm run build --workspace @frameless/${APP}",
"build:strapi": "npm run build --workspace @frameless/${APP}",
Expand Down

0 comments on commit aea8d46

Please sign in to comment.