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

Commit 9e4e7da

Browse files
authored
Merge pull request #92 from Tolfix/dev
v2.7
2 parents 5253238 + 4644325 commit 9e4e7da

File tree

112 files changed

+25316
-851
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+25316
-851
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
node_modules
22
build
33
.env
4-
package-lock.json
54
logs

Dockerfile

+27-11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
FROM node:16-alpine
1+
FROM node:16-alpine as INSTALLER
22

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

5-
LABEL author="Tolfix" maintainer="[email protected]"
5+
WORKDIR /app
66

77
RUN apk update && \
88
apk upgrade && \
@@ -11,19 +11,35 @@ RUN apk update && \
1111
RUN npm install -g @types/node \
1212
&& npm install -g [email protected]
1313

14-
WORKDIR /usr/src
14+
COPY ./package*.json ./
15+
16+
RUN npm ci
17+
##########################
18+
19+
# BUILDER
20+
FROM node:16-alpine as BUILDER
21+
22+
WORKDIR /app
1523

16-
COPY package*.json ./
24+
COPY . .
1725

18-
RUN npm install --force
26+
COPY --from=INSTALLER /app/node_modules ./node_modules
1927

20-
COPY . ./
28+
RUN npm run build
29+
##########################
2130

22-
RUN tsc -b
31+
# APP
32+
FROM node:16-alpine as APP
2333

24-
# Remove unused files
25-
#RUN rm -r ./src && \
26-
# rm -r ./test
34+
WORKDIR /app
35+
36+
COPY --from=BUILDER /app/build ./build
37+
COPY --from=BUILDER /app/node_modules ./node_modules
38+
COPY --from=BUILDER /app/package.json ./package.json
39+
40+
ENV DEBIAN_FRONTEND=noninteractive
41+
42+
LABEL author="Tolfix" maintainer="[email protected]"
2743

2844
ENV JWT_ACCESS_TOKEN ""
2945
ENV DEBUG "false"

README.md

+43-35
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<p align="center">
2-
<a href="https://tolfix.com/" target="_blank"><img width="260" src="https://cdn.tolfix.com/images/TX-Small.png"></a>
1+
<div class="margin: 0 auto;" align="center">
2+
<a href="https://tolfix.com/" target="_blank"><img width="260" src="https://cdn.tolfix.com/images/TX-Small.png" alt="Tolfix"></a>
33
<br/>
44
<strong>C</strong>entral <strong>P</strong>ayment <strong>G</strong>ateway - API
5-
</p>
5+
</div>
66

77
#
88
[![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)
@@ -12,78 +12,86 @@
1212

1313

1414
# ⭐ | CPG-API
15-
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`.
15+
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
1616

1717
# 📝| Table of content
18-
* [Documentations](#--documentations)
18+
* [Documentations](#--documentation)
1919
* [Setup](#--setup)
20-
* [Installing](#installing)
21-
* [Building](#building)
22-
* [Running](#running)
20+
* [Installing](#--installing)
21+
* [Building](#👷--building-the-project)
22+
* [Running](#-running)
2323
* [Plugins](#--plugins)
24-
* [Installing](#installing-1)
24+
* [Installing](#installing)
2525
* [Deleting](#deleting)
2626
* [Contribute](#--contribute)
2727
* [Discord](#--discord)
2828

29-
# 📋 | Documentations
30-
You can read our documentations in our [`Wiki`](https://github.com/Tolfix/CPG-API/wiki)
29+
# 📋 | Documentation
30+
You can read our documentation on our [`wiki.`](https://github.com/Tolfix/CPG-API/wiki)
3131

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

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

38-
## Installing
39-
`CPG` requires the following
37+
**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.
38+
39+
# 🔧 | Installing
40+
**CPG** requires the following
4041
* Node.js v14 or v16
4142
* Typescript - 4.3.5
4243
* MongoDB
4344
* Git
4445

45-
1. Clone repository
46-
```txt
46+
1. Clone repository
47+
```bash
4748
git clone https://github.com/Tolfix/CPG-API
4849
```
4950
2. Install dependencies
50-
```txt
51+
```bash
5152
npm install
5253
```
5354
3. Install `TypeScript`
54-
```txt
55+
```bash
5556
npm install -g [email protected]
5657
```
57-
## Building
58-
`CPG` is built from `TypeScript`, thus simple run it by using the compiler.
59-
```txt
58+
59+
## 👷 | Building
60+
**CPG** is built from **TypeScript**, so you can run it by using the compiler.
61+
```bash
6062
tsc -b
6163
npm run build
6264
```
6365

64-
## Running
65-
You can run `CPG` by using `npm run start` or `node ./build/Main.js`.
66-
Would recommend to use `pm2`.
66+
# 👟 | Running
67+
You can run *CPG* by executing `npm run start` or `node ./build/Main.js`.
68+
I Would recommend you use `pm2`.
6769

6870
# 🎨 | Plugins
69-
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.
71+
Plugins allow you to add others features to CPG.
72+
Beware, it can be `dangerous` as plugins get access to a lot of low level features.
73+
You can trust `Tolfix` plugins, or plugins you created yourself, otherwise there is no guarantee on stability or security.
7074

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

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

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

82-
Or simple ask on our [`discord server`](https://discord.tolfix.com).
89+
Or you can ask on our [`discord server`](https://discord.tolfix.com).
8390

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

8794
# ⚙ | Tolfix
88-
**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.
89-
Want to find more information about us you can visit us at [`https://tolfix.com/`](https://tolfix.com/).
95+
**Tolfix** is a `company` focused on `IT`, `Development` and `Networking`,
96+
we strive to help others with their `IT` issues and love contributing to other peoples projects!
97+
If you'd like to find out more, you can visit us at [`https://tolfix.com/`](https://tolfix.com/).

0 commit comments

Comments
 (0)