Code Monkey home page Code Monkey logo

professor's Introduction

Installation

  1. Fork the repo and clone it locally
  2. Run 'npm install'
  3. To start the server, run npm run dev

The repo is a Next.js repo. You can read more about Next.js here

Setting up Firestore

Note - if you just want to work on non Database related features, at the bottom of index.tsx there's an alternative getServerSideProps which will return mock data that is identical to the data from the db.

If you are just working on FE features i'd suggest using this as it saves a lot of setup

But, if you need to setup the database :-)

  1. Go to https://console.firebase.google.com/ and click Add project
  2. Click on the Cloud Firestore button (it's a big orange sqaure on the page) and click on Create Database
  3. In the wizard, choose Production mode
  4. Select a location (preferably eu-something..)

Once your database is created, in the sidebar, next to Project overview, there's a Cog icon. Click it, and navigate to Project settings -> Service accounts

  1. Click on Generate new private key
  2. Once the key is generated, you will have a button that downloads a json file
  3. In the root of the project, create a file called serviceAccountKey.json and paste the content of your downloaded json file. Note: This file is in the .gitignore, but make sure you don't commit it!
  4. run the app (npm run dev)
  5. The first run of the app will create an initial board in your firebase DB. You can then comment out the lines in index.tsx that have the comment Seed data above them. (If they are commented out, you'll need to un-comment them and refresh for the seeding to happen)

Contributing

See our open issues, and thanks for taking a part in this project!

Join our Slack workspace using this link

professor's People

Contributors

uriklar avatar marcosmol204 avatar shvekyha avatar amirbh1106 avatar lurx avatar

Stargazers

Yoel Naki avatar  avatar  avatar Sara Mazal avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

professor's Issues

Add option to edit board

we should have an /edit/ID path that fetched the board and renders it in the create form.
This requires to extract create.tsx into a component. We can pass it an onSubmit prop that either creates a board or updates a board

Fix ID issue

This the way board ids are currently generated:
username (which the user enters) + random 4 digit number

This was a very bad design choice ๐Ÿคฆโ€โ™‚๏ธ as what can happen now is that the a user can randomly get the same 4 digit number and accidentally overwrite a previous board of his without knowing.

What I think we should do:
In the [id].tsx and index.tsx getServerSideProps we already have a query that fetches all board ids.

  1. call that same query in the create page.
    2.I want to change the ids to be serial instead of random, so we should find the first id of this user and get the next id (need to make sure it's not taken already)

I added mock ids to the create page so you don't have to connect to firebase to work on this feature. So you can run npm test to see if it passes.
You can also add your own tests if you need..

It's on this branch:
https://github.com/uriklar/professor/compare/issue-15-fix-ids

Add like button

Open questions:
Do we need a downvote button?
Should like appear from the start? Or maybe after solving some part of the board?

Content:

  1. Add the like button on the screen
  2. Add likes to data model (number field)
  3. Save in local storage which boards I liked
  4. Create api endpoint that creates the actual like
  5. Show user if he liked a board of not

Add tags to board

Add option for boards to have tags (some boards may have a specific topic: Sport, Emoji, numbers etc...)

Open issues

  • Basic design

  • Add ability to enter answer for a category

  • Create board form

  • Persist progression data in local storage

  • Screen for creating a board (will be detailed in a separate issue)

  • Fetch board from DB by id in url

  • Create DB and integrate with it (firebase?)

  • Open graph tags and other meta tags

  • Favicon

  • Deploy somewhere (probably vercel)

  • Handle long words

  • Add husky and lint-prepush (to execute TS/Eslint/Prettier checks before push)

  • Contribution guide - what you need to setup to get going

  • Create a script to seed a test database

  • User login - Show all boards by user, show all boards solved by user, show profile info on the user's boards

  • Write copy for rules of creating a category

  • Tests - jest unit tests for game logic, Maybe some Cypress tests if someone feels like it (I can guide you how to integrate it with Github actions)

Authentication

  1. Save the user details (name, id) in the local storage and in the db as one of the board fields.
  2. Try local sign-in from store.tsx --> HydrateBoard

Squares should not be tab-able when matched or answered

In Square.tsx you have the Container component which has tabIndex: 0;
This makes squares accessible by tabbing. But, once the itemState is either AnswerState.Matched or AnswerState.Answered
there's no reason for them to be tab-able since the user can't interact with them.

You can make Containers attrs dynamic by having it accept props. Something like:

.attrs( props => ({ role: "button", tabIndex: props.isTabbable ? 0 : 1}))

Now, when a category is found or answered, pressing tab should skip it.

Add sort by solved status

Sort (asc/desc) by how many categories where matched/answered.
Sort example:
3 answered > 2 answered + 1 matched
3 matched > 2 answered

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.