Skip to content

Commit

Permalink
feat: initial repository set
Browse files Browse the repository at this point in the history
  • Loading branch information
everGreenGH committed May 31, 2023
0 parents commit 146c5d7
Show file tree
Hide file tree
Showing 29 changed files with 19,831 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist
node_modules
env
test
34 changes: 34 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module.exports = {
parser: "@typescript-eslint/parser",
parserOptions: {
project: "tsconfig.json",
tsconfigRootDir: __dirname,
sourceType: "module",
},
plugins: ["@typescript-eslint/eslint-plugin", "simple-import-sort"],
extends: ["plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: [".eslintrc.js"],
rules: {
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"simple-import-sort/imports": [
"error",
{
"groups":[
["^@nestjs", "^typeorm", "^rxjs", "^@toss", "^cache"],
["^./"],
["^@chat", "^@token", "^@user"],
["^@common"],
],
},
],
"simple-import-sort/exports": "error",
},
};
35 changes: 35 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: walletmetrics-server CI

on: pull_request

jobs:
Server_Build_Test:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "16.14.2"
cache: "yarn"

- uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: Install dependencies
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo //npm.pkg.github.com/:_authToken=$NPM_TOKEN >> .npmrc
yarn install --frozen-lockfile
rm .npmrc
- name: Test
run: yarn test

- name: Build
run: yarn build
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# compiled output
/dist
/node_modules

# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# OS
.DS_Store

# Tests
/coverage
/.nyc_output

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# env
.local.env
.development.env
.development.*.env
.production.env
.production.*.env
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"printWidth": 120,
"tabWidth": 2,
"singleQuote": false,
"trailingComma": "all",
"semi": true
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"eslint.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.formatOnSave": true
}
16 changes: 16 additions & 0 deletions DockerFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:16-alpine AS development

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

ARG NPM_TOKEN

RUN echo //npm.pkg.github.com/:_authToken=$NPM_TOKEN >> .npmrc

COPY package.json yarn.lock ./
RUN yarn install --immutable --immutable-cache --check-cache

COPY . .
RUN rm .npmrc

RUN yarn build
67 changes: 67 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Walletmetrics

[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/your-username/walletmetrics/blob/main/LICENSE)
[![GitHub Issues](https://img.shields.io/github/issues/your-username/walletmetrics.svg)](https://github.com/your-username/walletmetrics/issues)
[![GitHub Stars](https://img.shields.io/github/stars/your-username/walletmetrics.svg)](https://github.com/your-username/walletmetrics/stargazers)

Walletmetrics is an on-chain user analytics service that aims to be the Google Analytics or Amplitude for Web3 products. It provides insights into user behavior and engagement by analyzing on-chain data.

## Features

- **Data-driven Insights**: Gain valuable insights into user behavior and engagement on your Web3 product by leveraging on-chain data.
- **User Segmentation**: Analyze user segments based on various attributes such as transaction volume, frequency, and token holdings.
- **Real-time Monitoring**: Monitor user activity in real-time and track important metrics for your Web3 product.
- **Integration with Web3 Platforms**: Easily integrate Walletmetrics with popular Web3 platforms and protocols.

## Getting Started

### Prerequisites

To run Walletmetrics, you need to have the following installed:

- Node.js (version >= 12.0.0)
- MongoDB (version >= 4.0.0)

### Installation

1. Clone the repository:

```bash
git clone https://github.com/Fantosi/walletmetrics-server.git
```

2. Install the dependencies:

```bash
cd walletmetrics
npm install
```

3. Set up the configuration file:

```bash
cp .env.example .env
```

Edit the `.env` file and provide the necessary configurations.

4. Start the application:

```bash
npm start
```

## Documentation

For detailed instructions on how to use Walletmetrics and its API, please refer to the [Documentation](docs/README.md).


## License

This project is licensed under the [MIT License](LICENSE).

## Acknowledgements

- This project was inspired by the need for on-chain user analytics in the Web3 ecosystem.
- We would like to thank the open-source community for their contributions.
- This README file was completely written by GPT 3.5.
6 changes: 6 additions & 0 deletions datasource.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// For TypeORM Cli
import { DataSource } from "typeorm";

import config from "src/common/config/postgres.config";

export default new DataSource(config().postgres);
10 changes: 10 additions & 0 deletions docker-compose.local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: "3"

services:
pg:
image: postgres:bullseye
container_name: walletmetrics-local-db
env_file:
- ./env/.local.env
ports:
- "5432:5432"
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '3'

services:
server:
container_name: walletmetrics-main
build:
context: .
dockerfile: Dockerfile
ports:
- '80:3000'
command: |
yarn start
8 changes: 8 additions & 0 deletions nest-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/nest-cli",
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"deleteOutDir": true
}
}
Loading

0 comments on commit 146c5d7

Please sign in to comment.