Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
cb8d4e8
chore: update dependencies
nehalist Nov 7, 2023
1ffe7e5
feat: add next ui, email provider login
nehalist Nov 7, 2023
c65265c
refactor: start with saas refactoring
nehalist Dec 3, 2023
a79a734
feat: improve user profiles
nehalist Dec 5, 2023
f1ea1b0
feat: add server action utility
nehalist Dec 10, 2023
5315e6a
feat: add i18n
nehalist Dec 10, 2023
edba712
feat: add league creation
nehalist Dec 15, 2023
1c965fb
feat: improve league settings
nehalist Dec 17, 2023
9f80c79
feat: add blog
nehalist Dec 17, 2023
ec29f26
chore: increase version to 1.0.0
nehalist Dec 19, 2023
a1c95a4
feat: add league to matches
nehalist Dec 19, 2023
3b2a3cd
refactor: add drizzle
nehalist Dec 23, 2023
5dcb1ac
feat: improve league management
nehalist Dec 28, 2023
db05b7a
feat: improve league management
nehalist Dec 30, 2023
12d0373
feat: add admin
nehalist Jan 1, 2024
845cc7a
feat: improve league management
nehalist Jan 4, 2024
34e4170
feat: add league invites
nehalist Jan 7, 2024
60e9dce
chore: cleanup
nehalist Jan 7, 2024
254c624
feat: add react email
nehalist Jan 7, 2024
79713df
feat: improve home
nehalist Jan 9, 2024
7064315
feat: improve home
nehalist Jan 21, 2024
4664514
feat: add teamsize column
nehalist Jan 21, 2024
48f9790
docs: improve readme
nehalist Jan 21, 2024
eb2691c
feat: simplify
nehalist Jan 23, 2024
e9be449
feat: simplify even more
nehalist Jan 24, 2024
dd1592a
feat: re-enable team selector
nehalist Jan 25, 2024
1ca5f39
feat: add match creation
nehalist Jan 26, 2024
0f833ef
feat: add calculated ratings
nehalist Jan 28, 2024
873ef6e
feat: improve match creation
nehalist Feb 3, 2024
337b764
feat: add footer
nehalist Feb 4, 2024
42e8e19
feat: add teams table additional score columns
aschulhofer Feb 5, 2024
1e52a96
feat: improve league management
nehalist Feb 5, 2024
b6818e7
feat: add simple db seeder for teams
aschulhofer Feb 6, 2024
aee50a0
feat: add basic teams table component
aschulhofer Feb 6, 2024
7f8f0aa
feat: add membership removal
nehalist Feb 6, 2024
9407259
cs: fix cs
nehalist Feb 6, 2024
f42b7fc
ci: fix node version
nehalist Feb 6, 2024
2654284
ci: enable workflow on all branches
nehalist Feb 6, 2024
fe518dc
test: add dummy test
nehalist Feb 6, 2024
617e377
refactor: simplify admin
nehalist Feb 6, 2024
1aea32d
cs: fix unescaped entities
nehalist Feb 6, 2024
1babf00
refactor: refactor to next-safe-action
nehalist Feb 10, 2024
d23fbeb
feat: improve match creation
nehalist Feb 10, 2024
5be56a4
feat: merge teams
nehalist Feb 10, 2024
9699d23
feat: add achievements
nehalist Feb 11, 2024
01c90d8
feat: improve match table
nehalist Feb 13, 2024
d22c7d5
build: fix package lock
nehalist Feb 15, 2024
5fafab3
feat: improve landing page
nehalist Mar 12, 2024
61471fd
feat: add changelog and more
nehalist Apr 9, 2024
5c58b2a
feat: add team flairs
nehalist Apr 12, 2024
52c4651
fix: use english translation for german temporarily
nehalist Apr 12, 2024
386dfb9
build: run migrations on build
nehalist Apr 12, 2024
1187152
chore: cleanup
nehalist Apr 14, 2024
ff07858
cs: fix cs
nehalist Apr 15, 2024
a6308b4
test: temporarily fix tests
nehalist Apr 15, 2024
d829def
chore: cleanup
nehalist Apr 24, 2024
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
6 changes: 0 additions & 6 deletions .babelrc

This file was deleted.

12 changes: 9 additions & 3 deletions .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Password for /admin
ADMIN_PASSWORD=h1ldeb3steV3r
NEXT_PUBLIC_SITE_URL=http://localhost:3000

