Git Product home page Git Product logo

filipwroblewski / flashcardapp Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 74 KB

A simple website with flashcards that contain information. After entering the site a random card containing information appears; after an activity, it appears the second, having information related to it. Then the user can draw a new card. There are questions stored in the database.

PHP 94.90% Hack 0.68% JavaScript 1.27% SCSS 3.15%
bootstrap documentation flashcards gitflow-workflow mvc-architecture mysql php prototype scss team-members

flashcardapp's Introduction

FlashcardApp

MVC Structure

FlashcardApp
├───config
├───controllers
├───models
├───public
│   └───css
├───scss
└───views

Set Up Database

Create database

CREATE DATABASE flashcards CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;

Create tables flashcards, categories

CREATE TABLE flashcards (
  id INT AUTO_INCREMENT PRIMARY KEY,
  name VARCHAR(255) NOT NULL,
  description VARCHAR(255),
  id_category INT,
  favourite BOOLEAN
);

CREATE TABLE categories (
  id INT AUTO_INCREMENT PRIMARY KEY,
  name VARCHAR(255) NOT NULL
);

CREATE TABLE flashcard_stats (
  id INT PRIMARY KEY AUTO_INCREMENT,
  date DATE,
  seen_flashcards_quantity INT
);

Database connection

Adjust file content to youre database host, name, user and password.

config/database.php

<?php
    define('DB_HOST', 'localhost');
    define('DB_NAME', 'flashcards');
    define('DB_USER', 'root');
    define('DB_PASSWORD', '');

Example flashcards data

INSERT INTO flashcards (name, description, id_category, favourite)
VALUES ('Co wydarzyło się w 1410 r.', 'Bitwa pod Grunwaldem', 1, FALSE);

INSERT INTO flashcards (name, description, id_category, favourite)
VALUES ('Co wydarzyło się w 1 września 1939 r.', 'Wybuch II wojny światowej', 1, FALSE);

INSERT INTO flashcards (name, description, id_category, favourite)
VALUES ('Co wydarzyło się w 1492 r.', 'Odkrycie Ameryki przez Krzysztofa Kolumba', 1, TRUE);

INSERT INTO flashcards (name, description, id_category, favourite)
VALUES ('Adam Mickiewicz', 'Urodził się na Litwie, napisał "Dziady" i "Pana Tadeusza"', 2, TRUE);

INSERT INTO categories (id, name)
VALUES (1, 'Wydarzenia historyczne');

INSERT INTO categories (id, name)
VALUES (2, 'Znane osoby');
ALTER TABLE flashcards ADD COLUMN seen BOOLEAN DEFAULT FALSE;

Set Up SCSS

Download and Install

Download Node.js

npm init -y
npm install gulp gulp-sass --save-dev
npm install sass

Transpiling SCSS to CSS

gulp

Working with git

git clone https://github.com/filipwroblewski/FlashcardApp.git
git switch develop

Adding New Feature

Adding new feature branch based on develop branch

git checkout -b feature/feature-name develop

You can make changes (also you can repeat 1, 2, 3)

  1. git add .
    
  2. git commit -m "Implement feature-name"
    
  3. git push origin feature/feature-name
    

When you are done with feature.

git checkout develop
git merge --no-ff feature/feature-name
git push origin develop

Now you can start from Adding New Feature

Adding Something to feature/existing-feature-brnach

git checkout feature/existing-feature-brnach
git merge develop

You can make changes (also you can repeat 1, 2, 3, 4)

  1. git add .
    
  2. git commit -m "Implement feature-name"
    
  3. git push origin feature/existing-feature-brnach
    

When you are done with feature.

git checkout develop
git merge --no-ff feature/feature-name
git push origin develop

flashcardapp's People

Contributors

filipwroblewski avatar

Watchers

 avatar  avatar

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.