Code Monkey home page Code Monkey logo

showmyshow's Introduction

GitHub Last Commit GitHub Repo Size GitHub Followers GitHub

ShowMyShow

This is a repository for the ShowMyShow App, created by Puppy Road Trip, LLC.

Table of contents

General Info

ShowMyShow is an application that allows fans and bands to connect with one another. Users (fans or bands) can sign up using a valid email address and connect to a one-stop shop that allows them to find out tons of information on upcoming music events in a given city. Fans can search for concerts in a specific city and are returned a list of upcoming shows with specific information and links to tickets via Ticketmaster - fans can also save shows to their profile and come back to them at a later date. Bands are able to do the same - they can search for shows and find out information based on a specific city input. There is also a messaging function - the "Green Room" - where fans can connect with other fans to talk about MUSIC! Additionally, upon login, fans and bands alike are provided with a scrape of Tweets from the hashtage #ShowMyShow directly on their login page so they can keep current with any immediate information shared via Twitter.

Technologies and Sources

APIs

TicketMaster Discovery API

Twitter API

Live Link

ShowMyShow

Screen Shot

HomePageGif

Code Snippets

The below example code displays the Socket.io messaging functionality live in the production environment:

const http = require('http').Server(app);
const io = require('socket.io')(http, {
  cors: {
    origin: 'https://showmyshow.herokuapp.com/',
    methods: ['GET', 'POST'],
    allowedHeaders: ['chat'],
    credentials: true
  },
});

The below example code shows a custom hook that returns the Username from AWS Cognito authentication:

function useUserAuth() {
  const [userState, setUserState] = useState('');
  useEffect(() => {
    Auth.currentAuthenticatedUser().then((user) => {
      if (user.attributes.email === userState) return;
      setUserState(`${user.attributes.email}`);
    });
  });
  return [userState]
};

The below example code shows the User schema validation through MongoDB:

const userSchema = new Schema({
  username: {
    type: String,
    lowercase: true,
    required: true,
    validate: {
        isAsync: true,
        validator: function(value, isValid) {
            const self = this;
            return self.constructor.findOne({ username: value })
            .exec(function(err, user){
                if(err){
                    throw err;
                }
                else if(user) {
                    if(self.id === user.id) {
                        return isValid(true);
                    }
                    return isValid(false);  
                }
                else{
                    return isValid(true);
                }
            })
        },
        message:  'The email address is already taken!'
    },
},
  savedShows: {
    type: Array,
    ref: 'Show',
  },
});
const User = mongoose.model('User', userSchema);
module.exports = User;

The below example code allows a user to save a show to their username and prevents the user from saving the show twice:

Router.post('/:username/show', function (req, res) {
  const savedShow = req.body;
  User.findOneAndUpdate(
    { username: req.params.username },
    { $addToSet: { savedShows: savedShow } },
    { new: true }
  )
    .then(function (dbUser) {
      res.json(dbUser);
    })
    .catch(function (err) {
      res.json(err);
    });
});

Contact

Created by Puppy Road Trip LLC. Please reach out to us for future collaboration!

GitHub

Puppy Road Trip, LLC is:

Sloan Lacey

Jayme Mizelle

Joshua Rehanek

Shawn Flanigan

Sam Rogers

showmyshow's People

Contributors

joshrehanek avatar shawnmflanigan avatar sloanlacey avatar samrogers15 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.