README.md 4.96 KB
Newer Older
1
arsnova🍅cards
Marius Trautrims's avatar
Marius Trautrims committed
2
---
3
The [Progressive Web App](https://en.wikipedia.org/wiki/Progressive_web_app) arsnova🍅cards offers students a modern and intuitive access to one of the most successful and evidence based learning methods, i.e., [spaced repetition](https://en.wikipedia.org/wiki/Spaced_repetition).
4

5
arsnova🍅cards uses Meteor as application framework. Download and install [Meteor](https://www.meteor.com/) to get the app running in your local development environment.
6

Curtis Adam's avatar
Curtis Adam committed
7 8
## System requirements
- 4 GB RAM
Marius Trautrims's avatar
Marius Trautrims committed
9

Curtis Adam's avatar
Curtis Adam committed
10 11
## Initial setup
1. Install [Meteor](https://www.meteor.com/)
Curtis Adam's avatar
Curtis Adam committed
12 13 14
2. Install git `sudo apt install git`
3. Install python 2 `sudo apt install python`, Ubuntu only ships with python 3
4. install the g++ build-essential `sudo apt install g++ build-essential`
Curtis Adam's avatar
Curtis Adam committed
15 16 17
2. Make sure that you've added a [SSH key](https://git.thm.de/profile/keys)
3. Clone the remote repository `git clone git@git.thm.de:arsnova/flashcards.git`
4. Install the npm package dependencies inside the local repository **"flashcards folder"** `meteor npm install`
18
5. Set your initial admin user in `settings.json` or `settings_debug.json` (cas account)
Marius Trautrims's avatar
Marius Trautrims committed
19 20

### Settings
21
Change `settings.json` or `settings_debug.json` according to your needs
Marius Trautrims's avatar
Marius Trautrims committed
22

Curtis Adam's avatar
Curtis Adam committed
23
> Warning: Never publish your settings file!
Marius Trautrims's avatar
Marius Trautrims committed
24

Curtis Adam's avatar
Curtis Adam committed
25 26 27
## Meteor updates
A simple update to the latest Meteor version is not always possible. Please do not update Meteor to the latest version and leave this to the owners of the repository.

28
## Migrate a local Meteor 1.6 🍅cards database to Meteor 1.8
Curtis Adam's avatar
Curtis Adam committed
29
1. Make sure that you meet following requirements:
Curtis Adam's avatar
Curtis Adam committed
30 31 32
   - You've selected the staging branch `git checkout staging`
   - Your staging branch is up to date `git pull`
   - Meteor is running
33
   - Your terminal is inside the repository **flashcards folder**
Curtis Adam's avatar
Curtis Adam committed
34 35 36 37 38 39 40 41 42 43 44 45
1. Move to your staging branch `git checkout staging`
1. Install the mongodb-tools: `sudo apt-get install mongo-tools`
1. Set your repository to the latest Meteor 1.6 version `git checkout 3a1751a2838ad595eda7d3ccd9e9191a3bf32271`
1. Dump your current Meteor 1.6 database `mongodump -h "localhost" --port "3001" -d "meteor" -o ~/flashcardsBackup/`
   - Make sure that mongodump created the folder and files
1. Stop meteor
1. Reset the meteor configuration `meteor reset`
1. Move back to the latest staging branch version `git checkout staging`
1. Update your node packages `meteor npm install`
1. Start meteor
1. Restore your backup `mongorestore --drop -h "localhost" --port "3001" -d "meteor" ~/flashcardsBackup/meteor`

Curtis Adam's avatar
Curtis Adam committed
46
## Starting the app
47
Use one of the following commands inside the repository (flashcards folder), to start arsnova🍅cards on localhost:
Curtis Adam's avatar
Curtis Adam committed
48 49

- For development:
50
  - `meteor --settings settings_debug.json`
Curtis Adam's avatar
Curtis Adam committed
51 52 53 54 55 56 57

- For production:
  - `meteor --settings settings.json`

You can then access the app from your host machine by visiting http://localhost:3000.

## Loading the Test Database
Curtis Adam's avatar
Curtis Adam committed
58
1. Make sure that you've installed the [MongoDB Community Tools](https://docs.mongodb.com/manual/administration/install-community/)
Curtis Adam's avatar
Curtis Adam committed
59
2. Start the server with the development settings
Curtis Adam's avatar
Curtis Adam committed
60
2. Open a new terminal in the flashcards folder and load the Test Database with: `./tests/loadTestDatabase.sh`
Curtis Adam's avatar
Curtis Adam committed
61

Curtis Adam's avatar
Curtis Adam committed
62 63
## Optional features

64 65
### Authentication setup (For Google+, Facebook and Twitter logins)
1. [Create your Google+ api keys](https://console.developers.google.com/)
Marius Trautrims's avatar
Marius Trautrims committed
66 67 68 69
2. [Create your Facebook api keys](https://developers.facebook.com/)
3. [Create your Twitter api keys](https://apps.twitter.com/)


Curtis Adam's avatar
Curtis Adam committed
70
### Braintree setup (For PayPal payments)
Marius Trautrims's avatar
Marius Trautrims committed
71 72 73 74 75 76 77 78
1. [Create a Braintree sandbox account](https://www.braintreepayments.com/get-started)
2. [Login](https://sandbox.braintreegateway.com/login) to the braintree sandbox
3. Retrieve your api keys (navigate to: My User > View Authorizations)
4. Insert the keys into `settings.json`
5. Inside Braintree sandbox, navigate to Plans from left menu under `Reccuring Billing`
6. Create one plan with id "pro" and your preferred price (lowercase for Plan ID, Plan Name's should be "Pro")


Curtis Adam's avatar
Curtis Adam committed
79
### Firebase setup (For web notifications)
80 81
1. [Create a Firebase project](https://console.firebase.google.com/)
2. Get the FCM api key from Firebase project (project settings > cloud messaging > server key)
Curtis Adam's avatar
Curtis Adam committed
82
3. Insert the key into `settings.json` (`FCM_API_KEY`)
83

Curtis Adam's avatar
Curtis Adam committed
84
## Contribution guide
Curtis Adam's avatar
Curtis Adam committed
85
The contribution guide can be found [here](https://git.thm.de/arsnova/flashcards/blob/staging/CONTRIBUTING.md).
Curtis Adam's avatar
Curtis Adam committed
86

87
## Documentation
Curtis Adam's avatar
Curtis Adam committed
88
The documentation can be found [here](https://cards-staging.mni.thm.de/jsdoc/).
89

90 91 92 93 94
### UML Diagrams
- [Activity](https://git.thm.de/arsnova/flashcards/wikis/uml---activity-diagram)
- [Domain model](https://git.thm.de/arsnova/flashcards/wikis/uml---domain-model-diagram)
- [Use case](https://git.thm.de/arsnova/flashcards/wikis/uml---use-case-diagram)

Curtis Adam's avatar
Curtis Adam committed
95
## CI Pipeline
96 97 98 99 100 101
[![build status](https://git.thm.de/arsnova/flashcards/badges/staging/build.svg)](https://git.thm.de/arsnova/flashcards/commits/staging)


- [Staging](http://cards-staging.mni.thm.de)
- [Production](https://arsnova.cards)

Curtis Adam's avatar
Curtis Adam committed
102
## Credits
103
arsnova🍅cards is powered by Technische Hochschule Mittelhessen - University of Applied Sciences.