jordiup / 91wal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is a simple project that shows the usage of Next.js, integrated with Up's banking API.

We currently have no visibility over our Sharehouse financials πŸ™ƒ, so we decided to make a website using Up's API to visualise our transactions, balance etc. 🀠


Setup instructions

  1. We're using yarn on this project, make sure you have it installed
  2. Run yarn to download all the dependencies
  3. Copy the contents of .env.template into a new file named .env.local at the root of the project. This contains our API Key, and must be kept secret. Replace the templated values with the secrets by asking @jordiup.
  4. Run yarn dev to spin up the Next.JS react server
  5. Go to http://localhost:3000 🀠

When running next dev, Next.js will start looking for any .ts or .tsx files in our project and builds it. It even automatically creates a tsconfig.json file for our project with the recommended settings.

Next.js has built-in TypeScript declarations, so we'll get autocompletion for Next.js' modules straight away.

A type-check script is also added to package.json, which runs TypeScript's tsc CLI in noEmit mode to run type-checking separately. You can then include this, for example, in your test scripts.

Architecture Decisions

  • Chakra UI - We're using Chakra for our React/FE UI framework. Check out the docs for more info.

Folder Structure/Notes

β”œβ”€β”€ components # Add all react components here β”‚   β”œβ”€β”€ Accounts.tsx
β”‚   β”œβ”€β”€ Layout.tsx
β”‚   β”œβ”€β”€ List.tsx
β”‚   β”œβ”€β”€ ListDetail.tsx β”‚   └── ListItem.tsx β”œβ”€β”€ interfaces β”‚   └── index.ts β”œβ”€β”€ next-env.d.ts β”œβ”€β”€ next.config.js β”œβ”€β”€ .env.template # Copy env template here β”œβ”€β”€ .env.local # Create and add the secretes here β”œβ”€β”€ package.json β”œβ”€β”€ pages β”‚   β”œβ”€β”€ _app.tsx # Root page that provides things like layout to all other pages β”‚   β”œβ”€β”€ api # API directory β”‚   β”‚   β”œβ”€β”€ accounts.ts # Accounts api end point https://localhost:300/api/accounts β”‚   β”‚   └── transactions.ts # Transactions api end point β”‚   └── index.tsx β”œβ”€β”€ tsconfig.json β”œβ”€β”€ utils # Random utils β”‚   β”œβ”€β”€ api.ts # An exported Object for OpenAPIClientAxios β”‚   β”œβ”€β”€ apiHooks.ts # All api definitions that are called from the FE and linked into the BE β”‚   β”œβ”€β”€ openapi.json # Taken from up's official docs: https://raw.githubusercontent.com/up-banking/api/master/v1/openapi.json β”‚ β”‚ # (do not modify) β”‚   β”œβ”€β”€ _up-api-types.ts # (deprecated) an autogen'd file β”‚   └── up-client.d.ts # an autogen'd file used by the BE to speak to Up's API


Deploy your own

If you're someone that want's to have a play around with deploying your own version of the app, you can do so with the Vercel Details below.

Deploy the example using Vercel:

Deploy with Vercel

About


Languages

Language:TypeScript 99.7%Language:JavaScript 0.3%