feat: major project restructure - move Django to backend dir and fix critical imports

- Restructure project: moved Django backend to backend/ directory
- Add frontend/ directory for future Next.js application
- Add shared/ directory for common resources
- Fix critical Django import errors:
  - Add missing sys.path modification for apps directory
  - Fix undefined CATEGORY_CHOICES imports in rides module
  - Fix media migration undefined references
  - Remove unused imports and f-strings without placeholders
- Install missing django-environ dependency
- Django server now runs without ModuleNotFoundError
- Update .gitignore and README for new structure
- Add pnpm workspace configuration for monorepo setup
This commit is contained in:
pacnpal
2025-08-23 18:37:55 -04:00
parent 652ea149bd
commit b0e0678590
996 changed files with 370 additions and 192768 deletions

View File

@@ -1,44 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
color: #333;
max-width: 600px;
margin: 0 auto;
padding: 20px;
}
.container {
background-color: #f9f9f9;
border-radius: 5px;
padding: 20px;
margin-top: 20px;
}
.header {
color: #2563eb;
font-size: 24px;
margin-bottom: 20px;
}
.footer {
margin-top: 30px;
font-size: 14px;
color: #666;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
Password Changed Successfully
</div>
<p>Hi {{ user.username }},</p>
<p>This email confirms that your password was recently changed on {{ site_name }}.</p>
<p>If you did not make this change, please contact our support team immediately.</p>
<div class="footer">
<p>Best regards,<br>The {{ site_name }} Team</p>
</div>
</div>
</body>
</html>

View File

@@ -1,19 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Password Changed - ThrillWiki</title>
</head>
<body>
<div style="max-width: 600px; margin: 0 auto; padding: 20px;">
<h1 style="color: #2b3a4a;">Password Changed</h1>
<p>Hi {{ user.username }},</p>
<p>Your password has been successfully changed on ThrillWiki.</p>
<p>If you did not make this change, please contact us immediately.</p>
<p>Best regards,<br>The ThrillWiki Team</p>
</div>
</body>
</html>

View File

@@ -1,47 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Reset Your Password</title>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
color: #333;
max-width: 600px;
margin: 0 auto;
padding: 20px;
}
.button {
display: inline-block;
padding: 10px 20px;
background-color: #007bff;
color: white;
text-decoration: none;
border-radius: 5px;
margin: 20px 0;
}
.footer {
margin-top: 30px;
padding-top: 20px;
border-top: 1px solid #eee;
font-size: 0.9em;
color: #666;
}
</style>
</head>
<body>
<h2>Reset Your Password</h2>
<p>Hello {{ user.get_display_name }},</p>
<p>We received a request to reset your password. Click the button below to set a new password:</p>
<p>
<a href="{{ reset_url }}" class="button">Reset Password</a>
</p>
<p>This link will expire in 24 hours for security reasons.</p>
<p>If you didn't request this password reset, you can safely ignore this email. Your password will remain unchanged.</p>
<div class="footer">
<p>Best regards,<br>ThrillWiki Team</p>
<p>If you're having trouble clicking the button, copy and paste this URL into your browser:<br>
{{ reset_url }}</p>
</div>
</body>
</html>

View File

@@ -1,41 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Password Reset Complete</title>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
color: #333;
max-width: 600px;
margin: 0 auto;
padding: 20px;
}
.success {
color: #28a745;
font-weight: bold;
}
.warning {
color: #dc3545;
font-weight: bold;
}
.footer {
margin-top: 30px;
padding-top: 20px;
border-top: 1px solid #eee;
font-size: 0.9em;
color: #666;
}
</style>
</head>
<body>
<h2>Password Reset Complete</h2>
<p>Hello {{ user.get_display_name }},</p>
<p class="success">Your password has been successfully reset.</p>
<p>You can now log in to your account with your new password.</p>
<p class="warning">If you did not make this change, please contact us immediately as your account may have been compromised.</p>
<div class="footer">
<p>Best regards,<br>ThrillWiki Team</p>
</div>
</body>
</html>

View File

