8000 GitHub - Shadow-Devil/w03-template: Template Repository for W03 In-Class Exercise
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Shadow-Devil/w03-template

 
 

Repository files navigation

DevOps W03 In-Class Exercise Template

This repository contains a full-stack application with a SvelteKit client and a Spring Boot server. It demonstrates modern web application architecture and DevOps practices.

Project Overview

This project includes:

  • Client: SvelteKit with TypeScript, TailwindCSS, and reusable UI components.
  • Server: Spring Boot Java application with RESTful APIs.
  • DevOps: Dockerized services, CI/CD pipelines, and production-ready deployment configurations.

Prerequisites

  • Node.js (v22 or later)
  • Java JDK 21+
  • Gradle
  • Docker and Docker Compose
  • Git

Setup Instructions

Clone the Repository

git clone https://github.com/yourusername/w03-template.git
cd w03-template

Client Setup

  1. Navigate to the client directory:
    cd client
  2. Install dependencies:
    npm install

Server Setup

  1. Navigate to the server directory:
    cd server
  2. Build the project:
    ./gradlew build

Running the Application

Start the Client

cd client
npm run dev

The client will be available at http://localhost:3000.

Start the Server

cd server
./gradlew bootRun

The server API will be available at http://localhost:8080.

Development Workflow

Client Development

  • Built with SvelteKit and TypeScript for a modern, reactive UI.
  • TailwindCSS for styling.
  • Components and routes are organized in the src directory.

Server Development

  • Built with Spring Boot for scalable and maintainable server services.
  • Gradle is used for dependency management and building.
  • Source code is in the src/main/java directory.
  • Tests are in the src/test/java directory.

Building for Production

Client Build

cd client
npm run build

Server Build

cd server
./gradlew clean build

Dockerized Deployment

The project includes Docker configurations for containerized deployment.

Build and Run with Docker Compose

  1. Build and start the services:
    docker-compose up --build
  2. Access the application:

Production Deployment

Use the docker-compose.prod.yml file for production deployment. Ensure environment variables are set correctly.

docker-compose -f docker-compose.prod.yml up -d

CI/CD Pipeline

The project includes GitHub Actions workflows for:

  • Building Docker Images: Automatically builds and pushes Docker images to GitHub Container Registry.
  • Deploying Docker Images: Deploys the application to a production environment using Docker Compose.

Project Structure

├── client/                  # SvelteKit client
│   ├── src/                 # Source code
│   ├── public/              # Static assets
│   └── package.json         # Client dependencies
│
├── server/                  # Spring Boot server
│   ├── src/                 # Source code
│   ├── build.gradle         # Gradle build file
│   └── Dockerfile           # Server Dockerfile
│
├── docker-compose.yml       # Docker Compose for local development
├── docker-compose.prod.yml  # Docker Compose for production
└── .github/workflows/       # CI/CD workflows

License

This project is licensed under the MIT License.

About

Template Repository for W03 In-Class Exercise

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 53.4%
  • CSS 25.4%
  • Svelte 7.4%
  • Dockerfile 5.8%
  • JavaScript 3.8%
  • TypeScript 2.2%
  • HTML 2.0%
0