Skip to content

mehdisafari77/investomania

 
 

Repository files navigation

investomania

Table of Contents
  1. About The Project
  2. Getting Started
  3. Code-Snippet
  4. License
  5. Collaborators
  6. Project Links
  7. Acknowledgements

About The Project

investomania Webpage

For this project, we decided on creating a pre production crowdfunding application that would allow users to see what kind of support they would recieve before crowdfunnding their project/application. Other users can back or donate to support the project of their likings. It tested all of our previous knowledge and we were constantly researching to ensure we had the best product we could deliver to the user!

The websites we used to help create our project are listed below in the acknowledgements.

Built With

We used Visual Studio Code to create the Handlebars, CSS and Javascript from scratch. We had the help of Bootstrap for formatting the Handlebars and Node.js to help with the coding on the Javascript!

Getting Started

When loading this webpage, you are greeted with several projects from other users. To click on a project, you must be logged in first or sign up. When logging in or signing up, you will greeted to the dashboard where the user can create a new project or view previous projects.

Code Snippets

We had to create a function where the user could pick a day when to end their crowdfunding campaign. When they chose a day, it needs to be formatted then saved with the rest of the project details.

Below is the first part of the function that when a user selects a date, it will get the value and convert it into a formatted date that can be stringified.

var field = document.getElementById('project-datepicker');
var picker = new Pikaday({
    onSelect: function(date) {
        field.value = picker.toString();
        console.log(date.toLocaleDateString());
        
    }
});
field.parentNode.insertBefore(picker.el, field.nextSibling);

For some reason, we had trouble creating a post method that would gather the users inputted data from creating a project and stringify them into JSON format. After some debugging, we created a new function that would create a post method.

Below is grabbing all the values from the data input and stringifying it into JSON format and storing it session storage.

const saveProject = (event) => {
  event.preventDefault();
  let projects = {
    title: projectTitle.value.trim(),
    description: projectDesc.value.trim(),
    image: projectImg.value.trim(),
    contributor: projectCont.value.trim(),
    date_picker: projectDate.value.trim(),
    backing: projectBacking
  }
  fetch('/api/projects', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json'},
    body: JSON.stringify(projects)
  })
};

License

Distributed under the MIT License. See LICENSE for more information.

Collaborators

Sami Khawja: GitHub

Mehdi Safari: GitHub

Umera Malek: GitHub

Project Links

Project Link: GitHub

Live Link: investomania

Acknowledgements

About

Express Interest in the Future

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 52.0%
  • Handlebars 25.3%
  • CSS 22.7%