Coder Social home page Coder Social logo

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.

Competitive Programming Initiative's Projects

cpinitiative icon cpinitiative

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

ide icon ide

A realtime collaborative IDE with code execution, intellisense, mobile support, and built-in USACO submissions.

usaco-guide icon usaco-guide

A free collection of curated, high-quality resources to take you from Bronze to Platinum and beyond.

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.