diff --git a/.gitignore b/.gitignore index 076a415d..a2cd91bb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,43 +1,43 @@ -# Don't track content of these folders -config.ini -*.ini -# Compiled source # -################### -*.com -*.class -*.dll -*.exe -*.o -*.so - -# Packages # -############ -# it's better to unpack these files and commit the raw source -# git has its own built in compression methods -*.7z -*.dmg -*.gz -*.iso -*.jar -*.rar -*.tar -*.zip - -# OS generated files # -###################### -.DS_Store -.DS_Store? -._* -.Spotlight-V100 -.Trashes -ehthumbs.db -Thumbs.db - - -**/.idea/ -**/__pycache__/ -*.cpython-36.pyc -*.pyc - -run.sh -flomenv/ +# Don't track content of these folders +config.ini +*.ini +# Compiled source # +################### +*.com +*.class +*.dll +*.exe +*.o +*.so + +# Packages # +############ +# it's better to unpack these files and commit the raw source +# git has its own built in compression methods +*.7z +*.dmg +*.gz +*.iso +*.jar +*.rar +*.tar +*.zip + +# OS generated files # +###################### +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db + + +**/.idea/ +**/__pycache__/ +*.cpython-36.pyc +*.pyc + +run.sh +flomenv/ diff --git a/LICENSE b/LICENSE index 406d5ac0..7e9721ac 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 FLOM +Copyright (c) 2019 flomv2 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Logo-Ideas/FlomLogo1.jpg b/Logo-Ideas/FlomLogo1.jpg new file mode 100644 index 00000000..0a003123 Binary files /dev/null and b/Logo-Ideas/FlomLogo1.jpg differ diff --git a/Logo-Ideas/FlomLogo2.jpg b/Logo-Ideas/FlomLogo2.jpg new file mode 100644 index 00000000..1dbae670 Binary files /dev/null and b/Logo-Ideas/FlomLogo2.jpg differ diff --git a/Logo-Ideas/README.md b/Logo-Ideas/README.md new file mode 100644 index 00000000..085a9e60 --- /dev/null +++ b/Logo-Ideas/README.md @@ -0,0 +1,2 @@ +This directory contains posisble logo ideas :) +I can change/add color and add any redesigns. diff --git a/Logo-Ideas/logo idea0.png b/Logo-Ideas/logo idea0.png new file mode 100644 index 00000000..d4e304d2 Binary files /dev/null and b/Logo-Ideas/logo idea0.png differ diff --git a/Logo-Ideas/logo idea1.png b/Logo-Ideas/logo idea1.png new file mode 100644 index 00000000..1c5583e0 Binary files /dev/null and b/Logo-Ideas/logo idea1.png differ diff --git a/Logo-Ideas/logo idea2.png b/Logo-Ideas/logo idea2.png new file mode 100644 index 00000000..d3e1e298 Binary files /dev/null and b/Logo-Ideas/logo idea2.png differ diff --git a/Logo-Ideas/logo idea4.png b/Logo-Ideas/logo idea4.png new file mode 100644 index 00000000..e4987155 Binary files /dev/null and b/Logo-Ideas/logo idea4.png differ diff --git a/Logo-Ideas/logo idea5.png b/Logo-Ideas/logo idea5.png new file mode 100644 index 00000000..6cab2f12 Binary files /dev/null and b/Logo-Ideas/logo idea5.png differ diff --git a/Logo-Ideas/logo-idea1.jpg b/Logo-Ideas/logo-idea1.jpg new file mode 100644 index 00000000..5a7c70ae Binary files /dev/null and b/Logo-Ideas/logo-idea1.jpg differ diff --git a/Logo-Ideas/logo-idea2.jpg b/Logo-Ideas/logo-idea2.jpg new file mode 100644 index 00000000..a8874f11 Binary files /dev/null and b/Logo-Ideas/logo-idea2.jpg differ diff --git a/Logo-Ideas/logo-idea3.jpg b/Logo-Ideas/logo-idea3.jpg new file mode 100644 index 00000000..b26fb1c0 Binary files /dev/null and b/Logo-Ideas/logo-idea3.jpg differ diff --git a/Logo-Ideas/logo-idea4.jpg b/Logo-Ideas/logo-idea4.jpg new file mode 100644 index 00000000..de248142 Binary files /dev/null and b/Logo-Ideas/logo-idea4.jpg differ diff --git a/Media/logo.jpg b/Media/logo.jpg new file mode 100644 index 00000000..ebfc8f58 Binary files /dev/null and b/Media/logo.jpg differ diff --git a/README.md b/README.md index 7fa9f612..8a59b837 100644 --- a/README.md +++ b/README.md @@ -2,55 +2,49 @@ ### Folsom Library Occupancy Manager -http://www.flom.ml +FLOM is a web application created by a group of RPI students that allows the students and library staff at RPI to visualize the occupancy and gather usage statistics of the Folsom Library Occupancy Monitor. -Develop an embedded system that allows students to sign into a website with their RCS ID to check what study rooms in the library are occupied and which are not. This will increase students' efficiency when studying. +## Getting Started +To get started all you need to do is clone the repository onto your local machine +by typing ```git clone https://github.com/flomv2/FLOM.git``` in your terminal. -## Build Instructions +Before you can run the web application, you will need to complete the Django install tutorial that is located on our GitHub in the Tutorials folder. -Clone the URI and run the `manage.py` file located in the \_software directory. +Please refer to this [Django tutorial](https://docs.djangoproject.com/en/2.2/intro/tutorial01/) or simply the +[Django 2.2 documentation](https://docs.djangoproject.com/en/2.2/) for information about using our framework. Django provides a robust templating framework for HTML (that means please use it). -`python manage.py runserver` +## Build Instructions -Your local build will require access to a database. Our implementation uses [Postgres](https://www.postgresql.org/) and you can create a `config.ini` file with data to your local database. Alternatively, we can set you up with access to our AWS database if you want to join our team. +Once the URI is cloned, you can then run Django by moving into the WebApp directory in flom and running ```python3 manage.py runserver``` . This will start the web application on your localhost. In later versions you may need to install and setup Postgresql database which we will have tutorials on. -You may need to download these python libraries (if you don't already have them). +## Code of Conduct and Style Guidelines -```pip install Django``` \ -```pip install psycopg2``` \ -```pip install memcache``` +Our developers pride ourselves on writing beautiful and efficient code. Contributers should follow standard good style practices such as: useful commenting, proper indentation, and portability. Our Web Application directory looks like this -## Code of Conduct and Style Guidelines + `Tutorials/` - Tutorials on how to set up different aspcts of the flom project + `WebApp/` - Main source code in which apps of each web page are created and urls are connected + `License.md` - MIT License + `README.md` - This file -Our developers pride ourselves on writing beautiful and efficient code. Contributers should follow standard good style practices such as -useful commenting, proper indentation, and portability. Our software app directory looks like this - - `database/` - Database objects, queries, and all things postgres - `flom/` - Main settings and urls - `library_monitor/` - Front end styles and templates - `static/` - Main scripts and styles - `templates/` - Main template files - `config.ini` - Required metadata for database connection - `manage.py` - Managing file from Django - -Please refer to this [Django tutorial](https://docs.djangoproject.com/en/2.2/intro/tutorial01/) or simply the -[Django 2.2 documentation](https://docs.djangoproject.com/en/2.2/) for information about using our framework. Django provides a robust templating framework for HTML (that means please use it). +## Website/Communication +https://rcos.io/projects/flomv2/flom/profile +Contact any of the contributors on this page and we can add you to our Mattermost chat! This is also where you can find our blog. ## Git Branching Model -When making a new feature or a bug fix, please make a new branch from **Dev** (short for develop). On your command line, run +When making a new feature or a bug fix, please make a new branch from **Master** (or branch you are trying to modify). On your command line, run -`git checkout dev` \ +`git checkout **(original branch name)**` \ `git branch [new branch name]` \ -`git checkout [new branch name]` +`git checkout [new branch name]` -Branch names should be concise and self-explanatory. Please make your branch names lowercase and use hyphens (-) for spaces. You don't need to prepend your branch name with "dev" or include other details such as your name. For example, a feature branch for updating the about page UI might be called `about-styles` or `about-page-ui`. +Branch names should be concise and self-explanatory. Please make your branch names lowercase and use hyphens (-) for spaces. You don't need to prepend your branch name with or include other details such as your name. For example, a feature branch for updating the about page UI might be called `about-styles` or `about-page-ui`. -When you have changes to your local code base in your new branch, commit push them with +When you have changes to your local code base in your new branch, commit push them with `git commit -m [Commit message]` \ -`git push` +`git push` -Commit messages should be concise and self-explanatory, just like branch names. +Commit messages should be concise and self-explanatory, just like branch names. -Once your have completed your feature or fixed you bug, please perform a **Pull Request** into dev, even if you are an admin. Pull requests provide a more readable commit log, highlighting major features and changes. On the Github repository website, click new pull request and select `"dev" <- "your branch name"`. This allows an admin to approve your changes before they are live on the develop branch. +Once your have completed your feature or fixed you bug, please perform a **Pull Request** into master, even if you are an admin. Pull requests provide a more readable commit log, highlighting major features and changes. On the Github repository website, click new pull request and select `"master" <- "your branch name"`. This requires an admin to approve your changes before they are live on the develop branch. diff --git a/Test-Scripts/testThread.py b/Test-Scripts/testThread.py new file mode 100644 index 00000000..8d723cc1 --- /dev/null +++ b/Test-Scripts/testThread.py @@ -0,0 +1,24 @@ +import threading +import time + + +def threadf(name): + print("Thread %s: starting thread",name) + x = 0 + while(1): + time.sleep(1) + s = "Thread " + str(x) + print(s) + x = x + 1 + +if __name__ == "__main__": + print("Starting Program") + x = threading.Thread(target=threadf, args=(1,)) + x.start() + y = 0 + while(1): + time.sleep(2) + s = "Main: " + str(y) + print(s) + y = y + 1 + diff --git a/Test-Scripts/thr.py b/Test-Scripts/thr.py new file mode 100644 index 00000000..3f6c47ec --- /dev/null +++ b/Test-Scripts/thr.py @@ -0,0 +1,21 @@ +import threading +import time +import datetime + +def threadf(name): + hours = [] + while(True): + time.sleep(15) + now = datetime.datetime.now() + if (len(hours) == 0): + hours.append(now) + print(now.hour) + elif (now.hour != hours[-1].hour): + hours.append(now) + print(now.hour) + + +if __name__ == "__main__": + print("Starting Program") + x = threading.Thread(target=threadf, args=(1,)) + x.start() \ No newline at end of file diff --git a/Tutorials/DjangoInstallGuide.md b/Tutorials/DjangoInstallGuide.md new file mode 100644 index 00000000..c81a674a --- /dev/null +++ b/Tutorials/DjangoInstallGuide.md @@ -0,0 +1,105 @@ +# Installing Python and Django +1. Install Python and Pip + * We have to first update the local APT repository. +````shell +$ sudo apt-get update && sudo apt-get -y upgrade +```` +2. Install Python 3 +````shell +$ sudo apt-get install python3 +```` +3. Verify that Python was installed correctly. +````shell +$ python3 -V +```` +4. Install pip which is used to install packages from PyPi (Python's package repository) +```` shell +$ sudo apt-get install -y python3-pip +```` +5. Verify that pip was intalled +````shell +$ pip3 -V +```` +6. Install virtualenv + * This is a virtual environment where you can install software and python packages in a contained development space. + ````shell + $ pip3 install virtualenv + ```` + 7. Verify that virtualenv is installed + ````shell + $ virtualenv --version + ```` + 8. Install Django + 1. Make a new directory and then switch into that new directory. + ````shell + $ mkdir django-apps + $ cd django-apps + ```` + 2. While inside the django-apps directory create a new virtual environment which we called env. + ````shell + $ virtualenv env + ```` + 3. Now activate the virtual environment + ````shell + $ . env/bin/activate + ```` + You can tell that it is activated if you see something similar to this: + ````shell + (env) sylvee@DESKTOP-RFPF6M7: + ```` + 4. Now intall the Django package with pip3 + ````shell + $ pip3 install django + ```` + 5. Verify that Django installed + ````shell + $ django-admin --version + ```` + +# Django Test Project + +1. Genrating the intial setup code if this is your first time using Django. + ````shell + $ django-admin startproject mysite + ```` + +These files are: +* The outer `mysite/` root directory is just a container for your project. Its name doesn’t matter to Django; you can rename it to anything you like. +* - `manage.py`: A command-line utility that lets you interact with this Django project in various ways. You can read all the details about `manage.py` in [django-admin and manage.py](https://docs.djangoproject.com/en/2.2/ref/django-admin/). +* - The inner `mysite/` directory is the actual Python package for your project. Its name is the Python package name you’ll need to use to import anything inside it (e.g. `mysite.urls`). +* - `mysite/__init__.py`: An empty file that tells Python that this directory should be considered a Python package. If you’re a Python beginner, read [more about packages](https://docs.python.org/3/tutorial/modules.html#tut-packages "(in Python v3.7)") in the official Python docs. +* - `mysite/settings.py`: Settings/configuration for this Django project. [Django settings](https://docs.djangoproject.com/en/2.2/topics/settings/) will tell you all about how settings work. +* - `mysite/urls.py`: The URL declarations for this Django project; a “table of contents” of your Django-powered site. You can read more about URLs in [URL dispatcher](https://docs.djangoproject.com/en/2.2/topics/http/urls/). +* - `mysite/wsgi.py`: An entry-point for WSGI-compatible web servers to serve your project. See [How to deploy with WSGI](https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/) for more details. +2. Verify that the project works by running the devserver. +````shell +$ python manage.py runserver +```` + +You should see something like this. Note for now ignore the erros about unapplied migrations. + +````shell +Watching for file changes with StatReloader +Performing system checks... + +System check identified no issues (0 silenced). + +You have 17 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions. +Run 'python manage.py migrate' to apply them. + +July 16, 2019 - 17:07:09 +Django version 2.2.3, using settings 'mysite.settings' +Starting development server at http://127.0.0.1:8000/ +Quit the server with CONTROL-C. + ```` + 3. Visit http://127.0.0.1:8000/ and you should see a rocket. + 4. For more in depth tutorial checkout [Django's Tutorial](https://docs.djangoproject.com/en/2.2/intro/tutorial01/) + 5. Now you are ready to begin development of your project. + + + + + + + + diff --git a/Tutorials/HTMLCheatSheet.md b/Tutorials/HTMLCheatSheet.md new file mode 100644 index 00000000..f81db3f0 --- /dev/null +++ b/Tutorials/HTMLCheatSheet.md @@ -0,0 +1,163 @@ +## What is HTML? +HTML is short for "HyperText Markup Language." It simply means it is a language for describing web-pages using ordinary text. +## HTML Files +Every web page is an HTML file. Each HTML file is just like a plain-text file but with a ```.html``` extension instead of ```.txt``` +## HTML Tags +HTML tags are hidden *keywords* within a web page that define how your web browser must format and display the content. +Most tags have two parts, an opening and a closing part. For example, `````` is the opening tag and `````` is the closing tag. Note that the closing tag has the same text as the opening tag, but has an additional forward-slash(/) character. +There are some tags that are an exception to this rule, where a closing tag is not required. The `````` tag for showing images is one example of this. +Each HTML file must have the essential tags for it to be valid, so that web browsers can understand it and display it correctly. The essential tags are: +- `````` +- `````` +- `````` +- `````` +#### Definition - ``` ``` +This basically defines the document as web page. It also identifies the beginning and end of the HTML document. All other tags must fall between the html tags. +#### Header - ``` ``` +The header file contains information about the document that will not appear on the actual page, such as the title of the document, the author, which stylesheet to use and also meta tags. +#### Title - ``` ``` +The title tag defines the title that will appear in the title bar of your web browser. The title must appear between the head tags. +#### Body - ``` ``` +The body tags contain all the information and other visible content on the page. All your images, links, and plain text must go between the `````` and `````` tags. +#### Example: Basic HTML Structure +``` + + + My Page Title + + + This is where all my web page content goes! + + +``` +## Tag Attributes +Attributes allow you to customize a tag, and are defined within the opening tag, for example: +``````...```

