2024-07-24 12:35:33 +02:00
# Wikipedia Game Solver
> \[!IMPORTANT\]
2024-08-30 20:18:56 +02:00
> The project is **abandoned and not maintained anymore**.
2024-08-25 01:50:29 +02:00
>
2024-08-30 20:18:56 +02:00
> It was a **proof of concept** to deal with large amounts of data in databases, and have some fun dealing with Wikipedia data.
> It was also a way to learn and experiment with a clean monorepo architecture, with [Turborepo](https://turbo.build/repo), and [TypeScript](https://www.typescriptlang.org/) as the main language.
2024-08-30 20:14:50 +02:00
> The project setup **can be reused as a template/boilerplate for future projects**.
2024-07-24 12:35:33 +02:00
## About
The Wikipedia Game involves players competing to navigate from one [Wikipedia ](https://en.wikipedia.org/ ) page to another using only internal links.
[**Wikipedia Game Solver** ](https://wikipedia-game-solver.theoludwig.fr ) is a tool that helps you find the shortest path between two Wikipedia pages, using only internal links, basically solving the Wikipedia Game for you.
2024-08-30 20:18:56 +02:00
~~Available online: < https: // wikipedia-game-solver . theoludwig . fr > ~~ => **Offline** as the project is abandoned.
2024-07-24 12:35:33 +02:00
## Getting Started
### Prerequisites
- [Node.js ](https://nodejs.org/ ) >= 22.0.0
2024-08-30 20:14:50 +02:00
- [pnpm ](https://pnpm.io/ ) >= 9.9.0
2024-08-09 23:51:41 +02:00
- [Docker ](https://www.docker.com/ )
2024-07-24 12:35:33 +02:00
### Installation
```sh
# Go to the project root
cd wikipedia-game-solver
# Configure environment variables
cp .env.example .env
cp apps/website/.env.example apps/website/.env
2024-08-09 23:51:41 +02:00
cp apps/api/.env.example apps/api/.env
2024-07-24 12:35:33 +02:00
# Install dependencies
pnpm install --frozen-lockfile
# Install Playwright browser binaries and their dependencies (tests)
pnpm exec playwright install --with-deps
```
### Development
```sh
2024-08-09 23:51:41 +02:00
# Start the development servers
2024-07-24 12:35:33 +02:00
node --run dev
2024-08-09 23:51:41 +02:00
# Start the development Docker services (e.g: Database)
2024-08-10 02:32:34 +02:00
docker compose --file compose.dev.yaml up
2024-08-09 23:51:41 +02:00
2024-08-25 01:50:29 +02:00
# Database migrations
node --run database:migrate
2024-07-24 12:35:33 +02:00
# Lint
node --run lint:editorconfig
node --run lint:prettier
node --run lint:eslint
node --run lint:typescript
# Tests
node --run test
# Build
node --run build
2024-08-09 23:51:41 +02:00
# To execute a command in a specific package (e.g: apps/api)
cd apps/api
node --run ace -- list
2024-07-24 12:35:33 +02:00
```
### Production environment with [Docker](https://www.docker.com/)
```sh
# Setup and run all the services for you
docker compose up --build
2024-08-25 01:50:29 +02:00
# To execute database migrations
docker compose exec wikipedia-game-solver-api sh
node --run database:migrate
2024-07-24 12:35:33 +02:00
```
#### Services started
2024-08-09 23:51:41 +02:00
- `apps/website` : < http: // 127 . 0 . 0 . 1:5000 >
- `apps/api` : < http: // 127 . 0 . 0 . 1:5500 >
2024-07-24 12:35:33 +02:00
## License
[MIT ](./LICENSE )