Plant trees to harvest apples. Sell apples to buy upgrades. Sell apples and wares to make the most money and top the leaderboard!

Overview

Happy Harvesters Apple Orchard Game

A browser based game that is also mobile friendly so you can finally say "How about THEM apples".

Table of Contents

Game Description

This is a grow-your-own apple orchard simulator app game.

Grow your own apple tree, sell apples, and make money!

Use your hard earned profits to buy more trees

OR

Upgrade your enterprise and sell delicious:

  • apple pies
  • apple sauce
  • apple juice! Yum!

User Story

  • As a grade-school child, I am looking for a fun game I can play on the internet SO THAT I can be entertained and learn about running a make-believe apple business.

  • As a parent, I want a browser-based computer game that is family friendly and easy to play SO THAT my kid can have some free time and stay safe on the web.

  • As a person on the move, I want a multi-platform game SO THAT I can play no matter where I am and what device I’m on.

Tools, Technologies, Languages

  • CSS
  • JavaScript
  • JSX
  • React
  • Node
  • GraphQL
  • Jest for testing purposes
  • MongoDB, Mongoose
  • Apollo
  • Express.js

JavaScript Badge CSS Badge

Screenshot

happy-harvesters-login

my-orchard-sc

Credits

Installation

Clone the repository

git clone [email protected]:scottrohrig/apple-orchard-games.git

Navigate into the repository's root directory

cd apple-orchard-games

Install dependencies

npm install && npm run install

Run the project in development mode

npm run develop

Future Ideas

  • Mutant Pineapples / Holiday Event
  • Other fruits: Peach? Orange? Pear?
  • Auto Harvesting / Selling?
  • Daily apple jokes on log-in
  • Custom Artwork, more animations
  • Sound effects
