Skip to content

DislikesSchool/EduPage2-server

Repository files navigation

EduPage2 - server

codecov

The backend API server for the EduPage2 project.

Installation

There are 3 ways to install and run the server:

  1. Bare-metal
  2. Docker
  3. Docker-compose

Important

For bare-metal and Docker installs, you will also need to clone the EduPage2 flutter project, build it for the web, and place the build files in cmd/server/web

Bare-metal

  1. Install Golang
  2. Clone the repository
git clone https://github.com/DislikesSchool/EduPage2-server.git
  1. Install dependencies
go mod download
  1. Build the project
go build ./cmd/server
  1. Run the server
./server

Docker

  1. Clone the repository
git clone https://github.com/DislikesSchool/EduPage2-server.git
  1. Build the Docker image
docker build -t edupage2-server .
  1. Run the Docker container
docker run --mount type=bind,src=./config.yaml,dst=/config.yaml,ro --mount type=bind,src=./logs,dst=/logs -p 8080:8080 edupage2-server

Docker-compose

  1. Clone the repository
git clone https://github.com/DislikesSchool/EduPage2-server.git
  1. Start the container
docker compose up -d

Configuration

The server can be configured using the config.yaml file. Copy the config.example.yaml file and edit it to your liking.

cp config.example.yaml config.yaml

The default configuration is as follows:

# General server configuration
server:
  # The host address to bind to (do not change this unless you know what you are doing)
  host: "0.0.0.0"
  # The port to bind to
  port: "8080"
  # The mode to run the server in (either "development" or "production")
  mode: "production"

# School configuration
schools:
  # Whitelisted schools (users will only be allowed to login if they are a member of this school)
  whitelist:
    - "schoolname" # This is your school's unique name (https://schoolname.edupage.org)
  # Whether to use the whitelist as a blacklist instead
  blacklist: false # Set this to true with a empty whitelist to allow users from any school

# JWT configuration
jwt:
  # The secret key to use for signing JWT tokens (change this to a secure random value)
  secret: "YourDefaultSecretKey"

If you want to host a public instance, remove all schools from the whitelist and set blacklist to true.

API

The server provides a RESTful API for the frontend to interact with. The API documentation can be found here, or at the same endpoint on your own instance.

About

The backend server code for EduPage2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5

Languages