Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
221f46e
laravel first setup for test CI workflow
hanchan-dev Jun 7, 2026
de17b31
Merge pull request #6 from hanchan-dev/BE
hanchan-dev Jun 7, 2026
dcf9d9c
Mengisi file ADR di docs
spectraVal Jun 7, 2026
b1dfa45
fix: correct typo in CI workflow configuration. chore: change mysql i…
hanchan-dev Jun 7, 2026
b11c927
temporarily disable docker flow on ci workflow
hanchan-dev Jun 11, 2026
42768fb
Merge pull request #13 from hanchan/BE
hanchan-dev Jun 11, 2026
c75f13f
Merge pull request #14 from spectraVal/FE
spectraVal Jun 12, 2026
f965758
add api specs to docs folder
hanchan-dev Jun 13, 2026
954ebff
feat(auth): implement authentication flow (register, login, logout, m…
hanchan-dev Jun 15, 2026
6e70ea8
feat(auth-testing): implement feature test fot flow (register, login…
hanchan-dev Jun 16, 2026
8cfe84c
QNH-309 and QNH-311. Create Register Page and Login Page
spectraVal Jun 22, 2026
963ecf3
Merge pull request #15 from spectraVal/FE
spectraVal Jun 22, 2026
6923fa4
Add ADR-006 File
spectraVal Jun 22, 2026
99d0b79
Merge branch 'development' of https://github.com/spectraVal/QueueNova…
spectraVal Jun 22, 2026
2c49557
improve the login and registration pages
spectraVal Jun 22, 2026
69ca7d0
improve the login and registration pages
spectraVal Jun 22, 2026
c75d507
Merge pull request #16 from spectraVal/FE
spectraVal Jun 22, 2026
a7d1af9
Migrasi autentikasi dari Bearer Token ke Sanctum Cookie-based
spectraVal Jun 23, 2026
c8b5d0b
Migrasi autentikasi dari Bearer Token ke Sanctum Cookie-based
spectraVal Jun 23, 2026
ce54820
Merge pull request #17 from spectraVal/FE
spectraVal Jun 23, 2026
d519016
Migrasi autentikasi dari Bearer Token ke Sanctum Cookie-based
spectraVal Jun 23, 2026
aacc124
QNH-313 FE - Logout Action
spectraVal Jun 23, 2026
6b8afac
Merge pull request #18 from spectraVal/FE
spectraVal Jun 23, 2026
010086e
Merge pull request #19 from hanchan-dev/BE
hanchan-dev Jun 23, 2026
487de38
Add Logout Button on Dashboard Page
spectraVal Jun 23, 2026
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
50 changes: 27 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:
branches:
- main
- develop
- development

jobs:
frontend:
Expand Down Expand Up @@ -48,15 +48,16 @@ jobs:
working-directory: backend

services:
mysql:
image: mysql:8.0
postgres:
image: postgres:16
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: testing
POSTGRES_DB: testing
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 3306:3306
- 5432:5432
options: >-
--health-cmd="mysqladmin ping"
--health-cmd="pg_isready -U postgres"
--health-interval=10s
--health-timeout=5s
--health-retries=3
Expand All @@ -69,42 +70,45 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
extensions: mbstring, bcmath, pdo, pdo_mysql
extensions: mbstring, bcmath, pdo, pdo_pgsql
coverage: xdebug

- name: Copy .env
run: cp .env.example .env.testing
run: cp .env.example .env

- name: Install dependencies
run: composer install --no-interaction --prefer-dist --optimize-autoloader

- name: Generate app key
run: php artisan key:generate --env=testing
run: php artisan key:generate

- name: Run migrations
run: php artisan migrate --env=testing --force
run: php artisan migrate --force
env:
DB_CONNECTION: mysql
XDEBUG_MODE: off
DB_CONNECTION: pgsql
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_PORT: 5432
DB_DATABASE: testing
DB_USERNAME: root
DB_PASSWORD: root
DB_USERNAME: postgres
DB_PASSWORD: postgres

- name: Run tests
run: php artisan test --env=testing
run: php artisan test
env:
DB_CONNECTION: mysql
XDEBUG_MODE: off
DB_CONNECTION: pgsql
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_PORT: 5432
DB_DATABASE: testing
DB_USERNAME: root
DB_PASSWORD: root
DB_USERNAME: postgres
DB_PASSWORD: postgres

docker-build:
name: Docker Build Check
runs-on: ubuntu-latest
needs: [frontend, backend]
needs: [frontend]
# needs: [frontend, backend]

steps:
- name: Checkout repository
Expand All @@ -113,5 +117,5 @@ jobs:
- name: Build frontend image
run: docker build -t queuenova-frontend ./frontend

- name: Build backend image
run: docker build -t queuenova-backend ./backend
# - name: Build backend image
# run: docker build -t queuenova-backend ./backend
18 changes: 18 additions & 0 deletions backend/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2

[compose.yaml]
indent_size = 4
65 changes: 65 additions & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost

APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US

APP_MAINTENANCE_DRIVER=file
# APP_MAINTENANCE_STORE=database

# PHP_CLI_SERVER_WORKERS=4

BCRYPT_ROUNDS=12

LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=laravel
DB_USERNAME=postgres
DB_PASSWORD=

SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null

BROADCAST_CONNECTION=log
FILESYSTEM_DISK=local
QUEUE_CONNECTION=database

CACHE_STORE=database
# CACHE_PREFIX=

MEMCACHED_HOST=127.0.0.1

REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=log
MAIL_SCHEME=null
MAIL_HOST=127.0.0.1
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

VITE_APP_NAME="${APP_NAME}"
11 changes: 11 additions & 0 deletions backend/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
* text=auto eol=lf

*.blade.php diff=html
*.css diff=css
*.html diff=html
*.md diff=markdown
*.php diff=php

/.github export-ignore
CHANGELOG.md export-ignore
.styleci.yml export-ignore
25 changes: 25 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
*.log
.DS_Store
.env
.env.testing
.env.backup
.env.production
.phpactor.json
.phpunit.result.cache
/.fleet
/.idea
/.nova
/.phpunit.cache
/.vscode
/.zed
/auth.json
/node_modules
/public/build
/public/hot
/public/storage
/storage/*.key
/storage/pail
/vendor
Homestead.json
Homestead.yaml
Thumbs.db
59 changes: 59 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>

<p align="center">
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
</p>

## About Laravel

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:

- [Simple, fast routing engine](https://laravel.com/docs/routing).
- [Powerful dependency injection container](https://laravel.com/docs/container).
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
- [Robust background job processing](https://laravel.com/docs/queues).
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).

Laravel is accessible, powerful, and provides tools required for large, robust applications.

## Learning Laravel

Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework. You can also check out [Laravel Learn](https://laravel.com/learn), where you will be guided through building a modern Laravel application.

If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.

## Laravel Sponsors

We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com).

### Premium Partners

- **[Vehikl](https://vehikl.com)**
- **[Tighten Co.](https://tighten.co)**
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
- **[64 Robots](https://64robots.com)**
- **[Curotec](https://www.curotec.com/services/technologies/laravel)**
- **[DevSquad](https://devsquad.com/hire-laravel-developers)**
- **[Redberry](https://redberry.international/laravel-development)**
- **[Active Logic](https://activelogic.com)**

## Contributing

Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).

## Code of Conduct

In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).

## Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.

## License

The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
25 changes: 25 additions & 0 deletions backend/app/Http/Controllers/Auth/AuthController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Http\Resources\UserResource;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class AuthController extends Controller
{
public function me(Request $request): JsonResponse
{
$user = $request->user();

$relation = match ($user->role) {
'patient' => 'patient',
default => 'patient', // expand di EPIC 2
};

return response()->json([
'data' => new UserResource($user->load($relation)),
]);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Http\Requests\Auth\LoginRequest;
use App\Http\Resources\UserResource;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Auth;

class AuthenticatedSessionController extends Controller
{
/**
* Handle an incoming authentication request.
*/
public function store(LoginRequest $request): JsonResponse
{
$request->authenticate();

$request->session()->regenerate();

$user = Auth::user();

$relation = match ($user->role) {
'patient' => 'patient',
default => 'patient', // expand di EPIC 2
};

return response()->json([
'message' => 'Login berhasil.',
'data' => [
'user' => new UserResource($user->load($relation)),
],
]);
}

/**
* Destroy an authenticated session.
*/
public function destroy(Request $request): JsonResponse
{
Auth::guard('web')->logout();

$request->session()->invalidate();

$request->session()->regenerateToken();

return response()->json([
'message' => 'Logout Successful.',
]);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;

class EmailVerificationNotificationController extends Controller
{
/**
* Send a new email verification notification.
*/
public function store(Request $request): JsonResponse|RedirectResponse
{
if ($request->user()->hasVerifiedEmail()) {
return redirect()->intended('/dashboard');
}

$request->user()->sendEmailVerificationNotification();

return response()->json(['status' => 'verification-link-sent']);
}
}
Loading
Loading