Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 9 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,11 @@ jobs:
npm version ${{ github.event.release.tag_name }}
cd ..

- name: Commit updated package.json
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: ${{ env.TARGET_BRANCH }}
commit_message: Update version in package.json
file_pattern: package.json

- name: Update version in backend/config.py
run: |
sed -i "s/API_DOCS_VERSION = '.*'/API_DOCS_VERSION = '${{ github.event.release.tag_name }}'/g" backend/config.py

- name: Commit updated backend/config.py
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: ${{ env.TARGET_BRANCH }}
commit_message: Update version in backend/config.py
file_pattern: backend/config.py
cd backend
echo ${{ github.event.release.tag_name }} > .version
cd ..

- name: Update changelog
uses: stefanzweifel/changelog-updater-action@v1
Expand All @@ -50,17 +38,14 @@ jobs:
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: ${{ env.TARGET_BRANCH }}
commit_message: Update changelog
file_pattern: CHANGELOG.md

- name: Move tag to current commit
run: |
git tag -f ${{ github.event.release.tag_name }}
commit_message: Release version ${{ github.event.release.tag_name }}

- name: Push changes
- name: Force move the tag to the current commit
run: |
git push origin ${{ env.TARGET_BRANCH }}
git push origin ${{ github.event.release.tag_name }}
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag -fa ${{ github.event.release.tag_name }} -m "Release version ${{ github.event.release.tag_name }}"
git push -f --tags

- name: "Send webhook to Discord"
uses: sarisia/actions-status-discord@v1
Expand Down
53 changes: 37 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,59 @@

All notable changes to this project will be documented in this file.

## 3.0.0-alpha.0 - A New Beginning - 2025-01-10

We are thrilled to announce the upcoming release of **LAN-party Management System (LANMS) 3.0**, a modern, web-based application designed to help you effortlessly manage your LAN-party events. Whether it's tournaments, games, tickets, or participants, LANMS is crafted to make event organization a breeze.
## 3.0.0-alpha.8 - 2025-01-10

### What is LANMS?
**Full Changelog**: https://github.com/kilobyteno/LANMS/compare/3.0.0-alpha.7...3.0.0-alpha.8

LANMS is your go-to solution for managing LAN-party events, designed to handle everything from game setup to participant management.
## 3.0.0-alpha.7 - 2025-01-10

LANMS will offer both **self-hosted** and **cloud-based** options, giving you the flexibility to manage your events the way you prefer.
**Full Changelog**: https://github.com/kilobyteno/LANMS/compare/3.0.0-alpha.6...3.0.0-alpha.7

### Current Project Status
## 3.0.0-alpha.6 - 2025-01-10

LANMS 3.0 is currently **under active development** and not yet ready for production use. Originally started in February 2023, the project encountered delays due to unforeseen circumstances. However, as of **September 25th, 2024**, we have officially restarted development from scratch, focusing on making LANMS 3.0 more **user-friendly, scalable, flexible,** and **open-source**.
**Full Changelog**: https://github.com/kilobyteno/LANMS/compare/3.0.0-alpha.5...3.0.0-alpha.6

Our goal is to deliver an advanced, community-driven platform that sets a new standard in LAN-party management.
## 3.0.0-alpha.5 - 2025-01-10

### A Brief History
**Full Changelog**: https://github.com/kilobyteno/LANMS/compare/3.0.0-alpha.4...3.0.0-alpha.5

