A deck builder web application for the Altered TCG card game, built with Next.js 15, React 19, TypeScript and Tailwind CSS v4.
- Browse cards via the API (filters by faction, type, cost, set, rarity)
- Build decks with format-aware validation (Standard, NUC, Singleton)
- Save and manage decks (create, edit, delete)
- Import an existing deck from the API
- Light / dark mode
- Node.js >= 18
- npm >= 9
git clone git@github.com:Altered-Community/altered-deckbuilder-poc-v2.git
cd altered-deckbuilder-poc-v2npm installCopy the example file and fill in the values:
cp .env.local.example .env.local.env.local content:
NEXT_PUBLIC_API_URL=https://altered-core-cards-api.toxicity.be/api
NEXT_PUBLIC_DECK_API_URL=https://altered-core-decks-api.toxicity.be/apiBoth variables can point to local instances if you are running the APIs locally, e.g.
http://localhost:8000/api.
npm run devThe app is available at http://localhost:3000.
# Using nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
nvm install 20
nvm use 20git clone git@github.com:Altered-Community/altered-deckbuilder-poc-v2.git
cd /var/www/altered-deckbuilder-poc-v2
npm installcp .env.local.example .env.local
nano .env.localSet the production URLs for both APIs.
npm run buildnpm run startThe app listens on port 3000 by default. To change the port:
PORT=8080 npm run startAn nginx.conf.example file is provided at the root of the project. To use it:
# Copy the config to sites-available
cp nginx.conf.example /etc/nginx/sites-available/altered-deckbuilder-poc-v2
# Replace your-domain.com with your actual domain
nano /etc/nginx/sites-available/altered-deckbuilder-poc-v2
# Enable the site
ln -s /etc/nginx/sites-available/altered-deckbuilder-poc-v2 /etc/nginx/sites-enabled/
# Test and reload
nginx -t && systemctl reload nginxEnable HTTPS with Certbot:
certbot --nginx -d your-domain.comCertbot will automatically update the config to enable the HTTPS block and redirect HTTP.
npm install -g pm2
pm2 start npm --name "altered-deckbuilder-poc-v2" -- start
pm2 save
pm2 startupTo redeploy after an update:
git pull
npm install
npm run build
pm2 restart altered-deckbuilder-poc-v2| Variable | Description | Example |
|---|---|---|
NEXT_PUBLIC_API_URL |
Cards API base URL | https://altered-core-cards-api.toxicity.be/api |
NEXT_PUBLIC_DECK_API_URL |
Decks API base URL | htps://altered-core-decks-api.toxicity.be/api |
The
NEXT_PUBLIC_prefix exposes these variables client-side. Never store secrets in them.
app/ # Next.js pages (App Router)
deck/ # Deck editor
decks/ # Deck list, detail and import
components/ # React components
cards/ # Card browser and card item
deck/ # Deck panel, stats, save button
lib/
api/ # API calls (cardApi, deckApi)
types/ # TypeScript interfaces (card, deck, constants)
utils/ # Utilities (card, format)
store/ # Global Zustand state (deckStore, authStore)
- Next.js 15 — App Router
- React 19
- TypeScript 5
- Tailwind CSS v4
- TanStack Query v5 — data fetching
- Zustand v5 — state management
- next-themes — dark/light mode