This is a repository for the ShowMyShow App, created by Puppy Road Trip, LLC.
- General Info
- Technologies and Sources
- APIs
- Messaging Functionality
- Database Integration
- Live Link
- Screen Shot
- Code Snippets
- Contact
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.
-
- Amplify
- Cognito
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);
});
});
Created by Puppy Road Trip LLC. Please reach out to us for future collaboration!
Puppy Road Trip, LLC is: