Initial commit: Sudoku game with accounts, history, leaderboard, themes and i18n
Node/Express + SQLite backend, vanilla JS frontend, deployed via Docker Compose.
This commit is contained in:
117
README.md
Normal file
117
README.md
Normal file
@@ -0,0 +1,117 @@
|
||||
# 🧩 Sudoku
|
||||
|
||||
*[English version below / Version anglaise plus bas](#-sudoku-english)*
|
||||
|
||||
Un jeu de Sudoku complet, jouable dans le navigateur, avec comptes utilisateurs, historique de parties, classement, thèmes de couleur et support multilingue (FR/EN) — le tout servi par un unique conteneur Docker (Node.js/Express + SQLite).
|
||||
|
||||

|
||||
|
||||
## Fonctionnalités
|
||||
|
||||
- **Génération de grilles** à 4 niveaux de difficulté (facile, moyen, difficile, expert), avec solution unique garantie
|
||||
- **Cycle de jeu explicite** : Démarrer / Pause / Stop (aucune partie ne se lance automatiquement)
|
||||
- **Aide au jeu** : notes (crayon), indices, annulation, détection des erreurs en temps réel
|
||||
- **Comptes utilisateurs** : inscription (pseudo, email, mot de passe — sans validation par email), connexion, mode invité toujours disponible
|
||||
- **Historique personnel** des parties (temps, erreurs, points, résultat)
|
||||
- **Classement** : meilleurs temps par difficulté et classement général par points cumulés
|
||||
- **Garde-fou anti-triche** : temps minimum plausible par difficulté avant qu'un score ne soit validé
|
||||
- **4 thèmes de couleur** : Bleu, Émeraude, Ambre, Noir & blanc + rouge
|
||||
- **Français / Anglais**, avec bascule instantanée et mémorisation du choix
|
||||
- **Guide du débutant** intégré, accessible sans compte
|
||||
|
||||
## Stack technique
|
||||
|
||||
- Frontend : HTML/CSS/JS vanilla (aucune dépendance de build)
|
||||
- Backend : Node.js + Express
|
||||
- Base de données : SQLite (fichier persistant, monté en bind mount)
|
||||
- Authentification : cookie JWT httpOnly, mots de passe hashés (bcrypt)
|
||||
- Déploiement : Docker / Docker Compose
|
||||
|
||||
## Démarrage rapide
|
||||
|
||||
```bash
|
||||
git clone https://gitea.harmonia-it.fr/snoopy/sudoku.git
|
||||
cd sudoku
|
||||
cp .env.example .env
|
||||
# Éditez .env et remplacez JWT_SECRET par une valeur aléatoire longue,
|
||||
# par exemple avec : openssl rand -hex 32
|
||||
docker compose up -d --build
|
||||
```
|
||||
|
||||
L'application est alors disponible sur `http://localhost:8090` (port configurable dans `docker-compose.yml`).
|
||||
|
||||
## Structure du projet
|
||||
|
||||
```
|
||||
sudoku/
|
||||
├── app/ # Frontend statique (HTML/CSS/JS), monté en bind mount (lecture seule)
|
||||
├── server/ # Backend Node/Express (API + service des fichiers statiques)
|
||||
├── data/ # Base SQLite persistante (bind mount, ignoré par git)
|
||||
├── docs/ # Ressources documentaires (capture d'écran, etc.)
|
||||
├── Dockerfile
|
||||
├── docker-compose.yml
|
||||
└── .env.example # Modèle de configuration (copier en .env)
|
||||
```
|
||||
|
||||
## Licence
|
||||
|
||||
Projet personnel, libre d'utilisation et de modification.
|
||||
|
||||
---
|
||||
|
||||
# 🧩 Sudoku (English)
|
||||
|
||||
A full-featured Sudoku game playable in the browser, with user accounts, game history, leaderboards, color themes, and multilingual support (FR/EN) — all served by a single Docker container (Node.js/Express + SQLite).
|
||||
|
||||

|
||||
|
||||
## Features
|
||||
|
||||
- **Puzzle generation** with 4 difficulty levels (easy, medium, hard, expert), each guaranteed to have a unique solution
|
||||
- **Explicit game lifecycle**: Start / Pause / Stop (no game ever starts automatically)
|
||||
- **Gameplay aids**: pencil notes, hints, undo, real-time mistake detection
|
||||
- **User accounts**: sign up (username, email, password — no email verification), log in, guest mode always available
|
||||
- **Personal history** of games played (time, mistakes, points, result)
|
||||
- **Leaderboards**: best times per difficulty and an overall ranking by cumulative points
|
||||
- **Anti-cheat safeguard**: a minimum plausible solve time per difficulty before a score is accepted
|
||||
- **4 color themes**: Blue, Emerald, Amber, Black & white + red
|
||||
- **French / English**, switchable instantly with the choice remembered
|
||||
- **Built-in beginner's guide**, accessible without an account
|
||||
|
||||
## Tech stack
|
||||
|
||||
- Frontend: vanilla HTML/CSS/JS (no build step required)
|
||||
- Backend: Node.js + Express
|
||||
- Database: SQLite (persistent file, bind-mounted)
|
||||
- Authentication: httpOnly JWT cookie, hashed passwords (bcrypt)
|
||||
- Deployment: Docker / Docker Compose
|
||||
|
||||
## Quick start
|
||||
|
||||
```bash
|
||||
git clone https://gitea.harmonia-it.fr/snoopy/sudoku.git
|
||||
cd sudoku
|
||||
cp .env.example .env
|
||||
# Edit .env and replace JWT_SECRET with a long random value,
|
||||
# e.g. using: openssl rand -hex 32
|
||||
docker compose up -d --build
|
||||
```
|
||||
|
||||
The app will then be available at `http://localhost:8090` (port configurable in `docker-compose.yml`).
|
||||
|
||||
## Project structure
|
||||
|
||||
```
|
||||
sudoku/
|
||||
├── app/ # Static frontend (HTML/CSS/JS), bind-mounted (read-only)
|
||||
├── server/ # Node/Express backend (API + static file serving)
|
||||
├── data/ # Persistent SQLite database (bind mount, git-ignored)
|
||||
├── docs/ # Documentation assets (screenshot, etc.)
|
||||
├── Dockerfile
|
||||
├── docker-compose.yml
|
||||
└── .env.example # Configuration template (copy to .env)
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Personal project, free to use and modify.
|
||||
Reference in New Issue
Block a user