Skip to content

Instantly share code, notes, and snippets.

@tinwritescode
Created January 10, 2023 13:41
Show Gist options
  • Save tinwritescode/e4286be97fbaf6718acff0f3745d028e to your computer and use it in GitHub Desktop.
Save tinwritescode/e4286be97fbaf6718acff0f3745d028e to your computer and use it in GitHub Desktop.

Update database

This command will update the database with any changes made to the Prisma schema. It first runs the yarn install command, which will install any new packages added to the project. Then it runs npx prisma db push, which will apply the changes from the Prisma schema file to the actual database. This will ensure that the database is up to date with the latest changes.

yarn install
npx prisma db push
@tinwritescode
Copy link
Author

tinwritescode commented Jan 10, 2023

Internet Banking Frontend

This is the frontend repository of the HCMUS Internet Banking application. Our application provides an easy-to-use platform for users to manage their banking transactions, view their account balances and access customer service.

Getting Started

To get started, simply clone this repository.

git clone https://github.com/hcmus-internet-banking/frontend.git

Once you have cloned the repository, you will need to install the necessary dependencies.

yarn install

Once the dependencies have been installed, you can run the application in development mode.

yarn dev

To run the application in production mode, you will need to build the application first.

yarn build
yarn start

Configuration

Before you can run the application, you will need to configure the environment variables. You can find the environment variables in /env/schema.mjs and update them accordingly.

Support

If you have any questions or need assistance, please contact us at [email protected]

@tinwritescode
Copy link
Author

tinwritescode commented Jan 10, 2023

Internet Banking Backend

This is the backend repository of the Internet Banking Project. It is built using Node.js, Express.js, and PostgreSQL.

Prerequisites

  • Node.js
  • Yarn
  • PostgreSQL/Cockroachdb

Installation

  1. Clone the repository
git clone https://github.com/hcmus-internet-banking/backend.git
  1. Install the dependencies
yarn install
  1. Create a .env file in the root directory and set up the environment variables
DATABASE_URL="postgresql://tin:5_uz-EIzKE6W4CcMEep4ZQ@brassy-sealion-2849.6xw.cockroachlabs.cloud:26257/defaultdb?sslmode-verify-full"
REFRESH_TOKEN_EXPIRES_IN_DAYS=7
ACCESS_TOKEN_EXPIRES_IN=15m
RESET_PASSWORD_TOKEN_EXPIRES_IN_MINUTE=15
JWT_SECRET=xINCka0C4cB4nL4iL4Ch40D4y
# Add the secret key here
RECAPTCHA_SECRET_KEY=6LdwoWQjAAAAAP3b-_gZcxGBO32ay-xrPfW2fUt7

# Google
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
[email protected]
EMAIL_PASSWORD=leckhgecarvsbmvr

BASE_FEE=0.005
TRANSFER_TOKEN_EXPIRES_IN_MINUTE=15

FRONTEND_URL=https://hcmus-internet-banking-frontend.vercel.app
API_NOTIFY_SERVICE=https://hcmus-banking-backend-notification.up.railway.app
  1. Run the development server
yarn dev
  1. Build the production version
yarn build
  1. Start the production server
yarn start

Usage

The backend exposes a set of REST APIs for the frontend application to interact with. The documentation for the APIs can be found in the API Documentation page.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

@tinwritescode
Copy link
Author

image
image

@tinwritescode
Copy link
Author

image

@tinwritescode
Copy link
Author

Refresh token backend (/api/auth/refresh):

image

Frontend call refresh:
image

Dispatch refresh on handleResponse:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment