Git Product home page Git Product logo

flipster's Introduction

Flipster

Flipster logo

Flashcard revision web application with (planned) $\LaTeX$ support.

Installing

See Development Setup

Contributing

See the style guide

Commands

Using make Make has several useful commands configured. The most useful one is make run, which will run the front end and the back end and update both when files are modified.

This requires cargo watch, which will rerun a cargo command when a file change is detected. In this case, make run will use cargo watch -x run

If you have tmux and would like to use it, make run-tmux will start the front and back end in separate tmux sessions. make stop-tmux will kill these sessions

Manually To run the front end, go to the web directory (cd web), and run:

yarn dev -p 5173

Where -p specifies the port number of the website


To run the back end, go to the 'api directory (cd api`), and run:

cargo run

If you would like it to automatically rebuild when you make file changes, see Using make for how to install cargo watch, then use the following command instead of above:

cargo watch -x run

Finally, go to http://localhost:5173 to view the website

Running

You can run both web and API at the same time using make run, or make run-tmux to run the web and API in separate tmux sessions

Linting can be run on both web and API using make lint, and similarly for make format

Directories

API

  • The backend API of the website
  • Handles connecting to database
  • Uses actix for serving the API and sqlx to connect to the database
  • Written in Rust ๐Ÿฆ€

Web

  • The frontend of the website
  • Uses React, NextJS and TypeScript
  • Tailwind CSS for styling

flipster's People

Contributors

jacob-horton avatar

Stargazers

 avatar Tom Heaton avatar  avatar  avatar

Watchers

 avatar  avatar

flipster's Issues

Fix renaming folders [files] [fix]

When you double click on a folder name to rename it and then clicking off (without renaming it), the text bar should disappear and go back to the previous name. On new creation, placeholder text. On edit, normal text.

Select flashcards by default

In the review page (web/src/pages/review/index.tsx), selecting a folder displays a list of 'accessed' flashcards. These are currently unselected by default and then appended to the 'selectedFlashcards' map when selected.
Instead, the functionality should be to select them by default. The folder, when selected, should append all flashcards to the map, and update them if they are deselected or reselected.

Create STYLEGUIDE.md

It might be useful to create a style guide for consistency in clarity as well as to serve as a useful reference.
Some possible points of discussion:

  • Type naming conventions in requests/response (as mentioned by @jacob-horton )
    Currently types are defined in Rust and exported using ts-rs into web/src/types. We currently use XGet or XInsert to describe types passed to requests (GET or POST, respectively) but this convention is up for debate.

  • CSS practices

A proposed system for something akin to encapsulation:

  • When passing a className to a defined component, it should apply only to the outermost element and not contradict any other styles.
  • I also think a set width, height, and display: block should be present on an element containing children passed in through props - this means children can be layed out by replacing the children passed with a <div className="w-full h-full"> without resulting in unexpected behaviour, say from using a flexbox or lack of.
return <div className={className ?? ""}> // no other styles here
    {someReactNode}
    <div className="w-full h-full">{children}</div> // block by default
</div>
  • Component conventions?
    I have personally just been naming components based on what feels right and what the surrounding files have used.
    We write components as const Component = ({ propOne, propTwo }) => { ... } but this can easily be seen by looking at code in the repository.

  • Tailwind style class ordering?
    As for me, I currently use something like flex size flex-parent-properties flex-child-properties styling (flex-parent-properties e.g. justify-content, align-items) (flex-child-properties e.g. align-self, grow, shrink). Formalising this could be pedantic, though.

  • Prettier + ESLint

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.