Code Monkey home page Code Monkey logo

cncnet-ladder-api's Introduction

CnCNet Ladder API

This is the main repository for the CnCNet Ladder API.

Getting started

  • Set up docker on your computer (either docker desktop or docker engine with docker-compose)
  • Copy .env-example to .env and configure docker related env.
  • Copy cncnet-api/.env-example to .env and configure laravel related env.

Production

If you are setting up your developpement environment, you can skip this chapter and go to the Development section.

  • Build docker image: docker-compose build
  • Start docker container: docker-compose up -d
  • Install dependencies and run any migrations inside the app service container: docker exec cncnet_ladder_app composer install && php artisan migrate
  • Generate laravel key inside the container docker exec cncnet_ladder_app php artisan key:generate.
  • Compile latest scss: npm run prod

Development

If you are setting up a prod or staging environment, you can skip this chapter and go to the Production section.

  • Build docker-compose -f docker-dev-compose.yml build
  • Run docker-compose -f docker-dev-compose.yml up -d to build and start the docker container
  • Install dependencies : docker exec cncnet_ladder_app composer install
  • Generate laravel key inside the container docker exec cncnet_ladder_app php artisan key:generate. This will output the new key, you must manually copy past it into your cncnet-api/.env.

After changing the .env :

  • rebuild docker with docker-compose -f .\docker-dev-compose.yml up -d.
  • clear cache with docker exec cncnet_ladder_app php artisan optimize:clear
  • Restore a database backup or migrate with docker exec cncnet_ladder_app php artisan migrate for an empty database

You are ready to go !

  • Open up http://localhost
  • Watch scss for changes: npm run watch
  • Access to phpmyadmin: open up http://localhost:8080
  • Access to database with you dbms : host:localhost port:3307 user:DB_USER pass:DB_PASS
  • Open a shell : docker exec -it cncnet_ladder_app /bin/bash

Storage links

Replace user with the host user ln -s /home/user/site/storage/app/avatars /home/user/site/public/avatars ln -s /home/user/site/storage/app/media /home/user/site/public/media

Built with

  • PHP 8.3
  • Laravel 11
  • Docker (PHP, Nginx, Mysql (Mariadb))

Useful resources

Troubleshooting

No supported encrypter found. The cipher and / or key length are invalid

You either forgot to generate the key or your env variable are not up to date

  • Generate key : docker exec cncnet_ladder_app php artisan key:generate or
  • Update env : rebuild docker with docker-compose -f .\docker-dev-compose.yml up -d.

SQLSTATE[42S02]: Base table or view not found ...

Your database is empty or missing tables

  • Restore from a backup or
  • Run migrations : docker exec cncnet_ladder_app php artisan migrate

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.