EMAIL_SERVER=smtp://localhost:1025
EMAIL_FROM=noreply@hilde.gg

# Arbitrary string used to generate secure tokens
NEXTAUTH_SECRET=+Zrk5zW6fgog5k0LbN4bxL1YXKIhvb65Yln5ZKf+g3o=
Expand All @@ -8,4 +10,8 @@ NEXTAUTH_SECRET=+Zrk5zW6fgog5k0LbN4bxL1YXKIhvb65Yln5ZKf+g3o=
NEXTAUTH_URL=http://localhost:3000

# Database connection string
DATABASE_URL=mysql://root:hildepw@localhost:3309/hilde
DATABASE_URL=postgresql://user:password@127.0.0.1:5432/app?search_path=public

# OAuth
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
7 changes: 3 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@ on:
tags:
- '*'
branches:
- main
- '*'
pull_request:
branches:
- main
types: [opened, reopened]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [ 14.x ]
node-version: [ 20.x ]

steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

.react-email

.idea
db.sqlite
db.sqlite-journal

public/uploads

# dependencies
/node_modules
/.pnp
Expand Down
3 changes: 2 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"singleQuote": false,
"bracketSpacing": true,
"printWidth": 80,
"arrowParens": "avoid"
"arrowParens": "avoid",
"plugins": ["prettier-plugin-organize-imports"]
}
116 changes: 55 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# Hilde 🏆

> [!CAUTION]
> WIP 1.0.0

