Coder Social home page Coder Social logo

eui_event's Introduction

Hacktoberfest themed banner for repo

Happy Hacktoberfest!!

I remember my first Hacktoberfest so clearly because I was so intimidated by Git and contributing code to other repos, and I was still VERY early in my coding journey and didn't even know how to code, but enjoyed the experience so much!

Hacktoberfest holds a special place in my heart because it's a great way to get started into coding and comfortable with Github. I'm so excited to finally maintain a repo that I can help others experience the same joy I did!

Want to participate in Hacktoberfest? All you have to do is sign up, and then successfully merge 4 pull requests in the month of October! Check out our contributing guidelines and open issues to participate from this repo!

React + Eui Template for An Event Website

This is a template for an event-based website. The website was created for an event my ERG was hosting (Rainbow Stack Summit), but I decided to make its own repository so others can contribute to it and use it as well!

This is all very much Work In Progress, so if you have any comments or ideas, or want to contribute, feel free to create an issue.

Demo

View a live demo of the site hosted on Vercel

Running Locally

  • Clone the project by running git clone https://github.com/<your-username>/eui-event-template.git in your terminal, or by using the Github Desktop UI

  • Cd to the repo on your local machine - cd eui-event-template

  • Install dependencies by running yarn install

  • Run yarn start to start the project

  • Go to localhost:3000 in your browser to view it!

Note that: If you wish to use the project for your own purposes, you can clone it as mentioned above or check use this template from the top. If you wish to make a contribution to the repository, you will have to fork the repository as well.

Connect Google Sheets with your app

Follow these steps to connect your google sheets file with the app.

  • Create a google sheet
  1. Go to https://docs.google.com/ and create a blank sheet
  2. Add name, title, team, location, shortBio, pronouns, imageLink headers in the sheet (make sure the order of headers is same as in the example sheet provided below).
  3. Populate the sheet with some data.
    ##### Data Schema
    SPEAKERS                                                 SIGN UP
    name : string                                            name  : string
    title: string                                            email : string
    team: string
    location: string
    shortBio: string
    pronouns: string
    imageLink: string (url of hosted image)
    
  4. Change the tab name to "Speakers" (Tab name "Speakers" is case sensitive).

Example sheet: https://docs.google.com/spreadsheets/d/1XgyHXaReTZ3Nq_r7QS18GDvqK_ht010QqnI6PXAnePA/edit?usp=sharing


  • Deploy App Script Web App
  1. Open your google sheet.
  2. Click on Extensions tab.
  3. Click on App Script.

4. Delete all the code from the editor (inside Code.gs file).

        // Get requests
        function doGet(req) {
            if(req.parameters.sheetName == "Speakers") {
                return getSpeakersData()
            } else if(req.parameters.sheetName == 'Talks') {
                return getTalksData()
            }
        }

        // speaker requestHandler
        function getSpeakersData() {
            var doc = SpreadsheetApp.getActiveSpreadsheet()
            var sheet = doc.getSheetByName("Speakers")
            var values = sheet.getDataRange().getValues()

            var output = []
            for(var i=1; i<values.length; i++) {
                var row = {}
                row['name'] = values[i][0]
                row['title'] = values[i][1]
                row['team'] = values[i][2]
                row['location'] = values[i][3]
                row['shortBio'] = values[i][4]
                row['pronouns'] = values[i][5]
                row['imageLink'] = values[i][6]

                output.push(row)
            }

            return ContentService.createTextOutput(JSON.stringify({speakers: output})).setMimeType(ContentService.MimeType.JSON)
        }
        // talk requestHandler
        function getTalksData() {
            var doc = SpreadsheetApp.getActiveSpreadsheet()
            var sheet = doc.getSheetByName("Talks")
            var values = sheet.getDataRange().getValues()

            var output = []
            for(var i=1; i<values.length; i++) {
                var row = {}
                row['date'] = values[i][0]
                row['time'] = values[i][1]
                row['title'] = values[i][2]
                row['description'] = values[i][3]
                row['genre'] = values[i][4]
                row['speaker'] = values[i][5].split(',')
                row['speakersImageLink'] = values[i][6].split(',')
                output.push(row)
            }

            return ContentService.createTextOutput(JSON.stringify({talks: output})).setMimeType(ContentService.MimeType.JSON)
        }
        // post requests
        function doPost(e){
            let action = e.parameter.action
            if(action == "signup"){
                return signUp(e)
            }
        }
        // signup requestHandler
        function signUp(e){
            var doc = SpreadsheetApp.getActiveSpreadsheet()
            var sheet = doc.getSheetByName("signup") // name of your sheet where user details would be saved.
            let user = JSON.parse(e.postData.contents)
            sheet.appendRow([user.name,user.email])
            return ContentService.createTextOutput(JSON.stringify({status: "success", "data": "my-data"})).setMimeType(ContentService.MimeType.JAVASCRIPT);
        }

  1. Paste above code in the Code.gs file.
  2. Click on Deploy button and select New Deployment.

  1. Click on settings icon on select type menu and select web app.

  1. Add Description.
  2. Select Anyone in who has access section and click deploy.
  3. Authorize access. Google might say it's an unverified app and tell you to go back to safety its because the app that you are creating will have access to your sheet data but since you are developing the application so essentially you are accessing your data only, which is totally safe.
  4. Copy the Web URL. Make sure you do not share the Web URL with anyone else because if you do so then that person can access your data.
  • Configure local project
  1. Open project folder, go to src/utilities/env.js
  2. Replace the string webAppUrl with the Web URL you copied.

  1. Refresh the speakers page to see the results.

Contributing

Want to contribute and improve something here? I would love that! Check out thecontributing guidelines, then head to issues and look for open issues. If you need any help or clarification, just comment on there and let me know. Also, feel free to submit your own issues if you have ideas!

UPDATE: I am so excited by how many folks want to contribute to this repo! I'm trying to create new requests to keep up with the demand but if you have any ideas of how you can improve the app, please feel free to open an issue with your recommendations, and I'll be happy to review it and if it aligns, I'll assign it to you!

License

Source code in this repository is covered by (i) a dual license under the Server Side Public License, v 1 and the Elastic License 2.0 or (ii) an Apache License 2.0 compatible license or (iii) solely under the Elastic License 2.0, in each case, as noted in the applicable header. The default throughout the repository is a dual license under the Server Side Public License, v 1 and the Elastic License 2.0, unless the header specifies another license.

eui_event's People

Contributors

mengxuyigit avatar

Watchers

 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.