|
2 | 2 | [](https://github.com/Victornguli/flashlearn/actions/workflows/test.yml) |
3 | 3 | [](https://coveralls.io/github/Victornguli/flashlearn?branch=master) |
4 | 4 |
|
5 | | -Learn CS concepts using flashcards |
| 5 | +**Master difficult concepts via spaced repetition using flashcards** |
| 6 | + |
| 7 | +#Getting Started |
| 8 | +###Dependencies |
| 9 | + |
| 10 | +To run a copy of this project locally you will require: |
| 11 | ++ Python 3.6+ |
| 12 | ++ Postgresql(Optional) |
| 13 | ++ Docker(Optional) |
| 14 | ++ Redis server(Optional) |
| 15 | + |
| 16 | +###Installation |
| 17 | + |
| 18 | +You can run a local version of flashlearn by cloning this repo |
| 19 | +and following these instructions |
| 20 | + |
| 21 | + git clone https://github.com/Victornguli/flashlearn.git |
| 22 | + cd flashlearn |
| 23 | + # Create a virtualenv, install requirements |
| 24 | + |
| 25 | + virtualenv venv |
| 26 | + source venv/bin/activate |
| 27 | + pip install -r requirements.txt |
| 28 | + |
| 29 | +The file .flaskenv is populated with default development configs that you |
| 30 | +can override to suit your needs. |
| 31 | +To run the server directly type |
| 32 | + |
| 33 | + flask run --host=0.0.0.0 |
| 34 | + |
| 35 | + |
| 36 | +####Setting up Postgresql |
| 37 | +First ensure the latest version of postgresql is installed, If pip installation |
| 38 | +fails but you dont need postgres feel free to remove **psycopg2** from the list and try the installation again. |
| 39 | +To setup psql proceed as follows: |
| 40 | + |
| 41 | ++ Create a new postgres user, set the user password and make sure that you can access psql shell |
| 42 | ++ Update .flaskenv with correct database url details |
| 43 | ++ Type **flask db upgrade** to run migrations |
| 44 | + |
| 45 | +Ignore this step to use sqlite3 |
| 46 | + |
| 47 | + |
| 48 | +####Setting up Redis cache |
| 49 | +Ensure you have redis server installed in your system. |
| 50 | +Enable Redis cache from BaseConfig class file in /instance/config.py by |
| 51 | +changing the value of **USE_REDIS_CACHE** from False to True |
| 52 | + |
| 53 | + |
| 54 | +####Running on Docker |
| 55 | +First ensure docker and docker-compose are installed in your machine, then run: |
| 56 | + |
| 57 | + + Copy paste the contents of .env.dev into a new file named.env.prod |
| 58 | + |
| 59 | + Run: |
| 60 | + |
| 61 | + docker-compose up --build to deploy the app with docker-compose file |
| 62 | + |
0 commit comments