Skip to content

balaakagordon/challenge3

Repository files navigation

MyDiary_GB

MyDiary is an online application where users can note down their thoughts and feelings. Set up your account and begin documenting your emotions.

Build Status Coverage Status

Getting Started

These instructions will help you get the application running on your local machine for development and testing.

Prerequisites

Setup

  • Clone the remote repository on GitHub
    $ git clone https://github.com/balaakagordon/test.git
    $ cd MyDiary_GB
  • Create a virtual environment for your application and install all relevant requirements
    $ virtualenv venv
    $ source venv/bin/activate
    $ pip install -r requirements.txt

Database

  • Set up a database to hold your data
CREATE DATABASE mydiary_db
  • Run the application on a local server
    $ python mydiaryapp/app.py

Check that the application is now be running on the localhost server(http://127.0.0.1:5000)

Testing

  • Run tests on api endpoints to ensure methods work
    $ curl -i http://localhost:5000/api/v1/entries/1
    $ curl -i http://localhost:5000/api/v1/entries
    $ curl -i -H "Content-Type: application/json" -X POST -d '{"entrytitle":"Plan for today", "entrydata":"Read a book"}' http://localhost:5000/api/v1/entries
    $ curl -i -H "Content-Type: application/json" -X PUT -d '{"entrytitle":"Today Was Fun", "entrydata":"Went shopping and bought lots of stuff!"}' http://localhost:5000/api/v1/entries/1
Method Endpoint Description
GET home/api/v1/entries Get all entries
GET home/api/v1/entries/<entry_id> Get specific entry using an id
POST home/api/v1/entries Create a new entry
PUT home/api/v1/entries/<entry_id> Edit an entry using an id
  • Run the tests on the application and check the test coverage
    $ nosetests -v --with-coverage --cover-package=mydiaryapp/tests

Hosting

This application can also be found on Heroku The app's templates can be seen on GitHub pages The api is documented on Apiary

About

Challenge 3 of MyDiary

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors