MyDiary is an online journal where users can pen down their thoughts and feelings.
Clone
- https://github.com/4dbyron/MyDiary.git
or - [email protected]:4dbyron/MyDiary.git
or
Open live Preview
To clone, you can click on the clone or download
button on the left of this page.
This option is only preferred when you don't have git
installed on your system.
In case you already have git installed e.g through apt-get install git
on Linux(Debian Derivatives).
Cloning can be done by:
`git clone https://github.com/4dbyron/MyDiary.git`
or
git clone [email protected]:4dbyron/MyDiary.git
MyDiary has UI and API sections. Depending on the part you are interested in, you can follow its respective instructions.
- To render the User interface, navigate to MyDiary directory(Appears where we clones our repo)
- while in
MyDiary
you will see theUI
directory. navigate to it. - launch
index.html
with a your favourite browser
e.g
cd MyDiary/UI
sensible-browser index.html
#####once the repository has been cloned execute:
- `virtualenv venv
source venv/bin/activate
pip install -r MyDiary/requirements.txt
after the requirements have been installed,
-
Navigate to the MyDiary folder/directory with
cd MyDiary
command -
You will be prompted to accept the environment setup
- reply with
Y
ory
- reply with
-
switch to user postgres with:
sudo -i -u postgres
orsu postgres
-create database with:psql -c 'CREATE DATABASE "my_diary";' -U postgres
orcreatedb my_diary
-
Create a user to access the database with:
- psql -c "CREATE USER byron WITH PASSWORD 1234 createdb;" -U postgres
where:
byron
is you user name and1234
is the password
- psql -c "CREATE USER byron WITH PASSWORD 1234 createdb;" -U postgres
where:
-
Create tables in the database with:
python manage.py
-
Launch the server with:
- python run.py
You can copy paste this for a quick setup
git clone https://github.com/4dbyron/MyDiary.git
virtualenv venv
source venv/bin/activate
pip install -r MyDiary/requirements.txt
cd MyDiary/
sudo -i -u postgres || su postgres
psql -c 'CREATE DATABASE "my_diary";' -U postgres || createdb my_diary
psql -c "CREATE USER byron WITH PASSWORD 1234 createdb;" -U postgres
python manage.py
python run.py
For Tests, run:
`pytest -v`
or
`pytest -v test_app.py`
or
`python -m pytest test_app.py`
- Start the server with
python run.py
- launch Postman and enter in the desired endpoint to test.
Example
GET /entries
fetches all entries. to achieve this with postman, you would to a GET request URL as:127.0.0.1:5000/api/v1/entries
- HTML
- CSS
- Javascript
Improvements to this application are highly welcomed. for now, reviewing the pull requests will one way of doing so.
- Version Control: Git & Github
- MyDiary PivotalTracker
Byron Taaka
- Andela Kenya
- MaryAnne Ng'ang'a
- Eugene Mutai
- James Lemayian