Giter Club home page Giter Club logo

resource_library's Introduction

Resource Library

Empowering Hanawilo community members through a centralized resource hub.

Table of Contents

General Info

Resource Library is a powerful platform that enables registered community members to freely share links to various resources such as videos, events, articles, tools, and memes. This centralized and accessible website is an organized and user-friendly alternative to unstructured platforms like Slack.

The Resource Library fosters a vibrant community of learners and enthusiasts, simplifying the process of finding and sharing resources. This hub is an essential tool for knowledge sharing and collaboration.

Architecture Diagram

The simplified architecture of the Resource Library project:

Resource Library_stack_diagram

Technologies

Technologies used in this project include:

Backend

  • Node.js - version 18.15.0
  • Express - version 4.18.2
  • Bcryptjs - version 2.4.3
  • Body-parser - version 1.20.1
  • Cors - version 2.8.5
  • Dotenv - version 16.0.3
  • Express-async-handler - version 1.2.0
  • Jsonwebtoken - version 9.0.0
  • Mongodb - version 5.0.1
  • Mongoose - version 6.9.0

Frontend

  • JavaScript (ES6)
  • HTML5
  • CSS3
  • React.js - version 18.2.0
  • React-DOM - version 18.2.0
  • Next.js - version 13.1.6
  • Formik - version 2.2.9
  • React-Router-DOM - version 6.8.0
  • React-scripts - version 5.0.1
  • React-icons - version 4.7.1
  • React-player - version 2.11.2
  • React-slick - version 0.29.0
  • Framer-motion - version 9.0.1
  • Chakra-UI/react - version 2.4.9
  • Chakra-UI/icons - version 2.0.17

Development Tools

  • Concurrently - version 8.0.1
  • Nodemon - version 2.0.22 (Backend only)
  • Eslint - version 8.34.0 (Frontend only)

Setup

To set up and run the Resource Library project locally:

  1. Clone the GitHub repository:

    git clone https://github.com/hjkmines/resource_library.git
  2. Install frontend dependencies:

    cd client
    npm install
  3. Install backend dependencies:

    cd ../backend
    npm install
  4. Start development servers:

    cd ../client
    npm run dev

    This command uses concurrently to run the frontend and backend servers concurrently. It will automatically start the Next.js development server for the client and navigate to the backend folder to run the backend server.

  5. Visit http://localhost:3000 in your web browser.

    The application will automatically reload if you make any changes to the code. Both the frontend and backend servers need to be running concurrently for the application to work correctly.

Code Examples

Database Connection

The application connects to the MongoDB database using Mongoose as follows:

const mongoose = require('mongoose'); 

const connectDB = async () => {
    const conn = await mongoose.connect(process.env.MONGO_URL, {
        useNewUrlParser: true, 
        useUnifiedTopology: true
    })

    console.log(`MongoDB Connected: ${conn.connection.host}`)
}

module.exports = connectDB;

Handling a GET Request

The MediaController handles a GET request to fetch all media items like this:

const getMedias = async (req, res, next) => {
    try {
        const media = await Media.find();
        res
        .status(200)
        .setHeader('Content-Type', 'application/json')
        .json({message: 'Found media', media});
    } catch (err){
        next(err);
    }
}

React Component

This is an example of a React component from our application. This component, Videos, displays a grid of video cards fetched from our database. Each card includes a video player that embeds a video from a link, along with some additional information about the video.

  const renderCards = () => {
    if (!Array.isArray(renderedVideos)) {
      return null;
    }

    return renderedVideos.map((video, index) => (
      <Card
        key={index}
        my={5}
        maxW={{
          base: '250px',
          md: '325px',
          lg: '400px',
        }}
        rounded={'sm'}
        border={'1px'}
        borderRadius="md"
        borderColor="black"
        boxShadow={useColorModeValue(
          '6px 6px 0 black',
          '6px 6px 0 cyan'
        )}
      >
        <CardBody>
          <Container maxWidth="400px">
            <AspectRatio ratio={4 / 3}>
              <Center>
                <ReactPlayer
                  url={video.resourceLink}
                  width="100%"
                  height="100%"
                  controls={false}
                  volume={0}
                  muted={true}
                  playing={false}
                  fallback="Loading..."
                />
              </Center>
            </AspectRatio>
            <Stack mt="6" spacing="3">
              <Heading size={{ base: 'sm', md: 'sm', lg: 'md', xl: 'md' }}>
                {video.title}
              </Heading>
            </Stack>
          </Container>
        </CardBody>
      </Card>
    ));
  };

Features

  • Full stack web application utilizing the MERN stack: MongoDB, Express.js, React, and Node.js.
  • User authentication and authorization implemented with JWT and bcrypt.
  • Users can create, log in, and manage their accounts within the application.
  • Users can share various types of resources, which appear on the corresponding page.
  • The home page features the latest resources from each section.
  • Dark mode available for an alternative user interface aesthetic.

Contact

Created by Kristina Degtiareva, Mai Vang, Thomas Bell, Jerry Victor, Maria Delacruz, Tyson Mills

Feel free to contact us with any questions!

resource_library's People

Contributors

hjkmines avatar jvictor940 avatar kristenking avatar mf-dlcz avatar thomas065 avatar tmills5 avatar vmaineng avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

resource_library's Issues

Adjust Display and Sizing of Pictures in TodayPic Component

In the TodayPic component, currently the pictures are displayed in a column, one on top of another. We would like to improve this by having them display in a grid layout that will adjust depending on the size of the viewport.

Things to work on:

  1. Modify the grid layout to display images side by side. The exact number of images per row should be responsive, depending on the size of the screen. This might be 2-3 pictures in a row for larger screens.

  2. Adjust the sizes of the images so they fit neatly within the grid. The images should scale responsively with the size of the grid cells.

  3. Standardize the size of the arrow icon and the font size of "more laughs" text at the bottom of the component. They should match the sizes used in other components.

Add path to Tools Page

Problem Description

When navigating to the "Tools" page from the navbar, the application redirects to a 404 page. All other navigation links (videos, images, articles, etc.) are working correctly.

Steps to Reproduce

  1. Go to the homepage or any other page with the navbar.
  2. Click on the "Tools" link in the navbar.
  3. Observe the 404 error page.

Expected Behavior

Clicking on the "Tools" link in the navbar should lead to the Tools page.

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.