Simple user's CRUD using Lumen Framework to build the API and React Create App with Typescript in the frontend.
You will need have Docker and Docker Compose installed in your system to be able to follow the steps below:
-
Clone the git repository
$ git clone git@gitlab.com:lcdss/myspace.git
-
Access the project root directory
$ cd myspace
-
Push, build and run the docker containers
$ docker-compose up -d
-
Access the api container
$ docker-compose exec api sh
-
Install the API dependencies
$ composer install
-
Copy the example environment file
$ cp .env.example .env
-
Create a symbolic link from public app storage to public directory
$ ln -s $PWD/storage/app/public $PWD/public/storage
-
Run the api server - It'll be available at http://api.myspace.local
$ php -S 0.0.0.0 -t public
-
In another terminal, access the client container
$ docker-compose exec client sh
-
Install the client dependencies
$ yarn
-
Copy the client example environment file
$ cp .env.example .env.local
-
Run the client server - It'll be available at http://myspace.local
$ yarn start
-
Add the api and client hostnames to your system's host file (needs root access)
$ echo "127.0.0.1 myspace.local" >> /etc/hosts $ echo "127.0.0.1 api.myspace.local" >> /etc/hosts $ echo "127.0.0.1 cdn.myspace.local" >> /etc/hosts