Skip to content
This repository has been archived by the owner on Feb 9, 2022. It is now read-only.

Add support for GitHub Codespaces #18

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .devcontainer.env.example
Original file line number Diff line number Diff line change
@@ -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=
6 changes: 6 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"postCreateCommand": "make codespaces",
"forwardPorts": [
8000
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"task.quickOpen.skip": true
}
53 changes: 53 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down