Skip to content

Commit 302ee8f

Browse files
authored
Pretty UI (#12)
* Start to using buttons and theming * Filter bar reworks * Filter bar * Nicer Filter Bar and refactoring * Nice looking news section * Good Resourc e index page * Better looking paginator * Small fixes - warnings * Fix tests * Update laravel.yml * Update laravel.yml * Update laravel.yml * Update laravel.yml * Update laravel.yml * Update laravel.yml * Update laravel.yml * Update laravel.yml * Update laravel.yml * Update laravel.yml * Pagination and home screen
1 parent 36bbadc commit 302ee8f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1650
-1571
lines changed

.env.testing

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -5,68 +5,14 @@ APP_DEBUG=true
55
APP_TIMEZONE=UTC
66
APP_URL=http://localhost
77

8-
APP_LOCALE=en
9-
APP_FALLBACK_LOCALE=en
10-
APP_FAKER_LOCALE=en_US
11-
12-
APP_MAINTENANCE_DRIVER=file
13-
# APP_MAINTENANCE_STORE=database
14-
15-
PHP_CLI_SERVER_WORKERS=4
16-
17-
BCRYPT_ROUNDS=12
18-
19-
LOG_CHANNEL=stack
20-
LOG_STACK=single
21-
LOG_DEPRECATIONS_CHANNEL=null
22-
LOG_LEVEL=debug
23-
248
DB_CONNECTION=mysql
259
DB_HOST=mysql
2610
DB_PORT=3306
2711
DB_DATABASE=computer_science_resources_testing
2812
DB_USERNAME=root
2913
DB_PASSWORD=password
3014

31-
SESSION_DRIVER=database
32-
SESSION_LIFETIME=120
33-
SESSION_ENCRYPT=false
34-
SESSION_PATH=/
35-
SESSION_DOMAIN=null
36-
37-
GITHUB_CLIENT_ID=Ov23liEEEW7WLTpaC688
38-
GITHUB_CLIENT_SECRET=5a60158c32fc6ef2b6ac8d9771012a6ac4440eba
39-
40-
BROADCAST_CONNECTION=log
41-
FILESYSTEM_DISK=local
42-
QUEUE_CONNECTION=database
43-
44-
CACHE_STORE=database
45-
CACHE_PREFIX=
46-
47-
MEMCACHED_HOST=127.0.0.1
48-
49-
REDIS_CLIENT=phpredis
50-
REDIS_HOST=127.0.0.1
51-
REDIS_PASSWORD=null
52-
REDIS_PORT=6379
53-
54-
MAIL_MAILER=smtp
55-
MAIL_HOST=mailpit
56-
MAIL_PORT=1025
57-
MAIL_USERNAME=null
58-
MAIL_PASSWORD=null
59-
MAIL_ENCRYPTION=null
60-
MAIL_FROM_ADDRESS="hello@example.com"
61-
MAIL_FROM_NAME="${APP_NAME}"
62-
63-
AWS_ACCESS_KEY_ID=
64-
AWS_SECRET_ACCESS_KEY=
65-
AWS_DEFAULT_REGION=us-east-1
66-
AWS_BUCKET=
67-
AWS_USE_PATH_STYLE_ENDPOINT=false
68-
69-
VITE_APP_NAME="${APP_NAME}"
15+
# TODO: Regenerate the keys for the google and github oauth
7016

7117
SAIL_XDEBUG_MODE=develop,debug,coverage
7218
SSAIL_XDEBUG_CONFIG="discover_client_host=1 client_port=9003"

.github/workflows/laravel.yml

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11-
laravel-tests:
11+
laravel-feature-tests:
1212
runs-on: ubuntu-latest
1313

14-
# --------------------------------------------------------------
15-
# Spin up a MySQL 8.0 container for testing
16-
# --------------------------------------------------------------
1714
services:
1815
mysql:
1916
image: mysql:8.0
@@ -28,19 +25,14 @@ jobs:
2825
--health-timeout=5s
2926
--health-retries=5
3027
31-
# --------------------------------------------------------------
32-
# Define every environment variable manually
33-
# --------------------------------------------------------------
3428
env:
35-
# Application settings
3629
APP_NAME: "Computer Science Resources"
3730
APP_ENV: testing
3831
APP_KEY: base64:7aYe15aBsSh6a2ScVwj1JfYjQKUmz9Z5X/GSe64joHA=
3932
APP_DEBUG: 'true'
4033
APP_TIMEZONE: UTC
4134
APP_URL: http://localhost
4235

43-
# Database settings (pointing to MySQL on localhost)
4436
DB_CONNECTION: mysql
4537
DB_HOST: 127.0.0.1
4638
DB_PORT: 3306
@@ -52,43 +44,55 @@ jobs:
5244
- name: Checkout code
5345
uses: actions/checkout@v4
5446

55-
# --------------------------------------------------------------
56-
# Set up PHP 8.3 + required extensions + Composer
57-
# --------------------------------------------------------------
5847
- name: Set up PHP & Composer
5948
uses: shivammathur/setup-php@v2
6049
with:
6150
php-version: 8.3
6251
extensions: mbstring, pdo, mysql, bcmath, tokenizer
6352
tools: composer
6453

54+
- name: Cache Composer dependencies
55+
uses: actions/cache@v3
56+
with:
57+
path: vendor
58+
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
59+
restore-keys: |
60+
${{ runner.os }}-composer-
61+
6562
- name: Install Composer dependencies
6663
run: composer install --no-interaction --prefer-dist
6764

68-
# --------------------------------------------------------------
69-
# Generate a new application key (uses APP_KEY from `env:` above)
70-
# --------------------------------------------------------------
7165
- name: Generate app key
7266
run: php artisan key:generate --ansi
7367

74-
# --------------------------------------------------------------
75-
# Wait until MySQL is ready to accept connections
76-
# --------------------------------------------------------------
68+
- name: Setup Node.js
69+
uses: actions/setup-node@v3
70+
with:
71+
node-version: 20
72+
73+
- name: Cache node modules
74+
uses: actions/cache@v3
75+
with:
76+
path: node_modules
77+
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
78+
restore-keys: |
79+
${{ runner.os }}-node-
80+
81+
- name: Install NPM dependencies
82+
run: npm ci
83+
84+
- name: Build assets
85+
run: npm run build
86+
7787
- name: Wait for MySQL to be ready
7888
run: |
7989
echo "Waiting for MySQL to be ready..."
8090
until mysqladmin ping -h 127.0.0.1 -P 3306 --silent; do
8191
sleep 3
8292
done
8393
84-
# --------------------------------------------------------------
85-
# Run migrations (uses the `DB_` variables defined at the top)
86-
# --------------------------------------------------------------
8794
- name: Run database migrations
8895
run: php artisan migrate --force
8996

90-
# --------------------------------------------------------------
91-
# 9) Run all tests (feature + unit)
92-
# --------------------------------------------------------------
9397
- name: Run feature & unit tests
9498
run: php artisan test

app/Models/ResourceReviewSummary.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,4 @@ class ResourceReviewSummary extends Model
1515
protected $fillable = ['computer_science_resource_id'];
1616

1717
protected $primaryKey = 'computer_science_resource_id';
18-
19-
protected $appends = ['average_reviews_score'];
20-
21-
/**
22-
* Get the average reviews score.
23-
*
24-
* @return Attribute
25-
*/
26-
protected function averageReviewsScore(): Attribute
27-
{
28-
return Attribute::make(
29-
get: function () {
30-
if ($this->review_count === 0) {
31-
return 0;
32-
}
33-
34-
return round($this->overall_rating / $this->review_count, 2);
35-
}
36-
);
37-
}
3818
}

database/migrations/2025_03_04_161737_create_comments_table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ public function up(): void
2020
$table->foreignIdFor(Comment::class, "root_comment_id")->nullable();
2121
$table->foreignIdFor(Comment::class, "parent_comment_id")->nullable();
2222
$table->foreignIdFor(User::class);
23-
23+
2424
$table->text("content");
25-
25+
2626
$table->smallInteger("depth")->default(1)->index();
2727
// Only root comment uses this
2828
$table->unsignedInteger("children_count")->default(0);

0 commit comments

Comments
 (0)