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

Commit

Permalink
Merge pull request #92 from Tolfix/dev
Browse files Browse the repository at this point in the history
v2.7
  • Loading branch information
Tolfx authored Mar 10, 2022
2 parents 5253238 + 4644325 commit 9e4e7da
Show file tree
Hide file tree
Showing 112 changed files with 25,316 additions and 851 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules
build
.env
package-lock.json
logs
38 changes: 27 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM node:16-alpine
FROM node:16-alpine as INSTALLER

ENV DEBIAN_FRONTEND=noninteractive
RUN apk add --no-cache libc6-compat

LABEL author="Tolfix" maintainer="support@tolfix.com"
WORKDIR /app

RUN apk update && \
apk upgrade && \
Expand All @@ -11,19 +11,35 @@ RUN apk update && \
RUN npm install -g @types/node \
&& npm install -g typescript@4.3.5

WORKDIR /usr/src
COPY ./package*.json ./

RUN npm ci
##########################

# BUILDER
FROM node:16-alpine as BUILDER

WORKDIR /app

COPY package*.json ./
COPY . .

RUN npm install --force
COPY --from=INSTALLER /app/node_modules ./node_modules

COPY . ./
RUN npm run build
##########################

RUN tsc -b
# APP
FROM node:16-alpine as APP

# Remove unused files
#RUN rm -r ./src && \
# rm -r ./test
WORKDIR /app

COPY --from=BUILDER /app/build ./build
COPY --from=BUILDER /app/node_modules ./node_modules
COPY --from=BUILDER /app/package.json ./package.json

ENV DEBIAN_FRONTEND=noninteractive

LABEL author="Tolfix" maintainer="support@tolfix.com"

ENV JWT_ACCESS_TOKEN ""
ENV DEBUG "false"
Expand Down
78 changes: 43 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<p align="center">
<a href="https://tolfix.com/" target="_blank"><img width="260" src="https://cdn.tolfix.com/images/TX-Small.png"></a>
<div class="margin: 0 auto;" align="center">
<a href="https://tolfix.com/" target="_blank"><img width="260" src="https://cdn.tolfix.com/images/TX-Small.png" alt="Tolfix"></a>
<br/>
<strong>C</strong>entral <strong>P</strong>ayment <strong>G</strong>ateway - API
</p>
</div>

#
[![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)
Expand All @@ -12,78 +12,86 @@


# ⭐ | 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`.
CPG-API is being used to generate items, create invoices, handle orders, view transactions, and ensure payments make it to the client to develop your business. It offers many approaches for developers to personalize CPG

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

# 📋 | Documentations
You can read our documentations in our [`Wiki`](https://github.com/Tolfix/CPG-API/wiki)
# 📋 | Documentation
You can read our documentation on 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`.
# 📦 | Setup
Setting up **CPG** can be done in various ways, but by far the simplest is by using **Docker**.

`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.
You can pull the latest **Docker Image** from `tolfixorg/cpg:latest` from **DockerHub**.

## Installing
`CPG` requires the following
**CPG** also needs environment variables added, which you can find in [`.env.example`](), those that have (optional) in the comment can be ignored if you don't feel the need for 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
1. Clone repository
```bash
git clone https://github.com/Tolfix/CPG-API
```
2. Install dependencies
```txt
```bash
npm install
```
3. Install `TypeScript`
```txt
```bash
npm install -g typescript@4.3.5
```
## Building
`CPG` is built from `TypeScript`, thus simple run it by using the compiler.
```txt

## 👷 | Building
**CPG** is built from **TypeScript**, so you can run it by using the compiler.
```bash
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`.
# 👟 | Running
You can run *CPG* by executing `npm run start` or `node ./build/Main.js`.
I Would recommend you 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.
Plugins allow you to add others features to CPG.
Beware, it can be `dangerous` as plugins get access to a lot of low level features.
You can trust `Tolfix` plugins, or plugins you created yourself, otherwise there is no guarantee on stability or security.

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

## Deleting
Simply remove the plugin as you added the plugin reverse.
To delete a plugin, simply remove it from the environment variable "PLUGIN" as an array of strings.
`PLUGINS=[]`
This will uninstall the plugin via `npm`.

# 📢 | Contribute
Want to contribute? Great! You can contribute by `forking` this repository, then make changes and make a `PR`!
Want to contribute? Great!
You can contribute to the repository by `forking`, then make a pull request when you're done!

Or simple ask on our [`discord server`](https://discord.tolfix.com).
Or you can 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/).
**Tolfix** is a `company` focused on `IT`, `Development` and `Networking`,
we strive to help others with their `IT` issues and love contributing to other peoples projects!
If you'd like to find out more, you can visit us at [`https://tolfix.com/`](https://tolfix.com/).
Loading

0 comments on commit 9e4e7da

Please sign in to comment.