Skip to content

Commit 8a67d5e

Browse files
committed
refactored react and djnago app into feature-based folders
1 parent 8fcf97f commit 8a67d5e

File tree

158 files changed

+3468
-1728
lines changed

Some content is hidden

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

158 files changed

+3468
-1728
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,18 @@ docker build -t instagram-scraper-api .
8585
docker run -p 3000:3000 instagram-scraper-api
8686
```
8787

88+
### Database Migrations
89+
```bash
90+
# 1. Modify model file
91+
# 2. Generate migration
92+
python manage.py makemigrations events
93+
# 2.5 Double review the generated migration file before applying
94+
# 2.6 Run a dry run of the generated migration
95+
python manage.py migrate --dry-run
96+
# 3. Apply migration
97+
python manage.py migrate events
98+
```
99+
88100
## Dependencies
89101

90102
### Backend Requirements:
@@ -112,5 +124,4 @@ docker run -p 3000:3000 instagram-scraper-api
112124
| Health check | `curl http://localhost:3000/health/` |
113125
| Get all events | `curl http://localhost:3000/api/events/` |
114126
| Get all clubs | `curl http://localhost:3000/api/clubs/` |
115-
| Create mock event | `curl -X POST http://localhost:3000/api/mock-event/ -H "Content-Type: application/json" -d '{"name": "Test Event", "location": "Test Location", "food": "Pizza"}'` |
116127
| Find similar events | `curl "http://localhost:3000/api/test-similarity/?text=Your%20Search%20Text"` |

backend/api/urls.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

backend/apps/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Apps package

backend/apps/clubs/apps.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class ClubsConfig(AppConfig):
5+
default_auto_field = "django.db.models.BigAutoField"
6+
name = "apps.clubs"

backend/example/migrations/0001_squashed_0004_alter_clubs_club_type.py renamed to backend/apps/clubs/migrations/0001_initial.py

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,15 @@
1-
# Generated by Django 4.2.7 on 2025-09-07 20:53
1+
# Generated by Django 4.2.7 on 2025-10-12 16:01
22

33
from django.db import migrations, models
44

55

66
class Migration(migrations.Migration):
7-
replaces = [
8-
("example", "0001_initial"),
9-
("example", "0002_clubs_club_type"),
10-
("example", "0003_alter_clubs_club_type"),
11-
("example", "0004_alter_clubs_club_type"),
12-
]
137

148
initial = True
159

1610
dependencies = []
1711

1812
operations = [
19-
migrations.CreateModel(
20-
name="Events",
21-
fields=[
22-
(
23-
"id",
24-
models.BigAutoField(
25-
auto_created=True,
26-
primary_key=True,
27-
serialize=False,
28-
verbose_name="ID",
29-
),
30-
),
31-
(
32-
"club_handle",
33-
models.CharField(blank=True, max_length=100, null=True),
34-
),
35-
("url", models.URLField(blank=True, null=True)),
36-
("name", models.CharField(max_length=100)),
37-
("date", models.DateField()),
38-
("start_time", models.TimeField()),
39-
("end_time", models.TimeField()),
40-
("location", models.CharField(max_length=255)),
41-
],
42-
options={
43-
"db_table": "events",
44-
},
45-
),
4613
migrations.CreateModel(
4714
name="Clubs",
4815
fields=[

backend/apps/clubs/models.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from django.db import models
2+
3+
4+
class Clubs(models.Model):
5+
club_name = models.CharField(max_length=100, unique=True)
6+
categories = models.CharField(max_length=255)
7+
club_page = models.URLField(blank=True, null=True)
8+
ig = models.URLField(blank=True, null=True)
9+
discord = models.URLField(blank=True, null=True)
10+
club_type = models.CharField(
11+
max_length=50,
12+
null=True,
13+
blank=True,
14+
choices=[
15+
("WUSA", "WUSA"),
16+
("Athletics", "Athletics"),
17+
("Student Society", "Student Society"),
18+
],
19+
)
20+
21+
class Meta:
22+
db_table = "clubs"
23+
24+
def __str__(self):
25+
return self.club_name

backend/apps/clubs/tests.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.test import TestCase
2+
3+
# Create your tests here.

backend/apps/clubs/urls.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"""
2+
URL configuration for clubs app.
3+
"""
4+
5+
from django.urls import path
6+
from . import views
7+
8+
urlpatterns = [
9+
path("", views.get_clubs, name="clubs"),
10+
]

0 commit comments

Comments
 (0)