computer-science-club

computer-science-club
git clone https://git.prime8.dev/computer-science-club.git
Log | Files | Refs | README | LICENSE

README.md (2078B)


      1 # Computer Science Club Website
      2 
      3 A website for Computer Science Club made during a mini-hackathon.
      4 
      5 ![home page](./assets/home.png)
      6 
      7 ## Setup
      8 
      9 ### Environment Variables
     10 
     11 The following environment variables are required:
     12 
     13 | Variable               | Description                                                    | Required |
     14 | ---------------------- | -------------------------------------------------------------- | -------- |
     15 | `DOMAIN`               | The URL where this app is hosted                               | Yes      |
     16 | `SECRET_KEY`           | Flask session secret key (auto-generated if not set)           | No       |
     17 | `GROUP_ID`             | Schoology group ID (found in the URL after `/group/`)          | Yes      |
     18 | `SCHOOLOGY_DOMAIN`     | Your Schoology instance domain (e.g., `schoology.example.com`) | Yes      |
     19 | `SCHOOLOGY_API_KEY`    | Schoology API key                                              | Yes      |
     20 | `SCHOOLOGY_API_SECRET` | Schoology API secret                                           | Yes      |
     21 | `FLASK_ENV`            | Set to `development` to allow HTTP OAuth (insecure)            | No       |
     22 
     23 ### Schoology
     24 
     25 To get a Schoology API key and secret, go to `https://<your-schoology-domain>/api`. There you can manage your API credentials.
     26 
     27 ### Google OAuth
     28 
     29 To setup Google OAuth2, follow [these instructions](https://developers.google.com/identity/oauth2/web/guides/get-google-api-clientid). Copy the credentials JSON into a file called `google_auth.json` in the root of the project. Make sure your domain is added as an "Authorized redirect URI."
     30 
     31 ## Running
     32 
     33 ### Docker (Recommended)
     34 
     35 ```sh
     36 docker build -t cs-club .
     37 docker run -p 80:80 \
     38   -e DOMAIN="https://example.com" \
     39   -e GROUP_ID="123456" \
     40   -e SCHOOLOGY_DOMAIN="schoology.example.com" \
     41   -e SCHOOLOGY_API_KEY="your-key" \
     42   -e SCHOOLOGY_API_SECRET="your-secret" \
     43   cs-club
     44 ```
     45 
     46 ### Local Development
     47 
     48 ```sh
     49 python -m venv venv
     50 source venv/bin/activate
     51 pip install flask schoolopy schedule cachecontrol google-auth google_auth_oauthlib
     52 flask --app main run
     53 ```