Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 customize things #11

Merged
merged 53 commits into from
May 27, 2024
Merged
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
f5a092f
move frontend to frontend folder, make proposal form depending on que…
scammo Nov 29, 2023
8d1e830
first work in progress and test deployment
scammo Jan 4, 2024
19c3672
corect path Dockerfile
scammo Jan 4, 2024
f7ed882
more correct context for docker#
scammo Jan 4, 2024
dbffe67
purge supabase
scammo Jan 4, 2024
6f9cba8
logout, change profile information, change password, unique usernames
scammo Jan 4, 2024
5a3c3fb
root can create users and read all users
scammo Jan 4, 2024
dd5611d
show correct labels for orga/proposal view
scammo Jan 4, 2024
1cfec06
users can save and read opinions to proposal
scammo Jan 4, 2024
0dfcbc8
add feature show all users to track
scammo Jan 4, 2024
9cd5090
filter for status inside track of proposals
scammo Jan 4, 2024
e101275
export data functionality
scammo Jan 4, 2024
6275a79
improved docs, improve dev seeder, create initial root user by visiti…
scammo Jan 4, 2024
3d0a3b8
prod default values login
scammo Jan 4, 2024
be6d4eb
Update Dockerfile and docker-compose.yml
flemming-pr Jan 4, 2024
adbb874
Update environment variables and Docker configuration
flemming-pr Jan 4, 2024
ec06c7d
Refactor entrypoint.sh script and add wait for DB to be ready
flemming-pr Jan 4, 2024
72fbbaf
Update Dockerfile and add Caddyfile for backend
flemming-pr Jan 4, 2024
0376cd5
Update PHP version in Dockerfile
flemming-pr Jan 4, 2024
0ef28fe
Update Caddyfile to disable auto HTTPS
flemming-pr Jan 4, 2024
d608b9f
Update Dockerfile and Caddyfile configurations
flemming-pr Jan 6, 2024
042ff54
Update API URL and add CORS middleware
flemming-pr Jan 6, 2024
4e4307b
Update Traefik router middleware for API-PGP
flemming-pr Jan 6, 2024
951227e
Update traefik configuration for API-PGP service
flemming-pr Jan 6, 2024
3a711e3
.env.example update with jwt secret
scammo Jan 8, 2024
7be802a
add to composer.json jwt:secret
scammo Jan 8, 2024
bf6f829
fixed typos
scammo Jan 8, 2024
467d8d1
Merge branch 'v2-customize-things' of github.com:chaostreff-flensburg…
scammo Jan 8, 2024
2380eed
working createInitialRootUser
scammo Jan 8, 2024
c309f36
fix
scammo Jan 8, 2024
7e7de7b
fix migration public_key
scammo Jan 8, 2024
fd9335d
varchar to text migration
scammo Jan 8, 2024
7898b72
change proposal status
scammo Jan 9, 2024
13f8dd7
change proposal status backend
scammo Jan 9, 2024
091d858
working links
scammo Jan 9, 2024
2300f50
#4 diplay correctly if the user has voted for proposal
scammo Mar 27, 2024
1560eb3
#3 fix typo
scammo Mar 27, 2024
0a75639
#2 Preserve line breaks in proposals' texts
scammo Mar 27, 2024
e5bc5f2
improved seederfor local development, improved docs and .env for loca…
scammo Mar 27, 2024
e495370
set timeout to 15000
scammo Mar 29, 2024
042bb1b
new button for export content field with unencrypted data
scammo Apr 3, 2024
fc0422d
deal with rate limit in frontend
scammo Apr 3, 2024
0ab9366
[bug] Format Minutes correclty
scammo Apr 3, 2024
66dc0d8
#5 fix correctly sorting cumulitive votes
scammo Apr 3, 2024
0975a25
#7 the framework has no avaibility to make it link, but name is now a…
scammo Apr 3, 2024
355fcde
improve login layout and cleanup login
scammo Apr 20, 2024
6241cbc
enhence login toast for error messages
scammo Apr 21, 2024
a04d097
fix error messages and display Overview
scammo Apr 21, 2024
681dbb5
fix breadcrumb logic, labels and routes
scammo Apr 21, 2024
5a3e557
after login redirect to path the user tried to visit
scammo Apr 21, 2024
314e2f3
#8 add notification for a new created proposal, the applicant and use…
scammo Apr 21, 2024
bb9369c
cccs-20241 proposal data, first steps for more configurables email texts
scammo May 24, 2024
0815869
change json structure
scammo May 24, 2024
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
Prev Previous commit
Next Next commit
#8 add notification for a new created proposal, the applicant and use…
…rs get a notification. smtp needs to be configured in env
scammo committed Apr 21, 2024
commit 314e2f31a5f2ccd2e7ae39063e79af8ba5c4a323
29 changes: 3 additions & 26 deletions backend/.env.example.local.dev
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
FRONTEND_URL="http://localhost:5173/#"

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
@@ -20,10 +21,6 @@ SESSION_LIFETIME=120

