rocketmeme

โšก A multipurpose meme marketplace and editor for creating, downloading and sharing memes with a ready to use API powered by Hasura GraphQL

MIT License

Stars
35

๐Ÿ‘€ Preview

Click this link to view rocketmeme

๐Ÿงฉ Prerequisites

In other to run our react app, make sure you have the following installed locally.

  • Node.js - vite requires node at least version 10.16.0

Clone this repository

Clone this repository to your local machine.

git clone https://github.com/Evavic44/rocketmeme.git

Cd client

Change directory into the client folder. This is where the frontend code lives.

cd client

Install NPM

npm install

Run

Run the development server to view the app.

npm run dev

Now you can navigate to http://localhost:3000 to view the app.

Build

npm run build

This is a preview of your dev server.

Serve

npm run serve

This is a preview of your build

Rocketmeme API

/* API Endpoint */
https://rocketmeme-user.hasura.app/v1/graphql

With Hasura, we were able to create a serverless API using Hasura cloud. The API exists for two types of requests: The meme template and the uploaded memes. If you're interested, you can start exploring the API docs to get an idea of everything possible with the rocketmeme API.๐Ÿ’›

API Docs

async function fetchGraphQL(operationsDoc, operationName, variables) {
  const result = await fetch(
    "undefined",
    {
      method: "POST",
      body: JSON.stringify({
        query: operationsDoc,
        variables: variables,
        operationName: operationName
      })
    }
  );

  return await result.json();
}

const operationsDoc = `
  query MyQuery {
    meme_templates(order_by: {id: asc, image_link: asc, title: asc}) {
      id
      image_link
      title
    }
  }
`;

function fetchMyQuery() {
  return fetchGraphQL(
    operationsDoc,
    "MyQuery",
    {}
  );
}

async function startFetchMyQuery() {
  const { errors, data } = await fetchMyQuery();

  if (errors) {
    // handle those errors like a pro
    console.error(errors);
  }

  // do something great with this precious data
  console.log(data);
}

startFetchMyQuery();

๐ŸŽจ Styling

Styling is done using styled-components and css3

Style Guide A preview of the style guide.

๐Ÿค๐Ÿพ Contribution

Are you contributing to this project, please ensure all pull requests and contributions comply with our guidelines. Before making any changes, ensure you have raised an issue here, unless it is a minimal change.

๐Ÿ“ Folder Structure

โ”œโ”€โ”€ client
โ”‚   โ”œโ”€โ”€ public
โ”‚   โ”‚   โ”œโ”€โ”€ images
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ../
โ”‚   โ”‚   โ”œโ”€โ”€ Robots.txt
โ”‚   โ”‚   โ”œโ”€โ”€ _redirects
โ”‚   โ”œโ”€โ”€ src
โ”‚   โ”‚   โ”œโ”€โ”€ Components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ../
โ”‚   โ”‚   โ”œโ”€โ”€ pages
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ../
โ”‚   โ”‚   โ”œโ”€โ”€ App.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ index.css
โ”‚   โ”‚   โ”œโ”€โ”€ main.jsx
โ”œโ”€โ”€ src
โ”‚   โ”œโ”€โ”€ controllers
โ”‚   โ”œโ”€โ”€ middlewares
โ”‚   โ”œโ”€โ”€ models
โ”‚   โ”œโ”€โ”€ routes
โ”‚   โ”œโ”€โ”€ services
โ”‚   โ”œโ”€โ”€ utils
โ”‚   โ”œโ”€โ”€ index.js
โ”œโ”€โ”€ .env.example
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ .gitpod.yml8
โ”œโ”€โ”€ CODE_OF_CONDUCT.md
โ”œโ”€โ”€ CONTRIBUTING.md
โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ package.json

This structure is completely flexible and bound to change. Updates to this tree is done manually till we find a suitable generator ๐Ÿ˜ฟ

๐Ÿ” License

This project is protected by MIT License.

๐Ÿ’ต Sponsor

Consider supporting us buy buying us a coffee or two. We appreciate every donation.

If you like this project, kindly star โญ and share this project. It means the world to us.

Contributors โœจ

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

Badges
Extracted from project README
All Contributors
Related Projects