Code Monkey home page Code Monkey logo

cpinitiative's Introduction

Competitive Programming Initiative

We promote competitive programming among students through resources, outreach, classes, and contests.

Thanks to Vercel for providing free hosting & continuous deployment!

Development Environment Setup

Instructions (for volunteer hours -- not necessarily needed for other stuff)

  1. If not done already, clone the repository cpinitiative/cpinitiative and open up the folder.

  2. At the root directory, add a file .env, which will contain the environment configuration for the volunteer-hours. An example .env file will look like

    GOOGLE_CLIENT_ID="....apps.googleusercontent.com"
    GOOGLE_CLIENT_SECRET="asdkjflasdjfklas"
    NEXTAUTH_URL="http://localhost:3000"
    SHEETS_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----..."
    SHEETS_PRIVATE_KEY_ID="1298301asfa98sf09ac0291023"
    FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----..."
    ENCRYPTION_KEY="asdjkflajsdflkjas;ldjfa"
    MJ_APIKEY_PUBLIC="mailjet api key public"
    MJ_APIKEY_PRIVATE=""
    PAYPAL_API_SECRET="ddd"
    MAILGUN_API_KEY=""

    Here's how to get the following keys:

    • Google Sheets: https://developers.google.com/sheets/api/guides/authorizing#APIKey
    • NEXT_AUTH_URL: choose the address of deployment
    • FIREBASE_PRIVATE_KEY -- I don't think this is even needed??
    • ENCRYPTION_KEY -- ask Nathan (or modify cryptography file), used to decrypt firebase key on vercel
    • MJ_APIKEY_PUBLIC/PRIVATE -- ask Nathan, only needed for newsletter
    • MAILCHIMP_API_KEY -- ask Nathan, only needed for class registration system
    • PAYPAL_API_SECRET -- ask Nathan, only needed for class registration system
  3. Using the correct configuration file, go into SHEETS_API_CREDS inconfig.ts and make sure the credential object matches your Google Sheet configuration that you retrieved in the previous step.

  4. Acquire firebase credentials (or setup emulator), and make sure to replace the configuration in the firebaseAdmin.initializeApp in firebase.ts with the correct configuration.

  5. To navigate to the volunteer hours page after running yarn dev, you can go to localhost:3000/view-hours. Then, it should be able to test.

  6. Make sure to add access to the sheet in mind through Google Sheets itself (add the service account email as an editor in the sheet)

Here is a sample entry in the table, for reference, which can be called with the google-spreadsheet node package, :

Timestamp What is your name? What is your email address? List any PR's that you reviewed or submitted this week. How many hours did you spend on the USACO Guide this week? Enter only a number. (Optional, only if you want volunteer hours) Anything else you want to tell us? (Optional)
2021-10-23T23:18:42.653Z Someone [email protected] I worked on pull requests and reviewed things. 4 Yes, I made some stuff.

cpinitiative's People

Contributors

thecodingwizard avatar maggie-j-liu avatar mjh316 avatar jeffreymeng avatar nathangong avatar cskitty avatar nwatx avatar vinceyou1 avatar abheekda1 avatar ryanchou-dev avatar ady00 avatar shaubby avatar realmyth21 avatar bqi343 avatar zhao-stanley avatar cirex-web avatar jessechoe10 avatar evang264 avatar abdurrafay01 avatar shaymor avatar ocmelody avatar nikita-go avatar caoash avatar jasonappah avatar akshatsinghania avatar aakashyap1 avatar dongliu0426 avatar fury-101 avatar chenhongqiao avatar truashamu 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.