``` +## Common Tags +| HTML | Description | +| ----------------------------------------- |:----------------------------------------------------------:| +| ``` heading ``` | heading (h1 for largest to h6 for smallest) | +| ```

paragraph ``` | Paragraph of Text | +| ``` bold ``` | Make text between tags bold | +| ``` italic ``` | Make text between tags italic | +|``` link name ``` | Create a link to another page or website | +|```

...
``` | Divide up page content into sections, and applyting styles | +|`````` | Show an image | +|`````` | Unordered, bullet-point list | +|```
``` | Line Break (force a new line) | +|``` red ``` | Use CSS style to change text color | + +## Text Formatting +| HTML | Description | +| --------------------------------- | :-------------------------------------------------- | +| ```...``` | Heading (?=1 for largest to 6 for smallest, e.g. h1 | +|```...``` | Bold Text | +|```...``` | Italic Text | +|```...``` | Underline text | +|```...``` | Strikeout Text | +|```...``` | Superscript - Smaller text placed above normal text | +|```...``` | Subscript - Smaller text placed below normal text | +|```...``` | Typewriter text | +|```
...
``` | Pre-formatted Text | +|```
...
``` | Text Block Quote | +|```...``` | Strong- Shown as Bold in most browsers | +|```...``` | Emphasis - Shown as Italics in most browsers | +|```...``` | Font tag obsolete, use CSS (see below) | + +## Section Divisions +| HTML | Description | +| --------------------------- | :---------------------------------------- | +| ```
...
``` | Division or Section of Page Content | +|```...``` | Section of text within other content | +|```