![Build](https://img.shields.io/github/actions/workflow/status/nehalist/hilde/build.yml?branch=main)
![License](https://img.shields.io/github/license/nehalist/hilde)
![Docker Pulls](https://img.shields.io/docker/pulls/nehalist/hilde)

You've got a foosball table or similar in your office and want to track your matches, player progress and compare yourself to your
colleagues and see who's the best? You've come to the right place.
**Hilde** is a match tracking app for games like foosball, table tennis, air hockey, etc. with achievements, elo ratings, statistics and
more. **Hilde** is easy to setup and can be used by everyone.

A public **demo** is available at [demo.hilde.gg](https://demo.hilde.gg).
[//]: # (You've got a foosball table or similar in your office and want to track your matches, player progress and compare yourself to your)
[//]: # (colleagues and see who's the best? You've come to the right place.)
[//]: # (**Hilde** is a match tracking app for games like foosball, table tennis, air hockey, etc. with achievements, elo ratings, statistics and)
[//]: # (more. **Hilde** is easy to setup and can be used by everyone.)
[//]: # ()
[//]: # (A public **demo** is available at [demo.hilde.gg](https://demo.hilde.gg).)

![Hilde](hilde.png)

Expand All @@ -23,36 +26,27 @@ A public **demo** is available at [demo.hilde.gg](https://demo.hilde.gg).

## ⚡️ Features

- Simple, intuitive interface
- **Elo rating** for each team
- **Seasons** (managable via admin interface)
- Detailed team statistics (winstreaks, winrate, elo history chart, ...)
- **Achievements** (e.g. "Win 100 Matches", "Win 10 Matches in a row", ...)
- Compare teams against each other
- Teams of any size, simply separated by a comma in the team name
- **Light/Dark theme**
- Match comments
- **Leaderboards**
- *Optional*: Deployable for free with Vercel & Planetscale
- *Optional*: Fully dockerized
[//]: # (- Simple, intuitive interface)
[//]: # (- **Elo rating** for each team)
[//]: # (- **Seasons** (managable via admin interface))
[//]: # (- Detailed team statistics (winstreaks, winrate, elo history chart, ...))
[//]: # (- **Achievements** (e.g. "Win 100 Matches", "Win 10 Matches in a row", ...))
[//]: # (- Compare teams against each other)
[//]: # (- Teams of any size, simply separated by a comma in the team name)
[//]: # (- **Light/Dark theme**)
[//]: # (- Match comments)
[//]: # (- **Leaderboards**)
[//]: # (- *Optional*: Deployable for free with Vercel & Planetscale)
[//]: # (- *Optional*: Fully dockerized)

## ⭐ Getting Started

Hilde can be installed in a few minutes, either by deploying it to Vercel, using Docker or setting it up manually.
[//]: # (Hilde can be installed in a few minutes, either by deploying it to Vercel, using Docker or setting it up manually.)

Requirements:

- Node 14
- MySQL (5.7+)

Keep in mind that after installing you need to add a season via the admin ui (`/admin`) using the password from the environment variable (`ADMIN_PASSWORD`).

### Free hosting with Vercel & Planetscale

Hilde is designed in a way that it could easily be hosted for free, using [Vercel](https://vercel.com) for hosting
and [Planetscale](https://planetscale.com) for the database.

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fnehalist%2Fhilde)
- Node 20
- PostgreSQL 13+

### Docker Compose

Expand All @@ -72,17 +66,17 @@ services:
- '127.0.0.1:3000:3000'
environment:
- DATABASE_URL=mysql://root:hildepw@database:3306/hilde
- ADMIN_PASSWORD=v3rys3cr3tp4ssw0rd

database:
networks:
- internal
image: mysql:8.0
environment:
- MYSQL_DATABASE=hilde
- MYSQL_ROOT_PASSWORD=hildepw
db:
image: postgres:13.3
ports:
- "5432:5432"
volumes:
- db:/var/lib/mysql
- db_data:/var/lib/postgresql/data/
environment:
POSTGRES_DB: app
POSTGRES_USER: user
POSTGRES_PASSWORD: password

volumes:
db:
Expand All @@ -98,8 +92,9 @@ After running `docker-compose up -d` Hilde is running on `localhost:3000`.
1. Clone/fork the repository
2. Run `npm ci` to install dependencies
3. Run `docker-compose up -d` in order to start the database container (or adjust the `.env` file to use a different db)
4. Run `npm run dev` to start the development server
5. Add awesome features.
4. Run `npm run db:migrations:make` to execute all migrations
5. Run `npm run dev` to start the development server (at `localhost:3000`)
6. Add **awesome** features.

### Docker

Expand All @@ -112,44 +107,43 @@ via:

## ⚙️ Usage

### Administration

Hilde provides an admin ui at `/admin` which can be used to manage seasons.

### Commands

Hilde provides a set of utility terminal commands:

| Command | Description |
|-------------------|-------------------------------|
| `npm run dev` | Starts the development server |
| `npm run build` | Builds the app |
| `npm run start` | Starts the production server |
| `npm run lint` | Lints files |
| `npm run migrate` | Executes Prisma migrations |
| Command | Description |
|---------------------------------|----------------------------------------------------------------------|
| `npm run dev` | Starts the development server |
| `npm run build` | Builds the app |
| `npm run start` | Starts the production server |
| `npm run lint` | Lints files |
| `npm run db:migrations:make` | Create migrations |
| `npm run db:migrations:execute` | Execute migrations |
| `npm run email:dev` | Run [react-email dev server](https://react.email/docs/cli#email-dev) |

### Configuration

Hilde can be configured via environment variables in the `.env` file.

| Variable | Description | Default |
|-------------------|----------------------------|------------------------------------------------|
| `ADMIN_PASSWORD` | Administration password | `h1ldeb3steV3r` |
| `NEXTAUTH_SECRET` | Token secret | `+Zrk5zW6fgog5k0LbN4bxL1YXKIhvb65Yln5ZKf+g3o=` |
| `NEXTAUTH_URL` | Deployed URL of Hilde | `http://localhost:3000` |
| `DATABASE_URL` | Database connection string | `mysql://root:hildepw@localhost:3309/hilde` |
| Variable | Description | Default |
|------------------------|----------------------------|--------------------------------------------------------------------|
| `NEXT_PUBLIC_SITE_URL` | Site URL | `http://localhost:3000` |
| `EMAIL_SERVER` | Email server config | `smtp://localhost:1025` |
| `EMAIL_FROM` | Default sender email | `noreply@hilde.gg` |
| `NEXTAUTH_SECRET` | Token secret | `+Zrk5zW6fgog5k0LbN4bxL1YXKIhvb65Yln5ZKf+g3o=` |
| `NEXTAUTH_URL` | Deployed URL of Hilde | `http://localhost:3000` |
| `DATABASE_URL` | Database connection string | `postgresql://user:password@127.0.0.1:5432/app?search_path=public` |

## 👐 Contributing

Hilde was created for fun and to play around with technologies I don't use on a daily basis in my office job, hence can be improved by many ways.

It's built on:

- [Next.js 13](https://nextjs.org/)
- [tRPC](https://trpc.io/)
- [Next.js 14](https://nextjs.org/)
- [Tailwind CSS](https://tailwindcss.com/)
- [TypeScript](https://www.typescriptlang.org/)
- [Prisma](https://www.prisma.io/)
- [Drizzle](https://orm.drizzle.team/)
- [NextAuth.js](https://next-auth.js.org/)
- and many more (see [package.json](package.json))

Expand Down
40 changes: 40 additions & 0 deletions content/de/changelog/test.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: Test DE
date: 2024-04-01
---

## Nec ad molliter navita sustinet

Lorem markdownum aeque non sit nescimus patuit regis fas. Spes dum socerum
concedimus isto matrum, violentior adspexi exhibuit.

> Herbis tot dedit *fiducia laniataque* ferro populique quid parantem etiam
> *Fame* seraque nunc rarus nescia est terrae! Quae fuit coniugis auctor?
> Clymene munere clamavit adversas neque ipsi quereretur nostrae tamen flexere
> longe. Troiana nec moveri, ver onerata patiar, *sum erit* amissam tanta bubo
> huc sic.

Radiantis pariter, vidit aquis ab nymphae Cinyrae, si esse dantibus coercet
fecit; Actoridaeque viros. Sparsi notae terga forsitan. Sequens vindicet parva
imagine, in tum nunc illo dixisse nec pectore, et.

## Dracones latet

Mea de **admota praesaga**, usus venerat et dives [murmure
undis](http://carbasa-in.com/dictis-infirmis.php) de. Iunguntur tergum,
inplicuit usus; cum ramis usus ultima, ut nullo. Prospicit parmam fallitur
partior, esse, capillis *suis*, tua nec inmergitque et puto rigido grege in
derigere iuvencae. Nil factoque amor est tantum sibi recusem omen ignare? Est
nec magis tactuque sustulit legeret *vulnere* loqui muneris claudit, concubitus
[aequoris crevit quamvis](http://phrygum-iuravimus.org/crede-animalia) at ora!

Abstulit inde luce et utque: ituras quodque petens aquae. Erat qua argentea, cur
ardor haud vincta harena tertius quicquam huius!

Favore artus fatum ab nitenti longius e regis quaeris contingere fontis, est.
Doluere infesto fecit infelix beati mox natae consorti laudare licet: hunc.
Oscula aliquis lauro. Praecordia arescere, glans aptos caelum novissima femina
tantum loca conata Sisyphon: lacerto veri! Superare stimulis senserat deducit
gradus; inque Morpheus respicit manant quattuor quoscumque putares per, in.

Editus volucris refero. Praeside anus arcton, nec ab idem.
Empty file added content/de/faq.mdx
Empty file.
24 changes: 24 additions & 0 deletions content/en/changelog/0-4-0.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: 1.0.0-beta1 - Hilde as a Platform
date: 2024-04-01
---

Hilde is now a platform! 🎉

## Added

- Added landing page
- Added user system
- Added league system
- Added customizable rating parameters
- Added social login
- Added achievement rewards
- Added more achievements
- Added i18n support
- Added match detail view
- Added league statistics

## Changed

- Changed styling
- Leaderboards have been replaced with statistics and are shown after a league has been finished
13 changes: 13 additions & 0 deletions content/en/faq.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Faq>
<Accordion variant="bordered">
<AccordionItem key="1" aria-label="Accordion 1" title="Accordion 1">
this is content
</AccordionItem>
<AccordionItem key="2" aria-label="Accordion 2" title="Accordion 2">
this is more content
</AccordionItem>
<AccordionItem key="3" aria-label="Accordion 3" title="Accordion 3">
this is very little content
</AccordionItem>
</Accordion>
</Faq>
26 changes: 16 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
version: '3'
version: '3.4'

services:
database:
container_name: hilde_db
image: mysql:8.0
environment:
- MYSQL_DATABASE=hilde
- MYSQL_ROOT_PASSWORD=hildepw
db:
image: postgres:13.3
ports:
- "127.0.0.1:3309:3306"
- "5432:5432"
volumes:
- db:/var/lib/mysql
- db_data:/var/lib/postgresql/data/
environment:
POSTGRES_DB: app
POSTGRES_USER: user
POSTGRES_PASSWORD: password

mail:
image: axllent/mailpit
ports:
- "1025:1025"
- "8025:8025"

volumes:
db:
db_data:
11 changes: 11 additions & 0 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import "dotenv/config";
import type { Config } from "drizzle-kit";

export default {
schema: "./src/db/schema.ts",
out: "./drizzle",
driver: "pg",
dbCredentials: {
connectionString: `${process.env.DATABASE_URL}`,
},
} satisfies Config;
Loading