Git Product home page Git Product logo

commonspace's Introduction

Running the Administrator Frontend and API Server Locally on Kubernetes

Kubernetes is an open source project designed to automate the deployent, scaling, and management of cloud based applications. Commons uses kubernetes to run in the cloud. Various cloud services provide support for running and monitoring applications in a kubernetes environment. In order to test out and debug issues related to prodution environments developers should run commons using minikube, which allows developers to run kubernetes environments on a single machine. Follow the appropriate install instructions for your machine. Once installed you can use the following command line instructions to run Commons in a cloud-like environment. Note before running the application in kubernetes, [we will need access to an appropriate postgres instance] (## Connecting to postgres from minikube)

minikube start
eval $(minikube docker-env)
packer build -var version=$(git rev-parse --short=8 HEAD) -var container_image_name=swl-eng/commons-nginx deployment/commons_nginx.json
packer build -var version=$(git rev-parse --short=8 HEAD) -var container_image_name=swl-eng/commons-server deployment/commons_server.json
kubectl patch --local -o yaml -p \ '
              {
                "spec": {
                   "template": {
                        "spec": {
                          "containers": [
                                {
                                    "name": "commons-nginx",
                                    "image": "swl-eng/commons-nginx:'$(git rev-parse --short=8 HEAD)'"
                                },
                                {
                                    "name": "commons-server",
                                    "image": "swl-eng/commons-server:'$(git rev-parse --short=8 HEAD)'"
                                }
                            ]
                        }
                    }
                  }
              }' -f deployment/commons-development-template.yml > deployment/commons-development.yml
kubectl create secret generic commons-config --from-file=.env=config/development.env
kubectl apply -f deployment/development-postgres-endpoint.yml
kubectl apply -f deployment/commons-development.yml
kubectl apply -f deployment/commons_server_service.yml
kubectl apply -f deployment/commons_nginx_service.yml
kubectl apply -f deployment/commons_ingress.yml
cd deployment/ && ./develop.sh
kubectl delete -f deployment/development-postgres-endpoint.yml
kubectl delete -f deployment/commons-development.yml
kubectl delete -f deployment/commons_server_service.yml
kubectl delete -f deployment/commons_nginx_service.yml
kubectl delete -f deployment/commons_ingress.yml

N.B. Two Things: Dont forget to add your secrets to kubernetes correctly, otherwise you get silent errors Don't forget to turn off your minikube when you're all done, you probably could have guessed:

minikube stop

Frontend and Expo

Installation

Install postgres linux

sudo apt-get install libpq-dev
brew install postgres
cd expo_project
yarn

Running

expo-cli start

Admin App

There are really basic html forms that allow a user to interact and experiment with firestore. It's a simple static website, with javascript form index.js, and html in index.html. Use your favorite http server from the root directory.

python -m http.server

Firebase Functions

Deployment

Connect your ci system.

SQL

Local Development -- Backend

Install Packer

cd deployment
packer build postgres.json
docker run -p 5431:5431 swl-eng/commons-postgres:$(../.version) postgres -p 5431
psql -f deployment/init.sql

Integration testing

The gcp cloud functions interact with Postgreql. If you're a reasonable human being you want to check the simple stuff really quickly without deploying everyting to the cloud. In the spirit of this, load the sql into a docker container running postgres and test the functions that interact with postgres.

First link the .env file:

ln -s config/development.env .env

Start a new environment, currently must be done for each run of a set of test :(

cd deployment && ./develop.sh

In order to run test, the jest binary must be available to the execution environment.

yarn run test

GCP development

Follow the instructions to connect to Cloud SQL

cloud_sql_proxy -instances=<INSTANCE_CONNECTION_NAME>=tcp:5432 -credential_file=<PATH_TO_KEY_FILE>
Deploying SQL changes

Once the cloud sql proxy is running.

psql "host=127.0.0.1 sslmode=disable dbname=postgres user=postgres" -f deployment/reset.sql
psql "host=127.0.0.1 sslmode=disable dbname=postgres user=postgres" -f deployment/init.sql

commonspace's People

Contributors

californianseabass avatar craignm avatar mebreuer avatar pandananta avatar patrickkeenan avatar yulissaa 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

commonspace's Issues

Deployment issue

If I run yarn watch in main project folder I always get Unexpected token Exception:

Entrypoint app = app.bundle.js app.bundle.js.map
[0] multi babel-polyfill ./src/app.tsx 40 bytes {app} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 472 bytes {app} [built]
[./src/app.tsx] 5.26 KiB {app} [built] [failed] [1 error]
+ 326 hidden modules

ERROR in ./src/app.tsx
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /home/mav/Schreibtisch/commonspace/src/app.tsx: Unexpected token (12:4)

  10 | 
  11 | render(
> 12 |     <MuiThemeProvider theme={theme}>
     |     ^
  13 |         <MainWrapper router={router} uiState={uiState} applicationState={applicationState} />
  14 |     </MuiThemeProvider>,
  15 |     document.getElementById('app')

Seems to be related to injection of MuiThemeProvider from @material-ui, which is installed.
Guess, this is not the best place to ask, but do you have an hint for me?

Thanks,
Marc

add street/curb furniture observations

Add a place in the app to layer observations about bike/path facility features (pot holes in the bike lane or substandard bike facility), curb furniture (seating, bike parking (type, full/empty)), lighting....

Make admin mobile friendly

Currently the public facing pages (authentication, about, terms, privacy) are mobile friendly, but study configuration is not.

Clicking outside of create study window

Accidentally clicked outside of the pop up window when creating a study, and it deleted all my progress. Suggest auto-saving, or asking user if they are sure they want to exit.

Revisit the flow of adding a group

From DC field test:

  • "If groups (2+) were congregating and chatting, it was difficult to document the gender and age of each person in the group. Might be easier to select the number of people first (1, 2, 3-7, 8+) and then answer the prompts for each individual in the group rather than create multiple entries."
  • "Like the duplicate feature. Would have liked a swipe option to scroll through “persons.”
  • "...Also there needs to be a way to better catalog groups with multiple ages."

Add descriptions of the activities

From DC field test: "Would be helpful to have descriptions of the activities (i.e., what does “cultural activity” mean). Should have a “waiting for transit” activity."

Add pagination

When study lists or survey lists get long, they should be paginated

CommonSpace App login problems

Two of my surveyors had issues creating an account and logging into the app on their iPhones:

  • Password specifications were not identified when creating an account in the app, eliciting error window without explanation.
  • Once logged in, assigned surveys did not appear in app.
  • Password reset function does not appear to function properly.

My admin credentials worked for logging into the app, though it was not clear this was the case at first. If an email has been "whitelisted" to beta-test the admin, is the holder of that email address required to first set up account online via admin panel?

Explore issues with the map and location dot

From DC field test:

  • "The map tends to jump around when trying to place a person."
  • "The map doesn’t accurately locate north and south."
  • "...It wasn’t great at finding my position exactly – it often showed me on the wrong side of the street – which is fine as long as you know exactly where you are, which in a survey like this, you do."

Issues creating and logging into accounts

From SF: Tons of log in issues – users had difficulty creating an account and were almost never successful in logging into a new device
a. “Error: undefined”

App crashing

From DC field test: "The app crashed repeatedly once I had entered several data points. After entering a point the menu to choose personal characteristics wouldn't stay open or would try to close instead of recording my data. Sometimes the app would restart after I hit "back to map" on the personal characteristics menu. Zooming in on the map sometimes didn't work or crashed the app. "

"In progress" time not updating

From SF: "In progress” time does not automatically update. You must close and re-open the app for the appropriate hour to be highlighted"

Security Policy violation SECURITY.md

This issue was automatically created by Allstar.

Security Policy Violation
Security policy not enabled.
A SECURITY.md file can give users information about what constitutes a vulnerability and how to report one securely so that information about a bug is not publicly visible. Examples of secure reporting methods include using an issue tracker with private issue support, or encrypted email with a published key.

To fix this, add a SECURITY.md file that explains how to handle vulnerabilities found in your repository. Go to https://github.com/sidewalklabs/commonspace/security/policy to enable.

For more information, see https://docs.github.com/en/code-security/getting-started/adding-a-security-policy-to-your-repository.


This issue will auto resolve when the policy is in compliance.

Issue created by Allstar. See https://github.com/ossf/allstar/ for more information. For questions specific to the repository, please contact the owner or maintainer.

Add shift management

Currently, configuring date, start/end hours and minutes for every volunteer for every single shift can be tedious. Add smarter way to manage surveyors at scale.

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.