Skip to content

Commit

Permalink
added in Getting Started section to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kvnyng committed Feb 4, 2022
1 parent 7e55f42 commit 62b8fd0
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,5 @@ logs/
creds
src/tools/googleTokenGen.py
abSENT/
secrets.ini
secrets.ini
testing_config.ini
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Every school day, abSENT retrives the new absence list and parses it. It then qu

## Why?
Refreshing Schoology 20 times every morning is somewhat draining.

## Contributors
- [Kevin Yang](https://github.com/bykevinyang)
- [Roshan Karim](https://github.com/karimroshan)
Expand All @@ -27,3 +26,36 @@ Frontend design by [Leah Vashevko](https://github.com/theaquarium)

## Disclaimer:
abSENT as a project is not affiliated with any of the entities whose students it serves. We are students and have written this project just for fun, as a minor QOL improvement in the morning.

# Get Started
## Requirements
- [Schoology](https://www.schoology.com/) API creds
- [PostgreSQL] 12+ installaton
- - Database setup (see below)
- [Python 3.8+](https://www.python.org/downloads/)

## Config Files
abSENT consists of 2 config files:
- [```config.ini```]()
- [```testing_config.ini```]()

We've included templates for both of these files. Fill them in with the appropriate values.
## Database Setup
- Install and Setup PostgresSQL 12+
- Create a new database called absent[^1]
- Install [alembic](https://alembic.sqlalchemy.org/en/latest/)
- Generate the tables using the following commands in shell:
- Run ```alembic revision --autogenerate -m 'initial'```
- Run ```alembic upgrade head```
- The database should now be setup now!

[^1]: You can call the database anything, but make sure to change the name in [```settings.py```](

Notes:
- By default, abSENT uses a postgres DB caled absent, running on port 5432. If you encounter issues, try changing the server address and port in [```src/database/database.py```]()


## Running it
To run abSENT, run the following command in your terminal, in the root directry:

```python -m src.dev```
21 changes: 21 additions & 0 deletions config_template.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
; Template for config.ini

[NNHS]
key = ; API key for schoology
secret = ; API secret for schoology

[NSHS]
key = ; API key for schoology
secret = ; API secret for schoology

[PostgreSQL]
name = ; database name
user = ; database user
password = ; database password

[Firebase]
pkey = ; path to firebase service account json file

[JWT]
pkey = ; path to private key for signing
pubkey = ; path to public key for verification
3 changes: 3 additions & 0 deletions src/dev.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Run 'python -m src.dev' to run this script
# Must be run from root folder!

import os
import logging
import sys
Expand Down
2 changes: 1 addition & 1 deletion tests/tools/googleTokenGen.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from configparser import ConfigParser

SECRETS_PATH = "tests/tools/secrets.ini"
SECRETS_PATH = "tests/tools/testing_secrets.ini"

configuer = ConfigParser()
secrets = configuer.read(SECRETS_PATH)
Expand Down
10 changes: 10 additions & 0 deletions tests/tools/secrets_template.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
; Secrets file for testing
[Google]
client_id = ; Google app client id
client_secret = ; Google app client secret

[Login]
id_token = ; DO NOT FILL IN; will be auto generated by googleTokenGen.py
token = ; DO NOT FILL IN; will be auto generated by googleTokenGen.py
refresh_token = ; DO NOT FILL IN; will be auto generated by googleTokenGen.py

0 comments on commit 62b8fd0

Please sign in to comment.