...

``` | Paragraph of text | +|```
``` | Line Break | +|```...``` | Line Break | +|```
``` | Basic horizontal Line | +| hr Tag Attributes: | | +| ``` size="?"``` | Line Thickness in pixels | +| ``` width="?"``` | Line Width in pixels | +| ``` width="??%"``` | Line Width as a percentage | +| ``` color="#??????"``` | Line Color (see below) | +| ``` align="?"``` | Horizontal Alignment: left, center, right | +| ``` noshade``` | No 3D cut-out | + +## Images +| HTML | Description | +| ------------------------------ | :---------------------------------------- | +| ```text``` | Basic Image | +| img Tag Attributes: | | +| ``` src="url"``` | URL or filename of image (required!) | +| ``` alt="text"``` | Alternate Text (required!) | +| ``` align="?"``` | Image alignment within surrounding text | +| ``` width="??"``` | Image width (in pixels or %) | +| ``` height="??"``` | Image height (in pixels or %) | +| ``` border="??"``` | Border thickness (in pixels) | +| ``` vpace="??"``` | Space above and below image (in pixels) | +| ``` hspace="??"``` | Space on either side of image (in pixels) | + +## Linking Tags +| HTML | Description | +| ---------------------------------- | :---------------------------------------------------------------- | +|``` link text ``` | Basic Link | +| a Tag Attributes: | | +| ```href="url"``` | Location (url) of page to link to | +| ```name="??"``` | Name of link (name of anchor, or name of bookmark) | +| ```target="?"``` | Link target location: _self, _blank, _top, _parent. | +| ```href="url#bookmark"``` | Link to a bookmark (defined with name attribute). | +| ``` href="mailto:email"``` | Link which initiates an email (dependent on user's email client). | + +## Lists +| HTML | Description | +| --------------------- | :----------------------------------------------------- | +| ```
    ...
``` | Ordered List | +| `````` | Un-ordered List | +| ```
  • ...
  • ``` | List Item (within ordered or unordered) | +| ```
      ``` | Ordered list type A, a, I, i, l | +| ```
        ``` | Ordered list starting value | +| ```