Comments
  • Placeholder tree component

    Placeholder tree component

    Description

    A JSX component that stands in place of an empty orchard plot of land, with a button to purchase a tree.

    HTML

    The returning JSX from the component should include :

    • [x] item container - to keep all items and trees the correct size
    • [x] image or background image to signify there is a space for the tree to be planted
    • [x] purchase button with an onClick attribute to handlePurchase function

    JavaScript

    • [x] imports
    • [x] component function
    • [x] handlePurchase function to handle the button onClick event
    • [x] how does this placeholder know which orchard to add a tree to?
      • [x] should we use useParams and get the orchardId?
    • [x] export component
    opened by scottrohrig 4
  • Make `User` model /schemas

    Make `User` model /schemas

    Description

    Let's make this first so we can get authorization implemented early also!

    Requirements

    It is done when

    1. the user model has all the appropriate fields for a basic user.

      • [x] _id,
      • [x] username,
      • [x] email,
      • [x] password,
      • [x] appleCount,
      • [x] money,
      • [x] gemCount,
      • [x] TBD - inventory { [trees], [juicers], [ovens], [mashers] }
    2. we can perform each a User object from the GraphQL sandbox explorer

      • [x] GET
      • [x] CREATE
      • [x] UPDATE
      • [ ] DELETE
    opened by scottrohrig 4
  • Marketplace modal component

    Marketplace modal component

    Description

    We need a marketplace / shop component that pops up when clicking on the shop icon within the header. For now we just need the placeholder elements with two spaces for purchasing gems (e.g., 5 gems for $5 & 30 gems for $25, etc.) and two spaces for exchanging gems for temporary speed boosts (e.g., sell all inventory, coming soon, etc.)

    milestone-1 
    opened by scottrohrig 2
  • Create `login` / `signup` pages

    Create `login` / `signup` pages

    Description

    Make react component functions for both the login and signup pages

    Requirements

    It's complete when there is a form with inputs and a button for each page

    • Login: email, password, login button
    • Signup: username, email, password, signup button
    opened by scottrohrig 2
  • Re-route user to home if logged in

    Re-route user to home if logged in

    Description

    When a user is logged in and navigates to /login the login page displays. When a user is NOT logged in and navigates to /home or any other page, the target page displays.

    opened by scottrohrig 1
  • Profile page

    Profile page

    Description

    A profile page should have the user's username and email, as well as a logout button with the functionality of terminating the user's current session.

    enhancement 
    opened by scottrohrig 1
  • Orchard Page HTML

    Orchard Page HTML

    Description

    The orchard page should have html elements for all of the following (and possibly more)

    HTML

    • [x] header (import component)
    • [x] back button to go back to dashboard
    • [x] orchard container
    • [x] rows of trees (for now just a list of trees )
      • [ ] future: add row containers
    • [x] orchard title
      • [x] future: with edit button to change it to an input and back to a title
    • [x] placeholder for unplanted tree location (imported component: needs to be made see issue #6

    Orchard Page JS #8 view sister issue

    opened by scottrohrig 1
  • Convert login/signup to single splash page

    Convert login/signup to single splash page

    Current:

    • Login and Signup are separate pages (with some currently broken css)

    Plan:

    • [x] Create animated splash page
    • [x] Combine login/signup to be a single page
    • [x] Create login button that opens a login modal
    • [x] Make a toggle to switch between login modal and signup modal
    • [x] Mobile responsive coding
    enhancement 
    opened by JColeCodes 0
  • Reset all stats button

    Reset all stats button

    Description

    A button on the profile page to handle setting all the users stats back to default.

    This will require __ steps

    1. Create the mutation

      identify whether a mutation exists to pass in all the necessary stat fields and if not make one

      1. check server/schemas/typeDefs.js for the mutation
      2. The stats that should be reset are
        • money, appleCount, trees, juicers, mashers, ovens
      3. The mutation should take in an objectId id and return a User

      EX:

      // server/schemas/typeDefs.js
      const typeDefs = gql`
        ...
        type Mutation {
          ...
          resetUserStats(): User
        }
      `;
      
    2. Create the resolver to resetUserStats

      // server/schemas/resolvers.js
      const resolvers = {
        ...
        Mutation: {
          ...
          resetUserStats: async function( parent, args, context ) {
              // this should find a `User` using the `context.user._id`
              // then `$set` the new stats to the `args` passed in
      
              return user
          }
        }
      
      }
      
    3. Test the functionality in Apollo Sandbox

      This mutation should be easy to import after testing using the Apollo Sandbox Explorer

      1. navigate to https://studio.apollographql.com/sandbox/explorer
      2. make sure the endpoint directs to http://localhost:3001/graphql

      Create a new tab at the top, then click on the Documentation button in the left inner sidebar. The icon looks like a piece of paper.

      If you have not created an account, signup because it will be quicker. Otherwise you have to type everything manually.

      Login first using the following Operation with a known user's email and password

      // Operation `login`
      mutation login($email: String!, $password: String!) {
        login(email: $email, password: $password) {
          token
          user {
            _id
            username
          }
        }
      }
      

      In the Variables pane at the bottom, add a user you have created.

      // Variables
      {
        "email": "[email protected]",
        "password": "pw123"
      }
      

      Then copy the token from the Response pane on the right.

      Add the token to the Headers

      | | | | | | --- | --- | --- | --- | | ☑ |Authorization| <token> | ✖ |

      If you are logged in, you can import the mutation easily by clicking on the mutation option in the Root Types (see Documentation tab in the left sidebar).

      From the list of mutations you shoul be able to se the resetUserStats mutation you just created and click the plus button to add it to the Operation pane.

      From here you can import all of that mutation's Arguments and Fields, making sure to add in the _id of any subdocuments (ie, juicers)

    4. Copy that mutation into the client-side mutations.js

      If the test works, then open the client side mutations file and add a new exported constant to reset the user stats

      // client/src/utils/mutations.js
      ...
      export const RESET_USER_STATS = gql`
        // paste the working mutation here from the sandbox
      `;
      
    5. Create the reset ALL stats button in the profile page.

      1. Make the button

        In the profile page make a new button element in the Stats container

        Style the button with a btn btn-shop className for now

      2. Add a button handler (eg, handleResetAllStats)

        also add an event handler to handle when the button is pressed.

      3. import the mutation from mutations.js

        // client/src/pages/Profile.js
        // import { RESET_USER_STATS } from '../utils/..
        // import useMutation
        
        function Profile() {
          ...
          // define the mutation function and set it equal to useMutation(RESET_USER_STATS, { variables: { pass in the variables here }})
        
          ...
        
          // define the event handler
        
          return (
            <div>
              ...
              {/* Add button near 'STATS' */}
            </div>
          )
        }
        
        
    opened by scottrohrig 0
  • username, email, and password should not be hard coded in GlobalProvider

    username, email, and password should not be hard coded in GlobalProvider

    If we need to have these items in GlobalProvider (I don't think we do because we have the JWT?), they should come from the initial sign in or from the server....

    opened by stuart-rickard 0
  • Add page transitions

    Add page transitions

    • [x] Install react-transition-group from npm
    • [ ] create CSS for smooth page transitions

    Possibly:

    • Check if I can add different transitions depending on the page
    enhancement 
    opened by JColeCodes 0
  • Additional Styling To-Do

    Additional Styling To-Do

    • [x] Add apple image as tab icon
    • [x] Remove fonts not in use
    • [x] Update react-router-dom to v6 -- Implement back navigation button
    • [x] Shop CSS
    • [x] Profile CSS
    • [x] Fix CSS bugs -- Navigation buttons on mobile view
    • [x] Clean up CSS files

    This list will be edited to include more things

    enhancement 
    opened by JColeCodes 0
A simple Node.js ORM for PostgreSQL, MySQL and SQLite3 built on top of Knex.js

bookshelf.js Bookshelf is a JavaScript ORM for Node.js, built on the Knex SQL query builder. It features both Promise-based and traditional callback i

Bookshelf.js 6.3k Jan 2, 2023
A MongoDB-like database built on top of Hyperbee with support for indexing

hyperbeedeebee A MongoDB-like database built on top of Hyperbee with support for indexing WIP: There may be breaking changes in the indexing before th

null 35 Dec 12, 2022
Illustration of issues around use of top-level await in Vite apps

vite-top-level-await-repro Illustration of issues around use of top-level await in Vite apps: https://github.com/vitejs/vite/issues/5013 Top-level awa

Rich Harris 6 Apr 25, 2022
The leaderboard website displays scores submitted by different players.

Leaderboard The leaderboard website displays scores submitted by different players. It also allows you to submit your score. All data is preserved tha

Victor Chukwuemeka 2 Dec 23, 2021
Make ORMs great again!

OPENRECORD is an ActiveRecord inspired ORM for nodejs. Currently it supports the following databases/datastores: SQLite3, MySQL, Postgres, Oracle, RES

Philipp Waldmann 485 Oct 5, 2022
It is a Discord bot whose goal is to make it easier for server owners to create a so-called Staff/Mode Application

Application Bot MeCodes Application Bot It is a Discord bot whose goal is to make it easier for server owners to create a so-called administration sub

null 26 Dec 12, 2022
This is a boilerplate for Nodejs (Nestjs/typescript) that can be used to make http server application.

Hexagonal architecture Table of Contents Overview Code architecture source code Service build information Regular user Advanced user Deployment Helm K

Moeid Heidari 20 Sep 13, 2022
AlaSQL.js - JavaScript SQL database for browser and Node.js. Handles both traditional relational tables and nested JSON data (NoSQL). Export, store, and import data from localStorage, IndexedDB, or Excel.

Please use version 1.x as prior versions has a security flaw if you use user generated data to concat your SQL strings instead of providing them as a

Andrey Gershun 6.1k Jan 9, 2023
ORM for TypeScript and JavaScript (ES7, ES6, ES5). Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.

TypeORM is an ORM that can run in NodeJS, Browser, Cordova, PhoneGap, Ionic, React Native, NativeScript, Expo, and Electron platforms and can be used

null 30.1k Jan 3, 2023
A query builder for PostgreSQL, MySQL and SQLite3, designed to be flexible, portable, and fun to use.

knex.js A SQL query builder that is flexible, portable, and fun to use! A batteries-included, multi-dialect (MSSQL, MySQL, PostgreSQL, SQLite3, Oracle

knex 16.9k Jan 4, 2023
TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, MariaDB, PostgreSQL and SQLite databases.

TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, MariaDB, PostgreSQL and SQLite datab

MikroORM 5.4k Dec 31, 2022
Azure Data Studio is a data management tool that enables you to work with SQL Server, Azure SQL DB and SQL DW from Windows, macOS and Linux.

Azure Data Studio is a data management tool that enables working with SQL Server, Azure SQL DB and SQL DW from Windows, macOS and Linux.

Microsoft 7k Dec 31, 2022
A Gmail Clone which built with ReactJS and Redux. You can sign in with your Google Account, compose a new e-mail and send realtime emails to the project.

Gmail Clone with ReactJS A Gmail Clone that you can sign in with your Google Account, compose a new e-mail and send realtime emails to the project. Cl

Özge Coşkun Gürsucu 49 Nov 14, 2022
Senior Design Project. Water intake tracker. Software for the communication to bottle and app. Software for app and database

WaterMate Senior Design Project. Water intake tracker to provide everyone with an easy to use water tracking system that can be integrated with your f

null 3 Nov 10, 2021
Fastify is a web framework highly focused on providing the best developer experience with the least overhead and a powerful plugin architecture, inspired by Hapi and Express.

Fastify is a web framework highly focused on providing the best developer experience with the least overhead and a powerful plugin architecture, inspired by Hapi and Express.

Jared Hanson 5 Oct 11, 2022
Fast and advanced, document based and key-value based NoSQL database that able to work as it is installed.

About Fast and advanced, document based and key-value based NoSQL database that able to work as it is installed. Features NoSQL database Can be run as

null 6 Dec 7, 2022
XML/HTML parser and processing library for JavaScript and TypeScript

[VIEW DOCUMENTATION] Robin is an XML parser and processing library that supports a sane version of HTML. It features a set of DOM utilities, including

null 15 Oct 5, 2022
Fast and advanced, document-based and key-value-based NoSQL database.

Contents About Features Installation Links About Fast and advanced, document-based and key-value-based NoSQL database. Features NoSQL database Can be

null 6 Dec 7, 2022
Explore, create and deploy your SQLite databases right from your browser. Quick and easy, no installation required.

SQLighter (under development, alpha code) SQLighter is a database explorer born for SQLite that helps you design and deploy your application database

sqlighter 11 Sep 20, 2022