@@ -1,51 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Verify Your New Email Address</title>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
color: #333;
max-width: 600px;
margin: 0 auto;
padding: 20px;
}
.button {
display: inline-block;
padding: 10px 20px;
background-color: #007bff;
color: white;
text-decoration: none;
border-radius: 5px;
margin: 20px 0;
}
.footer {
margin-top: 30px;
padding-top: 20px;
border-top: 1px solid #eee;
font-size: 0.9em;
color: #666;
}
</style>
</head>
<body>
<h2>Hello {{ user.username }},</h2>
<p>We received a request to change your email address on ThrillWiki. To complete this change, please click the button below:</p>
<a href="{{ verification_url }}" class="button">Verify Email Address</a>
<p>If the button doesn't work, you can copy and paste this link into your browser:</p>
<p>{{ verification_url }}</p>
<p>This link will expire in 24 hours for security reasons.</p>
<p>If you did not request this change, please ignore this email or contact support if you have concerns.</p>
<div class="footer">
<p>Best regards,<br>The ThrillWiki Team</p>
<p>This is an automated message, please do not reply to this email.</p>
</div>
</body>
</html>

View File

@@ -1,33 +0,0 @@
{% extends "base/base.html" %}
{% block title %}Email Required{% endblock %}
{% block content %}
<div class="container mx-auto px-4 py-16">
<div class="max-w-md mx-auto bg-white rounded-lg shadow-md p-8">
<h1 class="text-2xl font-bold mb-6">Email Required</h1>
{% if error %}
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4" role="alert">
<p>{{ error }}</p>
</div>
{% endif %}
<p class="mb-6">Please provide your email address to complete the registration process.</p>
<form method="post" class="space-y-4">
{% csrf_token %}
<div>
<label for="email" class="block text-sm font-medium text-gray-700">Email Address</label>
<input type="email" name="email" id="email" required
class="mt-1 block w-full rounded-md border-gray-300 shadow-xs focus:border-blue-500 focus:ring-blue-500">
</div>
<button type="submit"
class="w-full bg-blue-600 text-white py-2 px-4 rounded hover:bg-blue-700 focus:outline-hidden focus:ring-2 focus:ring-blue-500 focus:ring-offset-2">
Submit
</button>
</form>
</div>
</div>
{% endblock %}

View File

