Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Monorepo #80

Merged
merged 8 commits into from
Feb 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 3 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ name: Docker Image
on:
push:
paths:
- 'src/**'
- 'package.json'
- './apps/api/src/**'
- './apps/api/package.json'
branches:
- master


jobs:

build:
Expand All @@ -24,6 +23,6 @@ jobs:
run: |
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- name: Build the Docker image
run: docker build . --file Dockerfile --tag tolfixorg/cpg:latest
run: docker build . --file ./apps/api/Dockerfile --tag tolfixorg/cpg:latest
- name: Docker push
run: docker push tolfixorg/cpg:latest
6 changes: 3 additions & 3 deletions .github/workflows/lint-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ name: Lint Testing
on:
push:
paths:
- 'src/**'
- 'apps/**'
branches:
- master
- dev
pull_request:
paths:
- 'src/**'
- 'apps/**'
branches:
- master
- dev
Expand All @@ -31,7 +31,7 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install --save-dev eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin --force
- run: npm install --save-dev eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin turbo --force
# - name: Install packages
# run: npm install --force
- name: lint test
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/type-testing.yml

This file was deleted.

36 changes: 34 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
package-lock.json
.pnp
.pnp.js
test
logs

# testing
coverage

# next.js
.next/
out/
build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env
package-lock.json
logs
.env.local
.env.development.local
.env.test.local
.env.production.local

# turbo
.turbo
74 changes: 3 additions & 71 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,80 +1,12 @@
<p align="center">
<a href="https://tolfix.com/" target="_blank"><img width="260" src="https://cdn.tolfix.com/images/TX-Small.png"></a>
<br/>
<strong>C</strong>entral <strong>P</strong>ayment <strong>G</strong>ateway - API
<strong>C</strong>entral <strong>P</strong>ayment <strong>G</strong>ateway
</p>

