Coder Social home page Coder Social logo

pietrzakadrian / bank Goto Github PK

View Code? Open in Web Editor NEW
1.3K 61.0 335.0 5.95 MB

🏦 Full Stack Web Application similar to financial software that is used in banking institutions | React.js and Node.js

License: MIT License

javascript typescript reactjs nodejs nestjs redux redux-saga rest-api postgresql styled-components

bank's Introduction


Bank Application

Live Preview | Swagger Documentation | Contact the developer


Full Stack Web Application similar to financial software that is used in professional banking institutions.

  • The current account balance is calculated based on the SQL operation (Double-entry bookkeeping)
  • Internalization of the application for three languages: English, German and Polish
  • Support for multiple currencies with the current rate supplied from an external server via API
  • Application programmed according to the correct design patterns and principle, i.e. SOLID, DRY and KISS
  • Software supports PWA, it is adapted to all modern browsers and mobile devices (RWD)
  • Implementation of Google Analytics along with the Cookie Consent according to the GDPR


Frontend technologies stack (client)

JavaScript, React.js, Redux, Redux-Saga, Reselect, immer, Ant Design and styled-components

Backend technologies stack (server)

TypeScript, Node.js, Nest.js, REST API, PostgreSQL and Swagger Documentation

System requirements

Installation

# 1. Clone the bank repository
git clone https://github.com/pietrzakadrian/bank

# 2. Enter the bank directory
cd bank

# 3. Initialize and clone attached submodules for backend and frontend app
git submodule init && git submodule update

License

This project is licensed under the MIT license. Copyright (c) 2019-2020 Adrian Pietrzak.

bank's People

Contributors

pietrzakadrian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bank's Issues

Error logging in user

Getting this log from the console
error: [middlewares:genericErrorHandler.middleware] Error: {"success":false,"code":400,"error":{}}

Avoid .then hell

It's hard to read the code, because of .then hell
Consider using await, extract to big methods to smaller ones

Simplify routing

For example:

todo.route.js

const router = express.Router()

router.use(
	checkAuth,
	checkToken,
);

router.post('/endpoint', controller.doLogic);

export const todoRouter = router;

app.js

const { todoRouter } = require('todo.route');
const app = express();

app.use('/todo', todoRouter);

Column length too big for column

Hi, After running the backend for the first time using the watch script, I am getting the following - QueryFailedError: ER_TOO_BIG_FIELDLENGTH: Column length too big for column 'accountBalanceHistory' (max = 16383); use BLOB or TEXT instead. I am running mysql Ver 8.0.20 for macos10.15.

Implement expressjs error handler

