Skip to content

cnc-community/cnc.community

Repository files navigation

C&C Community Logo

C&C Community Website

CnC.Community is a website that hopes to serve as an aggregate for C&C news and modding content from across the community; as well as provide a platform for influencers and livestreamers from the wider C&C community to promote their content.

Why is it necessary?

Check out our mission

🚀 Quick start

Development

Node 14.21.3

docker-compose -f docker-compose-dev.yml build
docker-compose -f docker-compose-dev.yml up -d 
docker-compose -f docker-compose-dev.yml exec app bash ./install.sh

Production

docker-compose build
docker-compose up -d
docker-compose exec app bash ./install.sh

Seeding Leaderboard for Local Development

  • Login to localhost:8080/admin/dashboard with local env credentials: admin@cnc.community & password
  • Run the leaderboard sync - localhost:8080/admin/seed-local-development (It will likely timeout but there will be enough data to use)
  • Login to phpmyadmin localhost:8081/ with root and cnccommunity. Run the sql queries in the cnccommunity_ladder table:
ALTER TABLE `matches` ADD INDEX `matches_leaderboard_history_id_index` (leaderboard_history_id)
  • Fulltext search for player ids/names
ALTER TABLE `matches` ADD FULLTEXT `matches_fulltext_players_index` (players)
ALTER TABLE `matches` ADD FULLTEXT `matches_fulltext_names_index` (names)

Other

Steam API Key

It seems after a period of time steam API key expire. If anything steam related on the site is no longer displaying, edit the .env and update STEAM_API_KEY with a new steam key. Register a new steam key here: https://steamcommunity.com/dev. Clear site wide cache the site should be fetching steam related content again.

Images

It could be the symlink for images needs to be updated for you. If so run rm -rf public/storage from the src.

  • Get container id by running docker ps
  • Relink symlink for storage docker exec -it <container_id> php artisan storage:link

Getting setup without docker

  • Create a database and rename env.example to .env, updating DB_DATABASE, DB_USERNAME and DB_PASSWORD
  • In the src directory is the standard Laravel files. Run the following commands:
    composer install
    npm install
    php artisan migrate migrate:fresh --seed
    php artisan storage:link
    php artisan serve --port=8080