Coder Social home page Coder Social logo

teampage's Introduction

teampage

This project allows you to have the team page on your site automatically update when a new staff member joins your company. It uses the google directory api to do so.

backend

To deploy the backend, you will need an admin login to your Google Apps account. You will need to create a new project in the google console with a service account that has domain-wide delegation enabled and the OAuth 2 scope: 'https://www.googleapis.com/auth/admin.directory.user.readonly' enabled.

Save the following environment variables in a file called secrets.dev.yml:

  • GOOGLE_CLIENT_EMAIL: (this is the service account id, ending in iam.gserviceaccount.com)
  • GOOGLE_ADMIN_EMAIL: (the email address of an admin user at your company)
  • GOOGLE_PRIVATE_KEY: (created when you create your service account, use | to format)
  • BUCKET_NAME: (name of the bucket serverless will create to store your html - must be globally unique)
  • SETTINGS_TABLE: (name of the dynamodb table serverless will create to store your selected users)
  • DOMAIN: (your google apps domain)

You can also use the apis explorer to test the directory api.

You can then deploy the backend using serverless.

cd serverless

npm install

npm install -g serverless

sls deploy --stage dev

You can also encrypt your secrets file which will allow you to commit it to source control:

sls encrypt --stage dev --password '{your secure password}'

frontend

The frontend folder contains an admin app which can be used to filter the google api results to only display the users you wish to show on your website. The entry point is index.html. You will need to add a config.js file that has the following:

getUsers: '<your users endpoint, created and returned by your serverless deploy>',
postStaff: '<your staff endpoint, created and returned by your serverless deploy>',
getHtml: '<your serverless stage>-<your bucket url>/teampage.html'};

You will want to copy all the static files in this folder to your intranet or another location where your staff can administer the team page.

It also contains index.js and style.css which are the files that need to be included on your team page on your website.

For all files in the frontend you will need to fork and personalise to your website as you desire.

teampage's People

Contributors

beerecca avatar

Watchers

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