8000 GitHub - brianrahadi/sfucourses-api: REST API server for SFU course outlines, sessions, and instructors
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

brianrahadi/sfucourses-api

Repository files navigation

Contributors Forks Stargazers Issues project_license


sfucourses-api

REST API server for SFU course outlines, sessions, and instructors
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Features
  3. Getting Started
  4. Usage
  5. Roadmap
  6. Contributing
  7. License
  8. Contact
  9. Acknowledgments

About The Project

Product Name Screen Shot Unofficial API for accessing SFU course outlines, sections, and instructors robustly and used to power sfucourses.com. Data is pulled from SFU Course Outlines REST API. This API is not affiliated with Simon Fraser University.

See api.sfucourses.com

(back to top)

Built With

  • Golang

(back to top)

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

  • Golang v1.23.3

Quick Features

  • REST API Server - api.sfucourses.com
  • Golang Script to fetch outlines, sessions, and sync instructors

Installation

  1. Clone the repo

    git clone https://github.com/brianrahadi/sfucourses-api.git
  2. Change git remote url to avoid accidental pushes to base project

    git remote set-url origin brianrahadi/sfucourses-api
    git remote -v # confirm the changes
  3. Run the project through air.toml or docker

air is good for development with it's real-time file update sync

air

Docker is good for its 1-to-1 behaviour with production. You can either use docker build and run or docker compose.

(back to top)

Docker

Build the Image

docker build -t sfu-courses-api .

Run the Container

# Create .env file
echo "UPDATE_PASSWORD=your-secure-password-here" > .env

# Run with .env file
docker run -p 8080:8080 --env-file .env sfu-courses-api

Test the Update Endpoint

curl -X POST http://localhost:8080/update \
  -H "Content-Type: text/plain" \
  -d "your-secure-password-here"

Useful Docker Commands

# View running containers
docker ps

# View logs
docker logs <container_id>

# View logs live
docker logs -f <container_id>

# Stop container
docker stop <container_id>

# Remove container
docker rm <container_id>

The API will be available at http://localhost:8080 once the container is running.

Roadmap

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Very recommended! very appreciated!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

Docker Commands



### UPDATE_PASSWORD
Required for the `/update` endpoint. Set this environment variable to secure manual data updates.

```bash
export UPDATE_PASSWORD="your-secure-password-here"

Usage:

curl -X POST http://localhost:8080/update \
  -H "Content-Type: text/plain" \
  -d "your-secure-password-here"

Security Note: Never commit the actual password to version control. Use environment variables or secrets management in production.

Git Hooks

To set up the pre-commit hooks:

cp hooks/pre-commit .git/hooks/
chmod +x .git/hooks/pre-commit

This way:

  • The hook templates are version controlled
  • Each developer can set up their own hooks
  • The actual .git/hooks directory remains local to each developer's machine

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Brian Rahadi - brian.rahadi@gmail.com

Project Link: https://github.com/brianrahadi/sfucourses-api

(back to top)

Acknowledgments

(back to top)

About

REST API server for SFU course outlines, sessions, and instructors

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0