Code Monkey home page Code Monkey logo

pacta-web's Introduction

README

Intro

This is a basic web app designed to call the PACTA Capital Transition Assessment model, which it assumes is being run behind an API.

Running it

This repo creates two containers, one running a postgres DB, the other a Rails app. If you just want to run the app you can use the Dockerfile by itself, rather than docker-compose, which starts both. To run the whole thing:

  1. Install Docker

  2. Clone this repo

git clone https://github.com/john/pacta.git
  1. cd into repo and build images. The app was originally name supnet and the Rails app retains that name; until that gets changed (soon) the volume needs to retain it.
cd pacta-web

docker volume create --name pacta-db
docker volume create --name supnet
  1. Copy the .env.example file, rename the copy .env, and update the values. If you create a Google Analystics tag and put it in GA_CODE, it will track user/visits/etc.

  2. Initialize:

docker compose up --build
  1. Connect to the shell running in the container. In a separate terminal run docker ps to list running containers, then, using the container name you just found, connect to it:
docker ps
docker exec -t -i pacta-web-pacta-1 /bin/bash
  1. After building for the first time you'll see you need to create the databases. In a separate terminal run:
docker compose run pacta rails db:create
docker compose run pacta rails db:migrate

Running the migrations also creates and admin user ("Little Bobby Admin," [email protected]) and an 'Acme Financial' organization.

  1. Once the database is set up, you can start the containers normally:
docker compose up

You should then be able to hit it at http://127.0.0.1, log in, create portfolios, and run (fake, until the API is wired) reports.

Connecting to the database

psql --host=localhost --username=pacta --port=6542 --dbname=supnet (pw: test_db_password) List tables: \dt Describe a table: \d table_name

DB port is 6542, mapped to the standard postgresql on the container side.

License

Copyright (c) 2023 John McGrath ([email protected]) and RMI. See LICENSE for details.

pacta-web's People

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.