MEMCACHED_HOST=127.0.0.1

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=mailpit
MAIL_PORT=1025
@@ -32,27 +29,7 @@ MAIL_PASSWORD=null
MAIL_ENCRYPTION=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

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1

VITE_APP_NAME="${APP_NAME}"
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
MAIL_REPLY_TO="hello@example.com"

JWT_SECRET=DgShc8SKxGUlu5px5PjnMjkTCQVZUsS8ZkW3gEMfwImdbCsQIH6apWtEyYCZlLGp
JWT_ALGO=HS256
JWT_ALGO=HS256
21 changes: 20 additions & 1 deletion backend/app/Http/Controllers/ProposalController.php
Original file line number Diff line number Diff line change
@@ -2,17 +2,23 @@

namespace App\Http\Controllers;

use App\Mail\ConfirmProposalCreated;
use App\Mail\InfoProposalCreated;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\Request;
use App\Models\Track;
use App\Models\Proposal;
use App\Models\Opinion;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Mail;

class ProposalController extends Controller
{
public function create(Request $request)
{
$track = Track::where('slug', $request->slug)->firstOrFail();
$track = Track::where('slug', $request->slug)
->with('users')
->firstOrFail();
$proposal = new Proposal();
$proposal->track_id = $track->id;
$proposal->name = $request->name;
@@ -21,6 +27,19 @@ public function create(Request $request)
$proposal->status = 'created';
$proposal->save();

try{
if($request->email){
// send recipent emails
Mail::to($request->email)->send(new ConfirmProposalCreated($proposal->id));
// send email to the track users
foreach($track->users as $user){
Mail::to($user->email)->send(new InfoProposalCreated($proposal->id, $proposal->name, env('FRONTEND_URL').'/proposal/'.$proposal->id));
}
}
}catch(\Exception $e){
Log::error($e);
}

return $proposal->only('id');
}

1 change: 1 addition & 0 deletions backend/app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
@@ -74,6 +74,7 @@ public function updatePassword(User $user, Request $request){
}

public function createInitialRootUser(){
return;
if(User::where('username', 'root')->first()){
abort(403);
}
59 changes: 59 additions & 0 deletions backend/app/Mail/ConfirmProposalCreated.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Mail\Mailables\Address;
use Illuminate\Queue\SerializesModels;

class ConfirmProposalCreated extends Mailable
{
use Queueable, SerializesModels;

public int $proposalId;

/**
* Create a new message instance.
*/
public function __construct($proposalId)
{
$this->proposalId = $proposalId;
}

/**
* Get the message envelope.
*/
public function envelope(): Envelope
{
return new Envelope(
subject: 'Bewerbung erhalten | Application received',
replyTo: [
new Address(env('MAIL_REPLY_TO', env('MAIL_FROM_NAME'))),
],
);
}

/**
* Get the message content definition.
*/
public function content(): Content
{
return new Content(
view: 'emails.confirmProposal',
);
}

/**
* Get the attachments for the message.
*
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
*/
public function attachments(): array
{
return [];
}
}
59 changes: 59 additions & 0 deletions backend/app/Mail/InfoProposalCreated.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;

class InfoProposalCreated extends Mailable
{
use Queueable, SerializesModels;

public int $proposalId;
public string $proposalName;
public string $pathToProposal;

/**
* Create a new message instance.
*/
public function __construct($proposalId, $proposalName, $pathToProposal)
{
$this->proposalId = $proposalId;
$this->proposalName = $proposalName;
$this->pathToProposal = $pathToProposal;
}

/**
* Get the message envelope.
*/
public function envelope(): Envelope
{
return new Envelope(
subject: 'Es gibt eine neue Bewerbung '. $this->proposalId .' | There is a new application '. $this->proposalId,
);
}

/**
* Get the message content definition.
*/
public function content(): Content
{
return new Content(
view: 'emails.infoProposalCreated',
);
}

/**
* Get the attachments for the message.
*
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
*/
public function attachments(): array
{
return [];
}
}
Loading