Code Monkey home page Code Monkey logo

political-contributions-api's Introduction

Political Contributions API

Project Setup

Clone the repository and install local NPM dependencies.

git clone [email protected]:andimiya/political-contributions-api.git
cd political-contributions-api
npm install

Install Serverless Globally

npm install -g serverless

Load environemnt specific credentials

Get a copy of env.yaml (currently in 1Password) and place it in the root directory of the application

Setup Database

You'll need Postgres running on your local machine. Once installed, manually create a database contributions_api_db_local - Once the DB is created you can run npm run db:migrate:local for migrations

Run/Debug

Command Description
sls offline Starts a local server you can query on localhost
sls invoke local --function nameOfFunction Allows you to run specific functions
npm run lint Run ESLint
npm run lint:fix Run ESLint and automatically fix problems.
npm run db:migrate Run migrations on local database
npm run typeorm migration:create -- -n NameOfMigration Create migration file
npm run db:drop Drop local database

Deploy

To deploy you must have serverless and the aws-cli installed globally.

Configure AWS CLI

If you don't already have the it, install the aws-cli tool. Once installed, you'll want to create a AWS Profile on your local machine that can connect to the Macy's AWS account. Access Keys can be found in our 1Password Vault.

You're required to have AWS Credentials to deploy this serverless function

aws configure --profile political-contributions-api-serverless
AWS Access Key ID [None]: [YOUR_ACCESS_KEY]
AWS Secret Access Key [None]: [YOUR_SECRET_ACCESS_KEY]
Default region name [None]: us-west-1
Default output format [None]: json

To deploy all functions & serverless changes

sls deploy --stage {environment}

To deploy a single function

sls deploy function -f function-name --stage {environment}

political-contributions-api's People

Contributors

kida001 avatar andimiya avatar

Watchers

James Cloos avatar  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.