Giter Club home page Giter Club logo

exercise-meetup-clone-react's Introduction

Meetup Clone with Context API

Technologies: HTML, CSS, JS, React, React Hooks, React Router and React Context API.

Meetup.com Clone

๐Ÿ‘†This project is optimized for groups of 2 or max 3 students.

Hello! It is time to begin creating professional front-end applications. This time we will be building a small Meetup.com clone that allows users to Browse and RSVP events, very similar to how Meetup.com works.

๐Ÿ“นHere is a video on how the application must work

  • Event's is the main Entity on this application, the main view (Home) will have a list of Event's organized by date.
  • Each Event is linked to a single Group.
  • A Group can be linked to one or more Event's (one to many).

This project is meant to be done in two phases

First we want to focus on the visuals, make sure the viewable structures are working correctly. Secondly, we should implement dynamic data display.

Phase 1: Create the views, then link them with React Router in your Layout Component.

Each group must create the following views:

  • Home (List of Events)
  • Event detail (View of a specific Event)
  • Group detail (View for the Group with a list of upcoming events for the group)
๐Ÿ—’NOTE: You should draw wireframes first to gather your ideas. Also, make sure to use dummy content initially. PLEASE USE MEETUP.COM AS A DESIGN REFERENCE!

Each Group entity must have

- Title
- Description
- Members

Each Event Entity must have

- Title
- Description
- Date
- Time
- Group (This is an ID for the group)

After you finish your wireframes, get to coding. Please make sure to only use functional components and if you need to define state variables or do something during the component lifecycle, use the corresponding hooks. (useState() and useEffect())

Note: Think DRY (Don't repeat yourself) and declare only one component and use props to handle similar structure but different content. Context should be used only when you need to share data between many views. Always use props when you can and context sparingly.

REMEMBER: Anchor tags will cause a redirect, which you don't want in React. Be sure to import and use the Link component from React Router to implement the navigation between views.

<Link to="/event">
    Title of event
</Link>

Phase 2: Make the app dynamic by implementing React Context

React context is built into the flux boilerplate. If you are having trouble understanding how context works, please take a look at the demo component that comes with it. (In your views folder)

Use the store to fill the dummy content within the views/components. The store is accessible using the Context.Consumer

Reference: Using the Context

The store structure (/store/store.js):

Below, you will find an example of the date for the Meetup clone. This consists of 2 arrays (events and meetups) and an abject for the user session.

You can replace your current store object with this data and even expand it to add more events and groups. Remember that this is placeholder data for now. Later on, we will be using fetch to pull the data in from an API.

store: {
    events:[
        {
            ID: 36,
            post_content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nec libero consectetur risus vehicula interdum eu at elit. Proin a commodo erat, eu molestie ipsum. Aliquam tristique nunc a est tristique, et convallis risus ullamcorper. Fusce nec massa ac enim pellentesque ornare. Pellentesque non sapien varius, pellentesque tellus sit amet, facilisis justo. Duis rhoncus nunc id elementum dapibus. Sed dictum lacinia vestibulum.",
            post_title: "Lorem Event",
            meta_keys: {
                day: "20180428",
                time: "07:00:00",
                _groupId: 9,
                _rsvpNo: [
                    "robert",
                    "jjtime",
                    "username2"
                ],
                _rsvpYes: [
                    "cheeselover",
                    "neweradude",
                    "james1996"
                ]
            }
        }
    ],
    Groups:[
        {
            ID: 9,
            post_content: "The nicest Meetup ever",
            post_title: "Tech Enthusiasts",
            members: [
                "robert",
                "jjtime",
                "username2",
                "cheeselover",
                "neweradude",
                "james1996"
            ]
        }
    ],
    session:{
        ID: 2,
        username: "theUser",
        user_friendly_name:"Joey",
        token: "qwerty12345asdfgzxcv"
    }
};

In order to have access to the global data from your store in one of your components, you must import the Context. See the example below.

import { Context } from '/path/to/store/appContext.jsx';

const MyView = () => {
    const { actions, store } = useContext(Context);
    //Then use the Consumer anywhere on the component
    return (<span> hello, {store.events[0].post_title} </span>);
}

All of your Fetch/AJAX calls should be in the useEffect() section of the appContext.js file. Due to the way the boilerplate is built, this area handles the calls that are done only at the initial load of your application.

๐ŸŒฑ How to start this project

Do not clone this repository.

  1. The first step to start coding is cloning the react flux boilerplate on your local computer or gitpod.

a) If using Gitpod (recomendada) you can clone the boilerplate by clicking here.

b) If working locally type the following command from your command line:

$ git clone https://github.com/4GeeksAcademy/react-hello-webapp

๐Ÿ’ก Important: Remember to create a new repository, update the remote (git remote set-url origin <your new url>), and upload the code to your new repository using add, commit and push.

  1. Install the dependencies $ npm install.

  2. Run the WebPack development $ npm run start.

  3. That's it! Time to code.

"The scariest moment is always before you start" Stephen King

exercise-meetup-clone-react's People

Contributors

alesanchezr avatar elviraqdp avatar mortegac 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.