README.md 5.89 KB
Newer Older
Tyler Hallada's avatar
Tyler Hallada committed
1 2
#What's Open#

Tyler Hallada's avatar
Tyler Hallada committed
3 4
Simple Django site displaying which dining locations are currently open on 
George Mason University's campus.
Tyler Hallada's avatar
Tyler Hallada committed
5 6 7

##Contributing##

Tyler Hallada's avatar
Tyler Hallada committed
8 9 10 11
What's Open is still in it's very early stages and needs all the help it can
get. Even if you don't feel like you can be helpful with the heavily technical
aspects, we definitely need designers and technical writers.

12 13 14
There are many things that can be done with this project (see the "To Do" 
section), but sometimes it's the small things that count, so don't be afraid of 
contributing just for a spelling mistake.
Tyler Hallada's avatar
Tyler Hallada committed
15

16 17
If you need help at all please contact any SRCT member. We want people to
contribute, so if you are struggling, or just want to learn, then we are willing
Tyler Hallada's avatar
Tyler Hallada committed
18 19 20 21
to help.

###Set Up###

Tyler Hallada's avatar
Tyler Hallada committed
22
To get started, you'll need the following installed:
Tyler Hallada's avatar
Tyler Hallada committed
23

Tyler Hallada's avatar
Tyler Hallada committed
24 25 26
* [Python 2.7](http://www.python.org/download/)
* [Django 1.4 or later](https://www.djangoproject.com/download/)
* [Git](http://git-scm.com/book/en/Getting-Started-Installing-Git)
Tyler Hallada's avatar
Tyler Hallada committed
27 28
* [virtualenv](http://www.virtualenv.org/en/latest/index.html#installation) 
  (to install you will need either 
29 30
  [pip](http://www.pip-installer.org/en/latest/installing.html) or
  [easy_install](http://pythonhosted.org/distribute/easy_install.html))
Tyler Hallada's avatar
Tyler Hallada committed
31

32 33 34 35 36
<!--You don't need to do anything with [git.gmu.edu](https://git.gmu.edu/) to -->
<!--preform a `git clone`, but you should log in if you plan on actually modifying -->
<!--code. Logging into git.gmu.edu with your George Mason credentials will create -->
<!--an account. Ask a SRCT member to add you to the SRCT group on the site and you -->
<!--will be added to the list of people allowed to `git push` to the repository at -->
37 38
<!--git.gmu.edu. Alternatively, you can fork the project, clone your own repo, make -->
<!--changes there, and submit pull requests.-->
39

40 41 42
Then type the following commands in your terminal (if you're on Windows, 
[Cygwin](http://www.cygwin.com/) is recommended).

Tyler Hallada's avatar
Tyler Hallada committed
43
```bash
44
git clone http://git.gmu.edu/srct/whats-open.git
Tyler Hallada's avatar
Tyler Hallada committed
45 46 47 48 49
cd whats-open/
virtualenv venv --distribute
source venv/bin/activate
pip install -r requirements.txt
python manage.py syncdb
50
python manage.py migrate website
Tyler Hallada's avatar
Tyler Hallada committed
51 52
```

53
###Running the Site Locally###
Tyler Hallada's avatar
Tyler Hallada committed
54

Tyler Hallada's avatar
Tyler Hallada committed
55 56 57
Now that everything is set-up you can run the server on your computer.

```bash
58
python manage.py runserver
Tyler Hallada's avatar
Tyler Hallada committed
59 60
```

61
Go to http://127.0.0.1:8000/ in your browser and you should see the website. 
Tyler Hallada's avatar
Tyler Hallada committed
62
Though, there won't be any restaurants showing. You will need to add them to 
63 64 65
the database. Go to http://127.0.0.1:8000/admin/ to add new Restaurant and Schedule 
objects to your database (the login would be the same username and password you 
entered when creating a superuser during the `python manage.py syncdb` command).
Tyler Hallada's avatar
Tyler Hallada committed
66 67 68 69 70 71 72 73 74 75

###Modifying and Deploying Code###

With the means of testing the website, you can really start contributing.

If you're new to Django and don't know where to start, I highly recommend
giving the [tutorial](https://docs.djangoproject.com/en/dev/intro/tutorial01/)
a try. However, it leaves out a lot of important things, so remember, Google is
your friend. If you can't figure it out there, ask me.

76 77 78 79
For the JavaScript, I will be using jQuery whenever possible because I prefer
it to straight up JavaScript. jQuery has [great
documentation](http://docs.jquery.com/) and I've found [Mozilla's documentation
on JavaScript](https://developer.mozilla.org/en-US/docs/JavaScript) to be
80
useful as well. But if your Google-fu is sharp, that should suffice.
81

82 83 84 85
<!--If you followed the steps in "Set Up" above, once you actually make changes it-->
<!--should be easy to push them to the git repository.-->

Once you actually make your changes and have fully tested them you can push the 
86 87
code to the git repository. The best way to do this is to fork the project, make
the changes in your local repository, push to gitlab, and submit a pull request.
Tyler Hallada's avatar
Tyler Hallada committed
88 89 90 91 92 93 94

There are many ways to use git, and this is one example:

```
git commit -a
git push origin master
```
Tyler Hallada's avatar
Tyler Hallada committed
95

Tyler Hallada's avatar
Tyler Hallada committed
96
Some more helpful links on how to use Git:
Tyler Hallada's avatar
Tyler Hallada committed
97

Tyler Hallada's avatar
Tyler Hallada committed
98 99 100 101 102 103 104
* [Git Reference](http://gitref.org/)
* [OpenHatch's Training Mission](https://openhatch.org/missions/git)
* [Visual Git
  Reference](http://marklodato.github.com/visual-git-guide/index-en.html)
* [Git For Ages 4 And
  Up](http://blip.tv/open-source-developers-conference/git-for-ages-4-and-up-4460524)

105 106
We currently don't have What's Open running on a dedicated server yet, but when
we do I will have instructions on how to deploy the code here.
Tyler Hallada's avatar
Tyler Hallada committed
107

108 109 110 111 112 113
<!--No longer relevant as there is no postgres database set up at the moment-->
<!--###Running Site Locally with Production Database###-->
<!--It is possible to run the site locally using the PostgresSQL database that-->
<!--whatsopen.gmu.edu uses. The way settings.py is configured requires that you set-->
<!--an environmental variable to the database's url before you run the site. Talk -->
<!--to me if you would like to know the url to accomplish this.-->
114

Tyler Hallada's avatar
Tyler Hallada committed
115
###To Do###
Tyler Hallada's avatar
Tyler Hallada committed
116

Tyler Hallada's avatar
Tyler Hallada committed
117 118 119
* Get all restaurants displaying correct open times on the page. AKA. make
  extensive tests.
* Sort by location view
120 121
* ~~Get a decent UI (make sure everything is pretty and usable)~~ (thanks
  Renfred)
Tyler Hallada's avatar
Tyler Hallada committed
122 123 124
* Add times until opening/closing for restaurants that are close, and exact
  times for those that aren't.
* Add yellow close-to-closing condition.
Tyler Hallada's avatar
Tyler Hallada committed
125 126 127 128 129 130 131 132 133 134 135 136 137
* Make page refresh, or more preferably have the data refresh. For
  example, with AJAX calls.
* Create more useful API calls. Document them.
* Allow switching between campuses. In the database, mark which campus each
  restauraunt is on, include this information in the JSON object returned at
  `ajax/schedule` and store the campus choice in the user's cookies
  so that when they come back the page will already be set to their campus.
  Default would be Fairfax of course.
  [jquery-cookie](https://github.com/carhartl/jquery-cookie) would be useful
  for this.
* Create a more user-friendly way of creating restaurants and updating
  schedules on the admin site. This could be done by modifying the admin site
  or creating our own Django forms and doing it outside the admin site.