Skip to content

Commit

Permalink
Project init
Browse files Browse the repository at this point in the history
  • Loading branch information
surajshell committed Aug 14, 2024
0 parents commit 96134a1
Show file tree
Hide file tree
Showing 731 changed files with 89,765 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.git
node_modules
marketing
61 changes: 61 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Ask someone in the team to share the file with you for any secrets you might need -- if not possible secrets for different environments can be found in Azure Key Vault for APP projects.
WEB_APP_BASE_URL=

export DBHOST=
export DBNAME=
export DBUSER=
export DBPASS=
export SENTRY_DSN=

AKAMAI_CLIENT_ID=
AKAMAI_BASE_URL=

CURRENT_ABCD_USER=

XYZ_EMAIL_ADDRESS=

MULESOFT_API_URL=
MULESOFT_CLIENT_ID=
MULESOFT_CLIENT_SECRET=

REDIS_HOST=
REDIS_PORT=
REDIS_PASSWORD=

AZURE_STORAGE_CONNECTION_STRING=

LOG_LEVEL=


DNB_API_KEY=
DNB_API_SECRET=
DNB_AUTH_URL=
DNB_TYPEAHEAD_URL=

INVITE_JWT_SECRET=
TRIBE_JWT_SECRET=
JWT_ISSUER=

# Application Configuration -- for dev usage
SKIP_MIGRATIONS=
INTEGRATION_TEST_DROP_SCHEMA=
DETAILED_REQUEST_LOGGING_ENABLED=
WRITE_LOGS_TO_FILE=
SILENCE_SLACK=
LOG_SUBSCRIBER_REGISTRATION=

AUTH_CLIENT_ID=
AUTH_CLIENT_SECRET=
AUTH_TOKEN_API=

HUBSPOT_EMAIL_TOKEN=
HUBSPOT_CRM_TOKEN=

NEW_RELIC_LICENSE_KEY=

APOLLO_KEY=
APOLLO_GRAPH_REF=

XYZ_ALERTS_SLACK_CHANNEL_ID=
SLACK_BOT_TOKEN=
BATCH_COMPANY_UPLOAD_JWT_TOKEN=
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/types.ts
29 changes: 29 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"env": {
"jest": true,
"node": true
},
"rules": {
"prettier/prettier": 2,
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-explicit-any": "warn",
"no-console": [
"warn",
{ "allow": ["clear", "info", "error", "dir", "trace", "warn"] }
],
// this is turned off because we need to let typescript plugin to take over
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error"],
"object-shorthand": ["error", "always"],
"no-return-await": "error"
}
}
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
node_modules
build

.env
.env.test
yarn-error.log
package-lock.json
.scannerwork/
coverage
.history

# marketing email html
output.html

# VS code debugger config
.vscode

# A playground script
src/_devScripts
.DS_Store

# log files
logs
src/scripts/**/*.json
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint && yarn typecheck
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"semi": true,
"trailingComma": "es5",
"singleQuote": true,
"printWidth": 80,
"tabWidth": 2,
"useTabs": false
}

3 changes: 3 additions & 0 deletions .whitesource
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"settingsInheritedFrom": "shellagilehub/whitesource-config@main"
}
48 changes: 48 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!--
SPDX-FileCopyrightText: 2024 Shell Global Solutions International B.V. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
-->

# Getting started with contributing
We're happy for everyone to contribute to the package by proposing new features, implementing them in a new branch and
creating a pull request. In order to keep the codebase consistent we use some common standards and tools for formatting
of the code. We are using poetry to keep our development environment up to date. Please follow the instructions here
https://python-poetry.org/docs/ to install poetry. Next, pull the repo to your local machine, open a terminal window
and navigate to the top directory of this package. Run the commands `poetry install --all-extras` and
`poetry install --with contributor` to install all required tools and dependencies for contributing to this package.

We list the various tools below:
- pylint: Tool to help with the formatting of the code, can be used as a linter in most IDEs, all relevant settings are
contained in the .pylintrc file and additionally controlled through the pyproject.toml file.
- isort: Sorts the inputs, can be used from the command line `isort .`, use the `--check` flag if you do not want to
reformat the import statements in place but just want to check if imports need to be reformatted.
- black: Formats the code based on PEP standards, can be used from the command line: `black .`, use the `--check` flag
if you do not want to reformat the code in place but just check if files need to be reformatted.
- pydocstyle: Checks if the docstrings for all files and functions are present and follow the same style as specified
in the pyproject.toml file. Used in order to get consistent documentation, can be used as a check from the command line
but will not be able to replace any text, `pydocstyle .`

In case you're unfamiliar with the tools, don't worry we have set up GitHub actions accordingly to format the code to
standard automatically on each push.

When you implement a new feature you also need to write additional (unit) tests to show the feature you've implemented
is also working as it should. Do so by creating a file in the appropriate test folder and call that file
test_<new_feature_name>.py. Use pytest to see if your test is passing and use pytest-cov to check the coverage of your
test. The settings in the pyproject.toml file are such that we automatically test for coverage. You can run all tests
through the command line `pytest .`, use the `--cov-report term-missing` flag to show which lines are missing in the
coverage. All test are required to pass before merging into main.

Whenever we merge new code into main, the release version gets automatically incremented as a micro version update.
Minor and major version releases need to be labeled manually. Version release convention used is major.minor.micro.

# Notice

The [codeowners](https://github.com/sede-open/pyELQ//blob/main/CODEOWNERS.md) reserve the right to deny applications
for ‘maintainer’ status or contributions if
the prospective maintainer or contributor is a national of and/or located in a ‘Restricted Jurisdiction’.
(A Restricted Jurisdiction is defined as a country, state, territory or region which is subject to comprehensive
trade sanctions or embargoes namely: Iran, Cuba, North Korea, Syria, the Crimea region of Ukraine (including
Sevastopol) and non-Government controlled areas of Donetsk and Luhansk). For anyone to be promoted to 'maintainer'
status, the prospective maintainer will be required to provide information on their nationality, location, and
affiliated organizations
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:gallium-slim as build
WORKDIR /opt/app
COPY . /opt/app/
RUN yarn
RUN yarn build

FROM node:gallium-slim
WORKDIR /opt/app
COPY --from=build /opt/app/node_modules /opt/app/node_modules
COPY --from=build /opt/app/build /opt/app/build
COPY package.json ormconfig.js ormconfig.migrations.js schema.graphql newrelic.js /opt/app/
EXPOSE 4000
RUN groupadd appgroup && useradd -u 999 -G appgroup appuser
USER appuser
CMD yarn start
14 changes: 14 additions & 0 deletions Dockerfile.sonar
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:gallium-slim

RUN apt-get update -yqq && \
apt-get install -yqq --no-install-recommends openjdk-8-jre-headless && \
rm -rf /var/lib/apt/lists/* && \
npm config set unsafe-perm true && \
npm install -g sonarqube-scanner

WORKDIR /usr/src

ENV NODE_PATH "/usr/local/lib/node_modules/"
RUN npm install && npm install -g [email protected]

COPY . .
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# APP API 🌱

This is a graphql API for the APP web application

## Index

- [Project Setup](./docs/project_setup.md)
- [Contributing](./docs/contributing.md)
- [Cronjobs](./docs/cronjobs/README.md)
- [Infrastructure](./docs/infrastructure/README.md)
- [Architecture Notes](./docs/architecture/README.md)
1 change: 1 addition & 0 deletions __mocks__/newrelic.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = jest.fn();
21 changes: 21 additions & 0 deletions chart/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports example glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
4 changes: 4 additions & 0 deletions chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
description: Chart for App API
name: app-api
version: 0.0.1
Loading

0 comments on commit 96134a1

Please sign in to comment.