Doing res.status(500).json({... is not a good practice, it's better to throw an exception, which will be handled by error handler - so you don't have to worry, about the proper error structure

Error start backend

I created .env from env.example, run npm i, then run npm start. Got:

npm start

> [email protected] start /disk_kingstone/var/www/external/pietrzakadrian/bank/bank/backend
> ts-node src/index.ts


/disk_kingstone/var/www/external/pietrzakadrian/bank/bank/backend/node_modules/ts-node/src/index.ts:261
    return new TSError(diagnosticText, diagnosticCodes)
           ^
TSError: ⨯ Unable to compile TypeScript:
src/controllers/users.controller.ts(55,68): error TS2339: Property 'login' does not exist on type 'Params'.
  Property 'login' does not exist on type 'string[]'.
src/controllers/users.controller.ts(108,68): error TS2339: Property 'email' does not exist on type 'Params'.
  Property 'email' does not exist on type 'string[]'.

    at createTSError (/disk_kingstone/var/www/external/pietrzakadrian/bank/bank/backend/node_modules/ts-node/src/index.ts:261:12)
    at getOutput (/disk_kingstone/var/www/external/pietrzakadrian/bank/bank/backend/node_modules/ts-node/src/index.ts:367:40)
    at Object.compile (/disk_kingstone/var/www/external/pietrzakadrian/bank/bank/backend/node_modules/ts-node/src/index.ts:558:11)
    at Module.m._compile (/disk_kingstone/var/www/external/pietrzakadrian/bank/bank/backend/node_modules/ts-node/src/index.ts:439:43)
    at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Object.require.extensions.(anonymous function) [as .ts] (/disk_kingstone/var/www/external/pietrzakadrian/bank/bank/backend/node_modules/ts-node/src/index.ts:442:12)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `ts-node src/index.ts`

yarn start not working

$ yarn start
yarn run v1.17.3

       ^

TSError: ⨯ Unable to compile TypeScript:
src/services/users.service.ts:13:27 - error TS2589: Type instantiation is excess
ively deep and possibly infinite.

13 this.userRepository = getManager().getRepository(User);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

at createTSError (E:\bank\backend\node_modules\ts-node\src\index.ts:245:12)
at reportTSError (E:\bank\backend\node_modules\ts-node\src\index.ts:249:19)
at getOutput (E:\bank\backend\node_modules\ts-node\src\index.ts:362:34)
at Object.compile (E:\bank\backend\node_modules\ts-node\src\index.ts:395:32)
at Module.m._compile (E:\bank\backend\node_modules\ts-node\src\index.ts:473:
  1. at Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Object.require.extensions.(anonymous function) [as .ts] (E:\bank\backend
    node_modules\ts-node\src\index.ts:476:12)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this comm
    and.

Error while starting, can i get full install guide?

/var/www/html/bank/server/config/db.config.js:10
max: env.pool.max,
^

TypeError: Cannot read property 'max' of undefined
at Object. (/var/www/html/bank/server/config/db.config.js:10:19)
at Module._compile (internal/modules/cjs/loader.js:738:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:749:10)
at Module.load (internal/modules/cjs/loader.js:630:32)
at tryModuleLoad (internal/modules/cjs/loader.js:570:12)
at Function.Module._load (internal/modules/cjs/loader.js:562:3)
at Module.require (internal/modules/cjs/loader.js:667:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object. (/var/www/html/bank/server/index.js:29:12)
at Module._compile (internal/modules/cjs/loader.js:738:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:749:10)
at Module.load (internal/modules/cjs/loader.js:630:32)
at tryModuleLoad (internal/modules/cjs/loader.js:570:12)
at Function.Module._load (internal/modules/cjs/loader.js:562:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:801:12)
at internal/main/run_main_module.js:21:11

Extract data layer

All functionalities responsible for pulling data from any source should be done in the proper layer - in that case, data layer. If you would switch to the different solution (for ex. mongoose/typeorm) you won't have to worry about refactoring half of the application.

export class UserRepository {
	findOrThrow(userId) { }...
	getUserStatus(userId) { }...
}

Objects are not valid as a React child

utils.js?12fe:225 uncaught at loadCurrency Error: Objects are not valid as a React child (found: TypeError: Failed to fetch). If you meant to render a collection of children, use an array instead.
    in div (created by RegisterPage)
    in form (created by RegisterPage)
    in span (created by RegisterPage)
    in div (created by RegisterPage)
    in div (created by RegisterPage)
    in div (created by RegisterPage)
    in div (created by RegisterPage)
    in div (created by RegisterPage)
    in RegisterPage (created by Connect(RegisterPage))
    in Connect(RegisterPage) (created by withSaga(Connect(RegisterPage)))
    in withSaga(Connect(RegisterPage)) (created by withReducer(withSaga(Connect(RegisterPage))))
    in withReducer(withSaga(Connect(RegisterPage))) (created by Route)
    in Route (created by withRouter(withReducer(withSaga(Connect(RegisterPage)))))
    in withRouter(withReducer(withSaga(Connect(RegisterPage)))) (created by WithStyles(withRouter(withReducer(withSaga(Connect(RegisterPage))))))
    in WithStyles(withRouter(withReducer(withSaga(Connect(RegisterPage))))) (created by LoadableComponent)
    in LoadableComponent (created by Route)
    in Route (created by App)
    in Switch (created by App)
    in App
    in Router (created by ConnectedRouter)
    in ConnectedRouter (created by Connect(ConnectedRouter))
    in Connect(ConnectedRouter)
    in SnackbarProvider
    in IntlProvider (created by LanguageProvider)
    in LanguageProvider (created by Connect(LanguageProvider))
    in Connect(LanguageProvider)
    in MuiThemeProviderOld
    in Provider
Invariant Violation: Objects are not valid as a React child (found: TypeError: Failed to fetch). If you meant to render a collection of children, use an array instead.
    in div (created by RegisterPage)
    in form (created by RegisterPage)
    in span (created by RegisterPage)
    in div (created by RegisterPage)
    in div (created by RegisterPage)
    in div (created by RegisterPage)
    in div (created by RegisterPage)
    in div (created by RegisterPage)
    in RegisterPage (created by Connect(RegisterPage))
    in Connect(RegisterPage) (created by withSaga(Connect(RegisterPage)))
    in withSaga(Connect(RegisterPage)) (created by withReducer(withSaga(Connect(RegisterPage))))
    in withReducer(withSaga(Connect(RegisterPage))) (created by Route)
    in Route (created by withRouter(withReducer(withSaga(Connect(RegisterPage)))))
    in withRouter(withReducer(withSaga(Connect(RegisterPage)))) (created by WithStyles(withRouter(withReducer(withSaga(Connect(RegisterPage))))))
    in WithStyles(withRouter(withReducer(withSaga(Connect(RegisterPage))))) (created by LoadableComponent)
    in LoadableComponent (created by Route)
    in Route (created by App)
    in Switch (created by App)
    in App
    in Router (created by ConnectedRouter)
    in ConnectedRouter (created by Connect(ConnectedRouter))
    in Connect(ConnectedRouter)
    in SnackbarProvider
    in IntlProvider (created by LanguageProvider)
    in LanguageProvider (created by Connect(LanguageProvider))
    in Connect(LanguageProvider)
    in MuiThemeProviderOld
    in Provider
    at invariant (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:55:15)
    at throwOnInvalidObjectType (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:12336:5)
    at reconcileChildFibers (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:13110:7)
    at reconcileChildren (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:13505:28)
    at updateHostComponent (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:13849:3)
    at beginWork (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:14494:14)
    at performUnitOfWork (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:17014:12)
    at workLoop (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:17054:24)
    at renderRoot (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:17133:7)
    at performWorkOnRoot (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:17993:7)

I pulled, ran npm install then start. Tried on node 8/9 and 10. All have the same result.

I managed to get the same problem locally and when deploying to heroku.

It builds, starts but the trying to do anything breaks it.

Also how do you sign in as an admin/is there an admin control panel?

npm backend error

i followed the steps and make the .env file and i got this error message
npm start > [email protected] start C:\Users\ahmed\Desktop\bank-1.1\backend > ts-node src/index.ts C:\Users\ahmed\Desktop\bank-1.1\backend\node_modules\ts-node\src\index.ts:261 return new TSError(diagnosticText, diagnosticCodes) ^ TSError: ⨯ Unable to compile TypeScript: error TS2688: Cannot find type definition file for 'validator'. at createTSError (C:\Users\ahmed\Desktop\bank-1.1\backend\node_modules\ts-node\src\index.ts:261:12) at getOutput (C:\Users\ahmed\Desktop\bank-1.1\backend\node_modules\ts-node\src\index.ts:367:40) at Object.compile (C:\Users\ahmed\Desktop\bank-1.1\backend\node_modules\ts-node\src\index.ts:558:11) at Module.m._compile (C:\Users\ahmed\Desktop\bank-1.1\backend\node_modules\ts-node\src\index.ts:439:43) at Module._extensions..js (internal/modules/cjs/loader.js:1178:10) at Object.require.extensions. [as .ts] (C:\Users\ahmed\Desktop\bank-1.1\backend\node_modules\ts-node\src\index.ts:442:12) at Module.load (internal/modules/cjs/loader.js:1002:32) at Function.Module._load (internal/modules/cjs/loader.js:901:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) at Object. (C:\Users\ahmed\Desktop\bank-1.1\backend\node_modules\ts-node\src\bin.ts:157:12) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] start: ts-node src/index.ts npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.