Skip to content
This repository has been archived by the owner on Apr 19, 2021. It is now read-only.

REST API endpoints for a course management tool similar to Canvas

License

Notifications You must be signed in to change notification settings

philectron/tarpaulin

 
 

Repository files navigation

final-project-do-it-later

Team members

How to run

  1. Clone this repository
  2. Create a file named .env with the following environment variables (fill in the value yourself):
  MYSQL_DATABASE
  MYSQL_USER
  MYSQL_PASSWORD
  MONGO_DATABASE
  MONGO_ROOT_USER
  MONGO_ROOT_PASSWORD
  MONGO_USER
  MONGO_PASSWORD
  MAX_REQUESTS_PER_TIME_WINDOW
  TIME_WINDOW_MILLISEC
  PAGINATION_PAGE_SIZE
  LIMIT_REQUEST_RATE
  JWT_SECRET_KEY
  • MAX_REQUESTS_PER_TIME_WINDOW, TIME_WINDOW_MILLISEC, LIMIT_REQUEST_RATE are used to config rate limiting feature, defining how many request per time window and how long is the time window, and if this feature is to be enabled or not, respectively.
  • PAGINATION_PAGE_SIZE configures how many return items per page for requests that needs pagination
  • JWT_SECRET_KEY is your secret key for JWT
  1. Run ./compose.sh

Docker Commands HOWTOs

Recommended way

Use compose.sh script file in the root directory of this project

./compose.sh

Use sudo chmod +x ./compose.sh if permission to execute the script is denied

Troubleshooting

Stops all the containers that were brought up by earlier up command. This is usually helpful when you forgot to stop containers that somehow ended up causing the problem.

docker-compose stop

Like above, but also remove those containers

docker-compose down

Kill all docker containers. This is helpful for cleaning up remnants of previous assignments

docker kill $(docker ps -q)

Rebuilds all images, including MySQL

docker-compose build

Creates containers that aren't created yet, starts them if they have been created -d detaches terminal so you can use it again

docker-compose up -d

Ultimate fix: Stops and removes everything (including volumes), then builds from scratch, and then starts (sudo every command if needed)

docker-compose down -v && docker-compose build && docker-compose up

Desperate fix: (don't do this if you have other Docker projects running) Quits all Docker processes, deletes all containers and images, and starts from a clean slate

docker kill $(docker ps -q); docker system prune -af; docker-compose up

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 97.1%
  • Shell 2.7%
  • Dockerfile 0.2%