@@ -1,170 +0,0 @@
{% extends 'base/base.html' %}
{% load static %}
{% block title %}{{ profile_user.username }}'s Profile - ThrillWiki{% endblock %}
{% block content %}
<div class="container px-4 mx-auto">
<!-- Profile Header -->
<div class="overflow-hidden bg-white rounded-lg shadow dark:bg-gray-800">
<div class="p-6">
<div class="flex items-center">
{% if profile_user.profile.avatar %}
<img src="{{ profile_user.profile.avatar.url }}"
alt="{{ profile_user.username }}"
class="object-cover w-24 h-24 rounded-full">
{% else %}
<div class="flex items-center justify-center w-24 h-24 text-white rounded-full bg-gradient-to-br from-primary to-secondary">
{{ profile_user.username.0|upper }}
</div>
{% endif %}
<div class="ml-6">
<h1 class="text-2xl font-bold">
{{ profile_user.profile.display_name|default:profile_user.username }}
</h1>
{% if profile_user.profile.pronouns %}
<p class="text-gray-600 dark:text-gray-400">{{ profile_user.profile.pronouns }}</p>
{% endif %}
<div class="mt-2">
{% if profile_user.role != 'USER' %}
<span class="role-badge role-{{ profile_user.role|lower }}">
{{ profile_user.get_role_display }}
</span>
{% endif %}
</div>
</div>
</div>
{% if profile_user.profile.bio %}
<div class="mt-6">
<h2 class="mb-2 text-lg font-semibold">About Me</h2>
<p class="text-gray-600 dark:text-gray-400">{{ profile_user.profile.bio }}</p>
</div>
{% endif %}
<!-- Social Links -->
{% if profile_user.profile.twitter or profile_user.profile.instagram or profile_user.profile.youtube or profile_user.profile.discord %}
<div class="flex mt-4 space-x-4">
{% if profile_user.profile.twitter %}
<a href="{{ profile_user.profile.twitter }}" target="_blank" rel="noopener noreferrer"
class="text-gray-600 dark:text-gray-400 hover:text-blue-500">
<i class="material-icons">link</i> Twitter
</a>
{% endif %}
{% if profile_user.profile.instagram %}
<a href="{{ profile_user.profile.instagram }}" target="_blank" rel="noopener noreferrer"
class="text-gray-600 dark:text-gray-400 hover:text-blue-500">
<i class="material-icons">link</i> Instagram
</a>
{% endif %}
{% if profile_user.profile.youtube %}
<a href="{{ profile_user.profile.youtube }}" target="_blank" rel="noopener noreferrer"
class="text-gray-600 dark:text-gray-400 hover:text-blue-500">
<i class="material-icons">link</i> YouTube
</a>
{% endif %}
{% if profile_user.profile.discord %}
<span class="text-gray-600 dark:text-gray-400">
<i class="material-icons">discord</i> {{ profile_user.profile.discord }}
</span>
{% endif %}
</div>
{% endif %}
</div>
</div>
<!-- Statistics -->
<div class="grid grid-cols-1 gap-4 mt-6 md:grid-cols-4">
<div class="card">
<div class="text-center card-body">
<div class="stat-value">{{ profile_user.profile.coaster_credits }}</div>
<div class="stat-label">Coaster Credits</div>
</div>
</div>
<div class="card">
<div class="text-center card-body">
<div class="stat-value">{{ profile_user.profile.dark_ride_credits }}</div>
<div class="stat-label">Dark Ride Credits</div>
</div>
</div>
<div class="card">
<div class="text-center card-body">
<div class="stat-value">{{ profile_user.profile.flat_ride_credits }}</div>
<div class="stat-label">Flat Ride Credits</div>
</div>
</div>
<div class="card">
<div class="text-center card-body">
<div class="stat-value">{{ profile_user.profile.water_ride_credits }}</div>
<div class="stat-label">Water Ride Credits</div>
</div>
</div>
</div>
<!-- Recent Activity -->
<div class="grid grid-cols-1 gap-6 mt-6 md:grid-cols-2">
<!-- Recent Reviews -->
<div class="card">
<div class="card-header">
<h2 class="text-xl font-semibold">Recent Reviews</h2>
</div>
<div class="card-body">
{% for review in park_reviews %}
<div class="mb-4 last:mb-0">
<div class="flex items-start justify-between">
<div>
<h3 class="font-medium">{{ review.title }}</h3>
<p class="text-sm text-gray-600 dark:text-gray-400">
{{ review.park.name }}
</p>
</div>
<div class="flex items-center">
<span class="mr-1 text-yellow-400"></span>
<span>{{ review.rating }}/10</span>
</div>
</div>
</div>
{% endfor %}
{% for review in ride_reviews %}
<div class="mb-4 last:mb-0">
<div class="flex items-start justify-between">
<div>
<h3 class="font-medium">{{ review.title }}</h3>
<p class="text-sm text-gray-600 dark:text-gray-400">
{{ review.ride.name }}
</p>
</div>
<div class="flex items-center">
<span class="mr-1 text-yellow-400"></span>
<span>{{ review.rating }}/10</span>
</div>
</div>
</div>
{% endfor %}
{% if not park_reviews and not ride_reviews %}
<p class="text-gray-500 dark:text-gray-400">No reviews yet.</p>
{% endif %}
</div>
</div>
<!-- Top Lists -->
<div class="card">
<div class="card-header">
<h2 class="text-xl font-semibold">Top Lists</h2>
</div>
<div class="card-body">
{% for list in top_lists %}
<div class="mb-4 last:mb-0">
<h3 class="font-medium">{{ list.title }}</h3>
<p class="text-sm text-gray-600 dark:text-gray-400">
{{ list.get_category_display }}
</p>
</div>
{% empty %}
<p class="text-gray-500 dark:text-gray-400">No top lists created yet.</p>
{% endfor %}
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -1,109 +0,0 @@
{% extends 'base/base.html' %}
{% load static %}
{% block title %}Settings - ThrillWiki{% endblock %}
{% block content %}
<div class="container px-4 mx-auto max-w-[800px]">
<h1 class="mb-4 text-2xl font-bold">Settings</h1>
<div class="p-6 overflow-hidden bg-white rounded-lg shadow dark:bg-gray-800">
<form method="POST" enctype="multipart/form-data">
{% csrf_token %}
<input type="hidden" name="action" value="update_profile">
<h2 class="mb-4 text-lg font-semibold">Update Profile</h2>
<div class="mb-4">
<label for="display_name" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Display Name</label>
<input type="text" name="display_name" id="display_name" value="{{ user.profile.display_name }}" class="block w-full mt-1 border-gray-300 rounded-md shadow-xs dark:border-gray-600 dark:bg-gray-700 dark:text-gray-300">
</div>
<div class="mb-4">
<label for="avatar" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Avatar</label>
<input type="file" name="avatar" id="avatar" class="block w-full mt-1 text-gray-900 dark:text-gray-300">
</div>
<button type="submit" class="px-4 py-2 text-white bg-blue-500 rounded-md">Update Profile</button>
</form>
</div>
<div class="p-6 mt-6 overflow-hidden bg-white rounded-lg shadow dark:bg-gray-800">
<form method="POST">
{% csrf_token %}
<input type="hidden" name="action" value="change_email">
<h2 class="mb-4 text-lg font-semibold">Change Email</h2>
<div class="mb-4">
<label for="new_email" class="block text-sm font-medium text-gray-700 dark:text-gray-300">New Email</label>
<input type="email" name="new_email" id="new_email" class="block w-full mt-1 border-gray-300 rounded-md shadow-xs dark:border-gray-600 dark:bg-gray-700 dark:text-gray-300">
</div>
<button type="submit" class="px-4 py-2 text-white bg-blue-500 rounded-md">Change Email</button>
</form>
</div>
<div class="p-6 mt-6 overflow-hidden bg-white rounded-lg shadow dark:bg-gray-800">
<form method="POST" x-data="{
newPassword: '',
confirmPassword: '',
passwordsMatch() { return this.newPassword === this.confirmPassword },
isValidPassword() {
return this.newPassword.length >= 8 &&
/[A-Z]/.test(this.newPassword) &&
/[a-z]/.test(this.newPassword) &&
/[0-9]/.test(this.newPassword);
}
}">
{% csrf_token %}
<input type="hidden" name="action" value="change_password">
<h2 class="mb-4 text-lg font-semibold">Change Password</h2>
<div class="mb-4">
<label for="old_password" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Current Password</label>
<input type="password" name="old_password" id="old_password" required class="block w-full mt-1 border-gray-300 rounded-md shadow-xs dark:border-gray-600 dark:bg-gray-700 dark:text-gray-300">
</div>
<div class="mb-4">
<label for="new_password" class="block text-sm font-medium text-gray-700 dark:text-gray-300">New Password</label>
<input
type="password"
name="new_password"
id="new_password"
x-model="newPassword"
required
class="block w-full mt-1 border-gray-300 rounded-md shadow-xs dark:border-gray-600 dark:bg-gray-700 dark:text-gray-300"
>
<div class="mt-1 text-sm text-gray-500 dark:text-gray-400" x-show="newPassword && !isValidPassword()">
Password must be at least 8 characters and contain uppercase, lowercase, and numbers
</div>
</div>
<div class="mb-4">
<label for="confirm_password" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Confirm New Password</label>
<input
type="password"
name="confirm_password"
id="confirm_password"
x-model="confirmPassword"
required
class="block w-full mt-1 border-gray-300 rounded-md shadow-xs dark:border-gray-600 dark:bg-gray-700 dark:text-gray-300"
>
<div class="mt-1 text-sm text-red-500" x-show="confirmPassword && !passwordsMatch()">
Passwords do not match
</div>
</div>
<button
type="submit"
class="px-4 py-2 text-white bg-blue-500 rounded-md disabled:opacity-50"
x-bind:disabled="!passwordsMatch() || !isValidPassword()"
>
Change Password
</button>
</form>
</div>
</div>
{% endblock %}

View File

@@ -1,22 +0,0 @@
<script
src="https://challenges.cloudflare.com/turnstile/v0/api.js"
async
defer
></script>
<div class="turnstile">
<div
id="turnstile-widget"
class="cf-turnstile"
data-sitekey="{{ site_key }}"
></div>
</div>
<script>
// Apply theme to the Turnstile widget based on the retrieved theme
document.addEventListener("DOMContentLoaded", function () {
const turnstileWidget = document.getElementById("turnstile-widget");
if (turnstileWidget) {
turnstileWidget.setAttribute("data-theme", theme);
}
});
</script>

View File

@@ -1 +0,0 @@
<!-- Empty template when DEBUG is True -->