#
[![Typescript Typings](https://github.com/Tolfix/cpg-api/actions/workflows/type-testing.yml/badge.svg?branch=master&event=push)](https://github.com/Tolfix/cpg-api/actions/workflows/type-testing.yml)
[![Docker Image](https://github.com/Tolfix/cpg-api/actions/workflows/docker.yml/badge.svg?branch=master&event=push)](https://github.com/Tolfix/cpg-api/actions/workflows/docker.yml)
[![CodeQL](https://github.com/Tolfix/cpg-api/actions/workflows/codeql-analysis.yml/badge.svg?branch=master)](https://github.com/Tolfix/cpg-api/actions/workflows/codeql-analysis.yml)
![Build Version](https://img.shields.io/github/v/release/Tolfix/cpg-api)


# ⭐ | CPG-API
CPG-API is being used to create products, invoices, orders, transactions and payments for customers, to grow your business. It offers various of methods for developers to customize `cpg`.

# 📝| Table of content
* [Documentations](#--documentations)
* [Setup](#--setup)
* [Installing](#installing)
* [Building](#building)
* [Running](#running)
* [Plugins](#--plugins)
* [Installing](#installing-1)
* [Deleting](#deleting)
* [Contribute](#--contribute)
* [Discord](#--discord)

# 📋 | Documentations
You can read our documentations in our [`Wiki`](https://github.com/Tolfix/CPG-API/wiki)

# 🧰 | Setup
Setting up `CPG` can be done in various of ways, but by the far easiet is by using `Docker`.
You can pull the latest `docker` image from `tolfixorg/cpg:latest` from `DockerHub`.

`CPG` also needs `env` vars added, which you can find some documents from [`.env.example`](), those added with `(optional)` can be ignored if you don't feel the need of them, but the others are required to make `CPG` functional.

## Installing
`CPG` requires the following
* Node.js v14 or v16
* Typescript - 4.3.5
* MongoDB
* Git

1. Clone repository
```txt
git clone https://github.com/Tolfix/CPG-API
```
2. Install dependencies
```txt
npm install
```
3. Install `TypeScript`
```txt
npm install -g typescript@4.3.5
```
## Building
`CPG` is built from `TypeScript`, thus simple run it by using the compiler.
```txt
tsc -b
npm run build
```

## Running
You can run `CPG` by using `npm run start` or `node ./build/Main.js`.
Would recommend to use `pm2`.

# 🎨 | Plugins
Plugins allows you to install others features to CPG. Be aware it can be `dangerous` due to plugins get accessed to alot, you can trust `Tolfix` owns plugins, or plugins you created yourself, otherwise there is no guarantee.

## Installing
You can install new plugins by modifying ENV PLUGIN as a array
`PLUGINS=["cpg-plugin-discord-webhook", "cpg-plugin-"]`
This will install the plugin by `npm`.

## Deleting
Simply remove the plugin as you added the plugin reverse.
# ⭐ | CPG
CPG is being used to create products, invoices, orders, transactions and payments for customers, to grow your business. It offers various of methods for developers to customize `cpg`.

# 📢 | Contribute
Want to contribute? Great! You can contribute by `forking` this repository, then make changes and make a `PR`!
Expand Down
2 changes: 1 addition & 1 deletion .env.example → apps/api/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ HTTP_SCHEMA=
# Session secret key for cookies
SESSION_SECRET=

# Which port to run on, default 8080
# Which port to run on, default 3001
# (optional)
PORT=

Expand Down
2 changes: 2 additions & 0 deletions apps/api/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// eslint-disable-next-line no-undef
module.exports = require("config/eslint-api");
4 changes: 2 additions & 2 deletions Dockerfile → apps/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ENV DOMAIN ""
ENV HTTP_SCHEMA ""

ENV SESSION_SECRET ""
ENV PORT "8080"
ENV PORT "3001"

ENV OSTICKET_URL ""
ENV OSTICKET_API_KEY ""
Expand All @@ -52,6 +52,6 @@ ENV PLUGINS "[]"

ENV WEBHOOK_SECRET ""

EXPOSE 8080
EXPOSE 3001

CMD [ "node", "./build/Main.js" ]
89 changes: 89 additions & 0 deletions apps/api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<p align="center">
<a href="https://tolfix.com/" target="_blank"><img width="260" src="https://cdn.tolfix.com/images/TX-Small.png"></a>
<br/>
<strong>C</strong>entral <strong>P</strong>ayment <strong>G</strong>ateway - API
</p>

#
[![Typescript Typings](https://github.com/Tolfix/cpg-api/actions/workflows/type-testing.yml/badge.svg?branch=master&event=push)](https://github.com/Tolfix/cpg-api/actions/workflows/type-testing.yml)
[![Docker Image](https://github.com/Tolfix/cpg-api/actions/workflows/docker.yml/badge.svg?branch=master&event=push)](https://github.com/Tolfix/cpg-api/actions/workflows/docker.yml)
[![CodeQL](https://github.com/Tolfix/cpg-api/actions/workflows/codeql-analysis.yml/badge.svg?branch=master)](https://github.com/Tolfix/cpg-api/actions/workflows/codeql-analysis.yml)
![Build Version](https://img.shields.io/github/v/release/Tolfix/cpg-api)


# ⭐ | CPG-API
CPG-API is being used to create products, invoices, orders, transactions and payments for customers, to grow your business. It offers various of methods for developers to customize `cpg`.

# 📝| Table of content
* [Documentations](#--documentations)
* [Setup](#--setup)
* [Installing](#installing)
* [Building](#building)
* [Running](#running)
* [Plugins](#--plugins)
* [Installing](#installing-1)
* [Deleting](#deleting)
* [Contribute](#--contribute)
* [Discord](#--discord)

# 📋 | Documentations
You can read our documentations in our [`Wiki`](https://github.com/Tolfix/CPG-API/wiki)

# 🧰 | Setup
Setting up `CPG` can be done in various of ways, but by the far easiet is by using `Docker`.
You can pull the latest `docker` image from `tolfixorg/cpg:latest` from `DockerHub`.

`CPG` also needs `env` vars added, which you can find some documents from [`.env.example`](), those added with `(optional)` can be ignored if you don't feel the need of them, but the others are required to make `CPG` functional.

## Installing
`CPG` requires the following
* Node.js v14 or v16
* Typescript - 4.3.5
* MongoDB
* Git

1. Clone repository
```txt
git clone https://github.com/Tolfix/CPG-API
```
2. Install dependencies
```txt
npm install
```
3. Install `TypeScript`
```txt
npm install -g typescript@4.3.5
```
## Building
`CPG` is built from `TypeScript`, thus simple run it by using the compiler.
```txt
tsc -b
npm run build
```

## Running
You can run `CPG` by using `npm run start` or `node ./build/Main.js`.
Would recommend to use `pm2`.

# 🎨 | Plugins
Plugins allows you to install others features to CPG. Be aware it can be `dangerous` due to plugins get accessed to alot, you can trust `Tolfix` owns plugins, or plugins you created yourself, otherwise there is no guarantee.

## Installing
You can install new plugins by modifying ENV PLUGIN as a array
`PLUGINS=["cpg-plugin-discord-webhook", "cpg-plugin-"]`
This will install the plugin by `npm`.

## Deleting
Simply remove the plugin as you added the plugin reverse.

# 📢 | Contribute
Want to contribute? Great! You can contribute by `forking` this repository, then make changes and make a `PR`!

Or simple ask on our [`discord server`](https://discord.tolfix.com).

# 🔮 | Discord
[![Discord](https://discord.com/api/guilds/833438897484595230/widget.png?style=banner4)](https://discord.tolfix.com)

# ⚙ | Tolfix
**Tolfix** is a `company` focusing about `IT`, `Development` and `Networking`, we drive to help others with their `problems` when it comes to `IT` and love contributing to others.
Want to find more information about us you can visit us at [`https://tolfix.com/`](https://tolfix.com/).
Loading