LANMS has a rich history, with its origins dating back to **2014**, when [dsbilling](https://dsbilling.no) joined forces with [chilloman](https://github.com/chilloman) to build a system for a LAN-party event. The original version, **LANMS 1.0**, was heavily hardcoded for a specific event and remains closed-source for now.
## 3.0.0-alpha.4 - 2025-01-10

In **February 2015**, the project evolved into **LANMS 2.0**, a more flexible and scalable version, which was maintained privately until now and will become **open-source** in late September 2024 as **LANMS Legacy**.
**Full Changelog**: https://github.com/kilobyteno/LANMS/compare/3.0.0-alpha.3...3.0.0-alpha.4

LANMS 3.0, a complete rewrite of the previous version, marks a significant leap forward. Built with modern technologies and a strong focus on flexibility and user experience, it promises to be a powerful tool for LAN-party organizers across the globe.
## 3.0.0-alpha.3 - 2025-01-09

### What’s Next?
### Changed

We are dedicated to delivering a robust platform, and we invite the community to follow our progress as we work toward the first public release of LANMS 3.0. Stay tuned for updates and opportunities to contribute!
- **Enhanced GitHub Action Workflow**:

- Updated to use a new environment variable for more flexible management.
- Now handles updates to critical files (`package.json`, `backend/config.py`) that track software versioning.
- Improved automation ensures effective tracking and management of software changes.

- **Frontend Markdown Component Styling**:

- Slight adjustments to the `ReactMarkdown` component for a more refined display experience.

- **Styling Adjustments to the Changelog Page**:

- Increased the size of the main title (`CardTitle` component) to improve readability and visual appeal.


### Added

- **Utility Function Simplification**:
- Consolidated date-utilities into `frontend/src/lib/utils.ts` for better organization and maintainability.


---
### Removed

**Follow development on [GitHub](https://github.com/kilobyteno/lanms), join us on [Discord](https://kilobyte.no/discord) and help us in building the future of LAN-party management!**
- **Redundant Files**:
- Deleted the redundant file `frontend/src/lib/date.ts` to eliminate duplications in the codebase.


**Full Changelog**: https://github.com/kilobyteno/LANMS/compare/3.0.0-alpha.2...3.0.0-alpha.3

## 3.0.0-alpha.2 - 2025-01-02

Expand Down
1 change: 1 addition & 0 deletions backend/.version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0.0-alpha.8
5 changes: 5 additions & 0 deletions backend/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ class Config:
# API Docs
API_DOCS_TITLE: str = f'{MICRO_SERVICE_NAME_FOR_HUMANS} API'
API_DOCS_VERSION: str = '3.0.0-alpha.1'
try:
with open('.version') as version_file:
API_DOCS_VERSION: str = version_file.read().strip()
except Exception as e:
logging.error(f'Error reading version file: {e}')
API_DOCS_DESCRIPTION: str = f'Endpoints for the {MICRO_SERVICE_NAME_FOR_HUMANS}'
API_DOCS_OPENAPI_URL: Optional[str] = None if MICRO_SERVICE_IN_PRODUCTION else '/openapi.json'
API_DOCS_URL: str = '/docs'
Expand Down
2 changes: 1 addition & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<!--<link rel="icon" type="image/svg+xml" href="/vite.svg" />-->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LANMS</title>
</head>
Expand Down
4 changes: 2 additions & 2 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lanms-frontend",
"private": true,
"version": "3.0.0-alpha.1",
"version": "3.0.0-alpha.8",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import {AuthProvider} from './context/AuthContext';
import {OrganisationProvider} from './context/OrganisationContext';
import {EventProvider} from './context/EventContext';
import {router} from './routes';
import {ThemeProvider} from "@/components/theme-provider.tsx";
import {ThemeProvider} from "@/providers/theme-provider";

function App() {
return (
<ThemeProvider defaultTheme="light" storageKey="lanms-ui-theme">
<ThemeProvider>
<AuthProvider>
<OrganisationProvider>
<EventProvider>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/nav-theme-switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import {
DropdownMenuItem,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu"
import {useTheme} from "@/components/theme-provider"
import {DesktopTower, Moon, Sun} from "@phosphor-icons/react";
import {useTranslation} from "react-i18next";
import {Tooltip, TooltipContent, TooltipProvider, TooltipTrigger} from "@/components/ui/tooltip.tsx";
import { useTheme } from "@/providers/theme-provider"

export function NavThemeSwitch() {
const {setTheme, theme} = useTheme()
Expand Down
57 changes: 36 additions & 21 deletions frontend/src/components/theme-provider.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createContext, useContext, useEffect, useState} from "react"
import { createContext, useContext, useEffect, useState } from "react"

type Theme = "dark" | "light" | "system"

Expand All @@ -21,38 +21,52 @@ const initialState: ThemeProviderState = {
const ThemeProviderContext = createContext<ThemeProviderState>(initialState)

export function ThemeProvider({
children,
defaultTheme = "system",
storageKey = "lanms-ui-theme",
...props
}: ThemeProviderProps) {
const [theme, setTheme] = useState<Theme>(
() => (localStorage.getItem(storageKey) as Theme) || defaultTheme
)
children,
defaultTheme = "system",
storageKey = "theme",
...props
}: ThemeProviderProps) {
const [theme, setTheme] = useState<Theme>(() => {
const storedTheme = localStorage.getItem(storageKey) as Theme
return storedTheme || defaultTheme
})

useEffect(() => {
const root = window.document.documentElement
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)")

// Remove existing theme classes
root.classList.remove("light", "dark")

if (theme === "system") {
const systemTheme = window.matchMedia("(prefers-color-scheme: dark)")
.matches
? "dark"
: "light"
// Apply theme
const applyTheme = (theme: Theme) => {
if (theme === "system") {
const systemTheme = mediaQuery.matches ? "dark" : "light"
root.classList.add(systemTheme)
} else {
root.classList.add(theme)
}
}

// Initial theme application
applyTheme(theme)

root.classList.add(systemTheme)
return
// Listen for system theme changes
const handleChange = () => {
if (theme === "system") {
applyTheme("system")
}
}

root.classList.add(theme)
mediaQuery.addEventListener("change", handleChange)
return () => mediaQuery.removeEventListener("change", handleChange)
}, [theme])

const value = {
theme,
setTheme: (theme: Theme) => {
localStorage.setItem(storageKey, theme)
setTheme(theme)
setTheme: (newTheme: Theme) => {
localStorage.setItem(storageKey, newTheme)
setTheme(newTheme)
},
}

Expand All @@ -66,8 +80,9 @@ export function ThemeProvider({
export const useTheme = () => {
const context = useContext(ThemeProviderContext)

if (context === undefined)
if (context === undefined) {
throw new Error("useTheme must be used within a ThemeProvider")
}

return context
}
1 change: 1 addition & 0 deletions frontend/src/components/ui/badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const badgeVariants = cva(
destructive:
"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
outline: "text-foreground",
prerelease: "bg-orange-50 dark:bg-orange-950 text-orange-400 dark:text-orange-400 border-orange-200 dark:border-orange-800 font-normal",
},
},
defaultVariants: {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/version-checker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function VersionChecker() {

return (
<>
<a href='https://lanms.net' target='_blank' rel='noopener noreferrer' className='text-xs text-gray-300 dark:text-gray-800 hover:text-muted-foreground dark:hover:text-secondary-foreground'>LANMS {CURRENT_VERSION}</a>
<a href='https://lanms.net' target='_blank' rel='noopener noreferrer' className='text-xs text-gray-300 dark:text-gray-500 hover:text-muted-foreground dark:hover:text-secondary-foreground'>LANMS {CURRENT_VERSION}</a>
{hasUpdate && (
<Badge variant="outline">
<a
Expand Down
31 changes: 0 additions & 31 deletions frontend/src/hooks/useTheme.ts

This file was deleted.

1 change: 1 addition & 0 deletions frontend/src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"back": "Back",
"deleting": "Deleting...",
"cancel": "Cancel",
"view_on_github": "View on GitHub",
"saving": "Saving...",
"save": "Save"
},
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/locales/no.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"back": "Tilbake",
"deleting": "Sletter...",
"cancel": "Avbryt",
"view_on_github": "Vis på GitHub",
"saving": "Lagrer...",
"save": "Lagre"
},
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/locales/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"back": "Tillbaka",
"deleting": "Radering...",
"cancel": "Avbryt",
"view_on_github": "Vis på GitHub",
"saving": "Sparar...",
"save": "Spara"
},
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lib/api/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface GitHubRelease {
published_at: string;
body: string;
html_url: string;
prerelease: boolean;
}

export const fetchGitHubReleases = async (): Promise<GitHubRelease[]> => {
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/pages/attendee/events/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {useState, useEffect} from 'react';
import {Link} from 'react-router-dom';
import {Calendar} from "@phosphor-icons/react";
import { route, RouteConfig } from '@/routes/route-config';
import { formatDate } from '@/lib/utils';

export default function EventsPage() {
const {t} = useTranslation();
Expand Down Expand Up @@ -53,7 +54,7 @@ export default function EventsPage() {
<div className="space-y-2">
<div className="flex items-center gap-2">
<Calendar className="h-4 w-4"/>
<span>{new Date(event.start_at).toLocaleDateString()} &mdash; {new Date(event.end_at).toLocaleDateString()}</span>
<span>{formatDate(event.start_at)} &mdash; {formatDate(event.end_at)}</span>
</div>
<p className="text-sm text-muted-foreground">
{event.description}
Expand Down
Loading
Loading