MyDiary is an online journal that provides users with the ability to pen down their thoughts and feelings
MyDiary offers the following features
- Create an account for a user
- Login a user
- View all entries in a user's diary
- View contents of a diary entry
- Add an entry
- Modify an entry
- Delete an entry
https://muhanguzidavid.github.io/MyDiary/UI/index.html
https://mydiary12.docs.apiary.io/#
The application has been deployed on heroku: https://my-diary-3.herokuapp.com/api/v1/auth/signup
Python 3
python-pip
Virtualenv
- Clone the project at MyDiary.
- cd into the project diractory
For windows:
virtualenv env
cd/env/scripts/activate
pip install -r requirements.txt
- Install postgresql 10
- In the terminal, enter the following command to shift to the postgres shell
psql -U <username> postgres
- In postgress shell, create mydiary database
CREATE DATABASE mydiary;
- Run the app with the command (python run.py)
- Open postman and run (http://127.0.0.1/5000/api/v1/entries)
HTTP Method | Endpoint | Description |
---|---|---|
POST | /api/v1/auth/signup | Registers a user |
POST | /api/v1/auth/login | Login a user |
GET | /api/v1/entries | Retrieves all diary entries |
GET | /api/v1/entry/int:entry_id | Retrieves a specific diary entry |
POST | /api/v1/add | Adds an entry to the diary |
PUT | /api/v1/update | Updates an entry in the diary |
DELETE | /api/v1/remove/int:entry_id | Deletes an entry from the diary |
To run tests, run the command (pytest -v)
- cd into the tests folder
- run the command
pytest -v test_diary.py
Run the command
pytest --cov=api