Giter VIP home page Giter VIP logo

lfg_frontend_redux's Introduction

Loans For Good - Frontend

Summary

Demo

https://loansforgoodfrontend-06732fd2e7f8.herokuapp.com/

How to build the project

To build the project, you have to download this repo and the backend one. After that, create an app tree like this

App tree

(root)
├── loans_for_good_backend
├── loans_for_good_frontend
│   ├── (this repo)
└── docker-compose.yml

and use this docker-compose.yml, setting the following config-vars as your preference or use the current ones from the example (just to test the app)

env

POSTGRES_DB=
POSTGRES_USER=
POSTGRES_PASSWORD=
DEBUG=
DATABASE_URL=
REACT_APP_API_HOSTNAME=
REDIS_URL=

docker-compose.yml

version: '3.8'

services:
  db:
    image: postgres:13
    volumes:
      - postgres_data:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: mydatabase
      POSTGRES_USER: myuser
      POSTGRES_PASSWORD: mypassword

  backend:
    build:
      context: ./loans_for_good_backend
    command: ["python", "manage.py", "runserver", "0.0.0.0:8000"]
    volumes:
      - ./loans_for_good_backend:/app
    ports:
      - "8000:8000"
    depends_on:
      - db
    environment:
      DEBUG: 'True'
      DATABASE_URL: postgresql://myuser:mypassword@db:5432/mydatabase
      REDIS_URL: redis://redis:6379/0

  frontend:
    build:
      context: ./loans_for_good_frontend
    ports:
      - "3000:3000"
    depends_on:
      - backend
    volumes:
      - ./loans_for_good_frontend:/app
    environment:
      REACT_APP_API_HOSTNAME: http://localhost:8000
  
  redis:
    image: "redis:latest"
    ports:
      - "6379:6379"
      

  celery:
    build:
      context: ./loans_for_good_backend
    command: celery -A loans_for_good worker --loglevel=info
    volumes:
      - ./loans_for_good_backend:/app
    depends_on:
      - db
      - redis
    environment:
      DATABASE_URL: postgresql://myuser:mypassword@db:5432/mydatabase
      REDIS_URL: redis://redis:6379/0


volumes:
  postgres_data:

Project explanation

The project simulates a financial company which loans money. To request a loan, you have to send a Proposal. Users can send, check and refresh the status of all proposals in a SPA. Admin users can register new attributes to proposal and change the status of each proposal. For further detail about the backend check its README.

In this App, we have two slices which represents local states.

ProposalSlice

In this slice, we manage Proposal states. There is two components, a list (ProposalList) and a form (ProposalForm). This slice manage proposals and attributes states, which represents an array of JSON from our backend fetch. To check how the fetch proposal is working, you can check files at /src/api/*.

AlertSlice

In this slice we manage alerts from our UI. There are two states: loading which is a bool that indicates if there is any loading ocurring and alerts which represents an array of hash, with payload as {type: 'error', message: 'Proposal failed to load'}. Acocrding to that states, our ToastAlert component will raise and notify our user

Code Style

In this code base, we're using the eslint-airbnb format, configured at the file .eslintrc. To execute it and try auto fixes, run:

npx eslint --fix

References

lfg_frontend_redux's People

Contributors

jsobralgitpush avatar

Watchers

 avatar

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.