Skip to content

Commit

Permalink
feat: base code
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-segning committed Mar 1, 2024
1 parent 704f3cf commit bc7387b
Show file tree
Hide file tree
Showing 28 changed files with 3,894 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build Backend

on:
push:
branches:
- '**'
tags-ignore:
- 'v*'
pull_request:
branches:
- '**'

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Go into Backend
run: cd power-pay-backend
- name: Build
run: mvn package
23 changes: 23 additions & 0 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build NodeJS

on:
push:
branches:
- '**'
tags-ignore:
- 'v*'
pull_request:
branches:
- '**'

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Go into Frontend
run: cd power-pay-frontend
- name: Build
run: npm run build
28 changes: 28 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build Translator

on:
push:
branches:
- '**'
tags-ignore:
- 'v*'
pull_request:
branches:
- '**'

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Go into Translator
run: cd power-pay-translator
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
189 changes: 189 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
### Maven template
*/pom.xml.tag
*/pom.xml.releaseBackup
*/pom.xml.versionsBackup
*/pom.xml.next
*/release.properties
*/dependency-reduced-pom.xml
*/buildNumber.properties
*/.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
*/.mvn/wrapper/maven-wrapper.jar

# Eclipse m2e generated files
# Eclipse Core
*/.project
# JDT-specific (Eclipse Java Development Tools)
*/.classpath

### Rust template
# Generated by Cargo
# will have compiled files and executables
*/debug/
*/target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
*/Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*/*.pdb

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

# Diagnostic reports (https://nodejs.org/api/report.html)
*/report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
*/pids
*/*.pid
*/*.seed
*/*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
*/lib-cov

# Coverage directory used by tools like istanbul
*/coverage
*/*.lcov

# nyc test coverage
*/.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
*/.grunt

# Bower dependency directory (https://bower.io/)
*/bower_components

# node-waf configuration
*/.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
*/build/Release

# Dependency directories
*/node_modules/
*/jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
*/web_modules/

# TypeScript cache
*/*.tsbuildinfo

# Optional npm cache directory
*/.npm

# Optional eslint cache
*/.eslintcache

# Optional stylelint cache
*/.stylelintcache

# Microbundle cache
*/.rpt2_cache/
*/.rts2_cache_cjs/
*/.rts2_cache_es/
*/.rts2_cache_umd/

# Optional REPL history
*/.node_repl_history

# Output of 'npm pack'
*/*.tgz

# Yarn Integrity file
*/.yarn-integrity

# dotenv environment variable files
*/.env
*/.env.development.local
*/.env.test.local
*/.env.production.local
*/.env.local

# parcel-bundler cache (https://parceljs.org/)
*/.cache
*/.parcel-cache

# Next.js build output
*/.next
*/out

# Nuxt.js build / generate output
*/.nuxt
*/dist

# Gatsby files
*/.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
*/.vuepress/dist

# vuepress v2.x temp and cache directory
*/.temp
*/.cache

# Docusaurus cache and generated files
*/.docusaurus

# Serverless directories
*/.serverless/

# FuseBox cache
*/.fusebox/

# DynamoDB Local files
*/.dynamodb/

# TernJS port file
*/.tern-port

# Stores VSCode versions used for testing VSCode extensions
*/.vscode-test

# yarn v2
*/.yarn/cache
*/.yarn/unplugged
*/.yarn/build-state.yml
*/.yarn/install-state.gz
*/.pnp.*

### react template
*/.DS_*
*/*.log
*/logs
**/*.backup.*
**/*.back.*

*/node_modules
*/bower_components

*.sublime*

*/psd
*/thumb
*/sketch

### IDE ###
*/.idea
.idea
.code
*/.code
.vscode
*/.vscode
45 changes: 45 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
version: '4.1'

services:
api:
build:
context: ./power-pay-backend
dockerfile: Dockerfile
ports:
- "8080:8080"
depends_on:
- db
environment:
- DATABASE_URL=postgres://postgres:password@db:5432/postgres

postgres:
image: postgres
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
- POSTGRES_DB=postgres
ports:
- "5432:5432"
volumes:
- postgres:/var/lib/postgresql/data

frontend:
build:
context: ./power-pay-frontend
dockerfile: Dockerfile
ports:
- "3000:80"
environment:
- REACT_APP_API_URL=http://localhost:3000

translator:
build:
context: ./power-pay-translator
dockerfile: Dockerfile
ports:
- "5000:5000"
environment:
- BACKEND_API_URL=http://api:8080

volumes:
postgres: { }
3 changes: 3 additions & 0 deletions docs/.template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Template doc

This is suppose to be a tempalte document
18 changes: 18 additions & 0 deletions power-pay-frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
24 changes: 24 additions & 0 deletions power-pay-frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
1 change: 1 addition & 0 deletions power-pay-frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM nginx
30 changes: 30 additions & 0 deletions power-pay-frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:

```js
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
}
```

- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
Loading

0 comments on commit bc7387b

Please sign in to comment.