Skip to content

HackYourFuture/CourseHub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CourseHub

A modern reference application that resembles a school administration system to manage courses, enrollments, etc.

This application is used in HackYourFuture to showcase best practices in building a full-stack application and for students to implement parts. For example, in the frontend course students create their own frontend and in the backend course create their own backend in Java.

Live demo

You can access a live demo of CourseHub at: https://coursehub.hyf.dev and explore the OpenAPI specification at: https://coursehub.hyf.dev/api/swagger-ui/index.html.

Development

Recommended Development Tools

Prerequisites to Run the Application

Make sure to have the following installed, for the backend application:

Make sure to have the following installed, for the frontend application:

Running the backend

Starting all required dependencies for the CourseHub backend:

docker compose up -d

To run the backend application, you can either:

  • Start application from the terminal:
    cd backend
    ./gradlew bootRun
  • Run the CourseHubApplication main class from your IDE.

Now you can access the CourseHub frontend UI on http://localhost:3000 and the backend API on http://localhost:8080.

Making requests

Without authentication, you can only access the public endpoints, for example:

curl http://localhost:8080/courses

You can also see all available endpoints in the OpenAPI documentation.

Running the frontend

By default, the frontend will be running on http://localhost:3000 from Docker compose. If you want to run it locally, follow the steps below.

To install the required dependencies (only once), from the frontend directory, run:

cd frontend
npm install

To run the frontend application locally, from the frontend directory, run:

cd frontend
npm run dev

Now you can access the CourseHub frontend UI on http://localhost:5173 in development mode.

Building docker images

To build a Docker image of the course-hub backend, from the backend directory, run:

cd backend
./gradlew bootBuildImage

To build a Docker image for the frontend, from the frontend directory, run:

cd frontend
docker build -t ghcr.io/hackyourfuture/course-hub-frontend .

Running docker image

After the image is built, you can run it using a special Docker Compose profile (make sure you stop the application if you're running it from Gradle or IDE):

docker compose up -d

Cleanup

Keep in mind that containers will keep running in the background even after you stop the application. To stop and remove the containers, run:

docker compose down -v