Skip to content

Commit

Permalink
Merge pull request #4 from Code4GovTech/kanav/cleanup
Browse files Browse the repository at this point in the history
Credentials V2
  • Loading branch information
KDwevedi authored Dec 18, 2024
2 parents 5f6b703 + f8a2406 commit 08e3513
Show file tree
Hide file tree
Showing 95 changed files with 1,286 additions and 7,460 deletions.
26 changes: 26 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Schema Service
SCHEMA_BASE_URL=https://example.com/schema-service

# Credential Service
CREDENTIAL_BASE_URL=https://example.com/credential-service
C4GT_DID=did:example:123456789abcdefghi
DEFAULT_CERTIFICATE_LIFETIME=31536000

# Identity Service
IDENTITY_BASE_URL=url

# Certificates Verification
VERIFICATION_BASE_URL=https://example.com/verification-service

# MinIO Configuration
MINIO_USERNAME=your-minio-username
MINIO_PASSWORD=your-minio-password
MINIO_BUCKETNAME=your-bucket-name
MINIO_PORT=9000
MINIO_ENDPOINT=minioadminpassword
MINIO_SECRET_KEY=your-minio-secret-key
MINIO_ACCESS_KEY=minioadmin
MINIO_USE_SSL=true

# DB Config
C4GT_BFF_POSTGRES_BASE_URL=postgresql://postgres:password@localhost:5432/c4gtbff?schema=public
13 changes: 11 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir : __dirname,
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
plugins: ['@typescript-eslint/eslint-plugin', 'prettier'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
Expand All @@ -21,5 +21,14 @@ module.exports = {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'prettier/prettier': [
'error',
{
singleQuote: true,
trailingComma: 'all',
printWidth: 80,
arrowParens: 'always',
},
],
},
};
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# data
*.csv
# compiled output
/dist
/node_modules
Expand Down
5 changes: 3 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"singleQuote": true,
"trailingComma": "all"
}
"trailingComma": "all",
"printWidth": 120
}
39 changes: 30 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,39 @@
FROM node:16
# FROM --platform=linux/amd64 node:18-slim
# Stage 1: Build
FROM --platform=linux/amd64 node:18 AS builder

WORKDIR /app

# Install dependencies and build the application
COPY package.json ./
COPY yarn.lock ./
COPY prisma ./prisma/

RUN yarn
COPY . .
RUN yarn run build

# Stage 2: Runtime
FROM --platform=linux/amd64 node:18 AS runtime

WORKDIR /app

# Install required runtime dependencies
RUN apt-get update \
&& apt-get install -y wget gnupg \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \
&& apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 ghostscript \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get install ghostscript=10.02.0
&& rm -rf /var/lib/apt/lists/*

# Copy necessary files from the builder stage
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./
COPY --from=builder /app/yarn.lock ./
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/tsconfig.json ./

WORKDIR /app
COPY . ./
RUN yarn
EXPOSE 3001
CMD ["yarn", "start"]
CMD ["yarn", "start:prod"]
244 changes: 0 additions & 244 deletions badge-certificate.html

This file was deleted.

4 changes: 0 additions & 4 deletions data/sample.csv

This file was deleted.

Loading

0 comments on commit 08e3513

Please sign in to comment.