Coder Social home page Coder Social logo

xalok's Introduction

Hiberus Tests

ย 

Table of contents


Overview

XALOK is part of a test for Hiberus. Its purposes are:

  • Provide the Web GUI to create / register trips.
  • A fullstack habilities, using php and js.


System Requirements

๐Ÿณ Docker

โš™๏ธ View Instructions

Install Docker for your platform. Documentation: https://docs.docker.com/get-docker/

OS Installer
macOS https://docs.docker.com/desktop/mac/install/
Windows https://docs.docker.com/desktop/windows/install/
Linux https://docs.docker.com/engine/install/

๐Ÿ“ Docker Compose

โš™๏ธ View Instructions

Install docker-compose for your platform.

OS Installer
macOS Included with Docker
Windows Included with Docker
Linux Please see your distributions package management system

๐Ÿ” Composer Authentication

โš™๏ธ View Instructions

TODO

  • Add Dockerfile
  • Add Intruccions
โ„น๏ธ How to set environment variables
  • Replace the COMPOSER_HOME value and the destination file according to your OS.

Run the following commands to add variables to your env file depending on your operating system.

  • macOS with zsh shell:
echo 'export COMPOSER_HOME=~/.composer' >> ~/.zshenv
  • macOS with bash shell:
echo 'export COMPOSER_HOME=~/.composer' >> ~/.bash_profile
  • Linux with bash shell:
echo 'export COMPOSER_HOME=~/.config/composer' >> ~/.bashrc
  • Windows:
setx COMPOSER_HOME "%APPDATA%..\Roaming\Composer"


Installation

๐Ÿงฒ Repository

First we need to clone the repository from GitHub.

cd ~/Sites # or whatever directory you keep your projects in
git clone https://github.com/jok3rcito0/xalok
cd xalok

Note: If you are prompted to insert your GitHub credentials after the git clone command, you must enter your personal access token as password, not your account password.


Manual Install

Once clone command completes, we need to copy the docker-compose.yml.dist file and update it for our system.

cp .env.dist .env
cp docker-compose.override.yml.dist docker-compose.override.yml

Note: Personalize the docker-compose.override.yml for your system. If you are using Mac, it is recommended to change - .:/application to - .:/application:cached for the best performance. However, the default file will work out of the box.

๐ŸŽฏ Docker Images

Pull and build the docker images.

docker-compose pull
docker-compose build

๐Ÿ˜Ž PRO Tip: Shorten the Docker Compose command

We are using PHP, Node, etc. through Docker. In order to use tools like Composer and Yarn through Docker, we must pass our commands to the Docker container. This is a really long command:

docker-compose -f docker-compose.cli.yml run --rm composer install

Because of this, it is recommended to create an alias for docker-compose -f docker-compose.cli.yml run --rm and call it dcli (Docker CLI).

To create these alias, you can use any of the following commands depending on your OS

# For macOS with zsh shell
echo "alias dcli='docker-compose -f docker-compose.cli.yml run --rm'" >> ~/.zshrc
# For MacOS with bash shell
echo "alias dcli='docker-compose -f docker-compose.cli.yml run --rm'" >> ~/.bash_profile
# For Linux with bash shell
echo "alias dcli='docker-compose -f docker-compose.cli.yml run --rm'" >> ~/.bashrc

๐Ÿ”Œ Install Dependencies

โš ๏ธ Important: If you are migrating from pre-existing setup, remove the vendor and node_modules directories before continue.

Now that we have the application configured, we need to install the dependencies. Run the following commands:

dcli composer install
dcli yarn install

๐Ÿฐ Frontend Assets

Now it's time to build the frontend assets. Run the following commands

dcli yarn gulp


Run the container

And finally it's time to start up our containers:

docker-compose up -d

Without nginx-proxy you can only access one of the sites at a time, based the X-Store header sent in the request. By default mx is used.


Tests

To run the frontend and backend tests, run these commands according to what you need:

  • Frontend tests:
dcli yarn test:js

Note 1: Add front test. **

  • Backend tests:
dcli composer test

Note 2: Add backend test.


Docker CLI commands

The Docker CLI -dcli- has services for common commands and for each language.

ยป Available Services

  • node
  • php
  • composer

ยป Syntax

If you want to run a script, use dcli command as:

dcli {node|php|composer} [script] [--flag]

ยป Composer Commands

Command Description
dcli composer install Install backend dependencies
dcli composer lint:check Lint backend sources, including .php, .yaml and .twig files
dcli composer lint:yaml Lint .yaml files in /config and /translations folders
dcli composer lint:twig Lint .twig files in /templates folder
dcli composer lint Fix backend sources with php-cs-fixer
dcli composer phpstan Analyze php files with phpstan
dcli composer phpunit Run phpunit to check tests in /tests folder
dcli composer security Check for security problems in php files
dcli composer test Performs lint:check, phpstan, phpunit and security commands


Documentation

ยป OpenAPI

Note: Generate documentation.


Browser Compatibility

The minimum and recommended versions for web browsers are listed in the following table

Browser Minimum Version Recommended Version
Google Chrome 52+ 82+
Apple Safari 9.1+ 10+
Mozilla Firefox 48+ 80+
Microsoft Edge 87+ 91+
Samsung Internet 7.2+ 13+

More information about compatibility with web browsers at https://caniuse.com/


CSS Standards

The CSS code written in .scss files must meet the XALOK CSS and SCSS standards.


Troubleshooting

โ›”๏ธ Error response from daemon:network

Error response from daemon: network ec77598403f3599c5a9de562dd94fa1ebaeb60281706778f2db7abe5ddd7c7ae not found
Error: failed to start containers: nginx-proxy

This is caused by nginx-proxy searching for a Docker network that doesn't exist anymore. To solve this you need to remove the container and execute the nginx-proxy.sh script again.

docker rm -f nginx-proxy
docker/nginx-proxy.sh

xalok's People

Contributors

jok3rcito0 avatar

Watchers

 avatar

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.