diff --git a/.devcontainer.env.example b/.devcontainer.env.example new file mode 100644 index 0000000..a89cc66 --- /dev/null +++ b/.devcontainer.env.example @@ -0,0 +1,35 @@ +APP_NAME="devICT Job Board" +APP_ENV=local +APP_KEY= +APP_DEBUG=true +APP_URL=http://jobs.devict.test + +LOG_CHANNEL=stack + +DB_CONNECTION=sqlite +DB_HOST=db +DB_PORT=5432 +DB_DATABASE=/home/codespace/workspace/jobs.devict/database/database.sqlite +DB_USERNAME=jobs +DB_PASSWORD= + +JOBS_EMAIL= +JOBS_SLACK_HOOK= + +BROADCAST_DRIVER=log +CACHE_DRIVER=file +QUEUE_CONNECTION=sync +SESSION_DRIVER=file +SESSION_LIFETIME=120 + +MAIL_DRIVER=smtp +MAIL_HOST=smtp.mailtrap.io +MAIL_PORT=2525 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_ENCRYPTION=null +MAIL_FROM_ADDRESS=null +MAIL_FROM_NAME="${APP_NAME}" + +MAILGUN_DOMAIN= +MAILGUN_SECRET= diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..851d0cb --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,6 @@ +{ + "postCreateCommand": "make codespaces", + "forwardPorts": [ + 8000 + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..fd1f682 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "task.quickOpen.skip": true +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..8b431bd --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,53 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Build", + "dependsOn": [ + "Server Build", + "Client Build" + ], + "group": "build", + "isBackground": true, + "problemMatcher": [] + }, + { + "label": "Client Build", + "command": "npm run watch", + "type": "shell", + "args": [], + "problemMatcher": { + "base": "$tsc-watch", + "background": { + "activeOnStart": true, + "beginsPattern": "webpack is watching the files", + "endsPattern": "Compiled successfully" + } + }, + "presentation": { + "group": "build", + "reveal": "always" + }, + "isBackground": true + }, + { + "label": "Server Build", + "command": "php artisan serve", + "type": "shell", + "args": [], + "problemMatcher": { + "base": "$tsc-watch", + "background": { + "activeOnStart": true, + "beginsPattern": "Laravel development server started", + "endsPattern": "Laravel development server started" + } + }, + "presentation": { + "group": "build", + "reveal": "always" + }, + "isBackground": true + } + ] +} \ No newline at end of file diff --git a/Makefile b/Makefile index 08bde85..a4b4edd 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,18 @@ setup: deps build app-key +codespaces: + # Backend + composer install + touch database/database.sqlite + cp .devcontainer.env.example .env + php artisan key:generate + php artisan migrate + + # Frontend + npm install + code README.md + dev: docker-compose up client caddy php-fpm db @@ -22,4 +34,4 @@ db-migrate: docker-compose run --rm php php artisan migrate app-key: - docker-compose run --rm php php artisan key:generate + docker-compose run --rm php php artisan key:generate \ No newline at end of file diff --git a/README.md b/README.md index 875d8c3..70a280d 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,20 @@ php artisan serve You're ready to go! Visit [http://127.0.0.1:8000](http://127.0.0.1:8000) in your browser. + + +### GitHub Codespaces Setup + +> You will need access to Codespaces for these steps to work: https://github.com/features/codespaces + +Create a Codespace for this repo by following this guide: https://docs.github.com/en/free-pro-team@latest/github/developing-online-with-codespaces/creating-a-codespace. All dependencies will be automatically installed after creation. + +Connecting to the Codespace using Visual Studio Code is recommended. See this guide for more details: https://docs.github.com/en/free-pro-team@latest/github/developing-online-with-codespaces/using-codespaces-in-visual-studio-code + +Once installation is complete, start the client and server in the workspace by typing `task build` in **Command Palette** or **Go To File** (open the palette from the menu, or with `Ctrl + P`, `Cmd + P`, or `F1`). A split terminal will spawn with the build tasks running, automatically forwarding required ports. + +Visit [http://127.0.0.1:8000](http://127.0.0.1:8000) in your browser! + ## Notifications The Job Board will send an email and Slack notification when new jobs are added to the board. The recipient of these notifications is configured in the `.env` file. Set the `JOBS_EMAIL` value to a valid email address and the `JOBS_SLACK_HOOK` to a valid [Slack webhook](https://api.slack.com/messaging/webhooks). Both of these settings are optional and the Job Board should still function without them set.