Skip to content

SamOBrienOlinger/drf-spoodle-space

Repository files navigation

SpoodleSpace–Backend

SpoodleSPACE

SpoodleSpace is a Django REST Framework API that powers the frontend React app, delivering a full social platform for Cockapoo dog owners and enthusiasts.

Originally inspired by Cockapoo Club, this project expands the idea into a more engaging, interactive, and scalable experience using HTML, CSS, JavaScript, Python, React, Bootstrap, and Django REST Framework.


🚧 Site is Available on Desktop, but Temporarily Unavailable on Mobile Devices. This is due a necessary Database Migration as a result of ElephantSQL's End of Life. The website has since been moved to Heroku's PostgreSQL database service

I am actively working to restore full functionality for use on mobile devices as quickly as possible. I am also evaluating a wide range of other relational database management systems to ensure the website has a robust and scalable infrastructure for the future.

Thank you for your patience. I appreciate your understanding.


Summary

This social platform allows users to connect, share photographs, and exchange information about caring for Cockapoos — one of Ireland’s most beloved dog breeds.

Unlike typical social networks, this project fosters a shared identity and belonging within a niche community. It is designed to attract:

  • Families, couples, or individuals who already own Cockapoos.
  • People seeking guidance on training, health, or behaviour.
  • Potential owners researching the breed.
  • Owners wanting to share photos, stories, and adventures.
  • Anyone looking for peer support from fellow dog lovers.

The backend plays a critical role in linking frontend components and ensuring smooth user experiences.


Contents


User Stories

Navigation and Authentication

  • Users can access a navigation bar on all pages.
  • Users can sign up, log in, and stay logged in using JWT.
  • Users can tell whether they're logged in and view avatars.
  • Conditional rendering: signed-in vs. signed-out views.

Profile Features

  • View other users' profiles.
  • See most followed profiles.
  • View profile stats: post count, followers, etc.
  • Follow/unfollow users.
  • Update username and password.

Posts, Likes, and Comments

  • Create, view, edit, and delete posts.
  • Like/unlike posts.
  • Comment on posts, view timestamps, and edit/delete comments.
  • Infinite scrolling for all post lists.

Dog Profile

  • Add and edit your dog's profile and photo.
  • View recent and searchable dog profiles.
  • View others’ dog profiles (if following).

Dog Health

  • Add/edit your dog’s health info.
  • View recent health details.
  • Keyword search and infinite scrolling.

Dog Danger

  • Add/edit information about how dangerous your dog is.
  • View recent posts and search.
  • Infinite scrolling enabled.

Entity Relationship Diagram

  • Built-in Django models were used with three custom models:

    • DogProfile
    • DogHealth
    • DogDanger

Entity Relationship Diagram

Detailed ERD

This ERD details the core database relationships in the SpoodleSpace backend. It highlights the 1:1 and 1:M connections between user profiles, posts, comments, likes, followers, and data Users can CRUD that is specific to their Dog Profile.

Detailed Entity Relationship Diagram


Technologies

Languages

Frameworks & Tools


Testing

Manual testing was carried out to:

  • Restrict user access to protected actions.
  • Verify full CRUD functionality in the API.
  • Validate user story outcomes.

Refer to /testing.md for backend testing details.
User stories and acceptance criteria are tracked in GitHub Projects.
Frontend testing can be found in the frontend repo README and testing.md.

Python Validation

The Code Institute's CI Python Linter was used to validate all Python code.
All apps passed validation except for E501 long line warnings:

Python validator


Fixed Bugs

Model changes caused database inconsistencies.
A ForeignKey field was mistakenly used instead of OneToOneField, corrupting migrations.
Resolution involved deleting the old ElephantSQL DB, creating a new one, and updating env.py and Heroku Config Vars.


Deployment

Original ElephantSQL Setup

  1. Log in to ElephantSQL.
  2. Create a new instance (Tiny Turtle plan).
  3. Choose nearest region.
  4. Review and create.
  5. Copy the database URL.
  6. Add it to Heroku config vars.

Heroku Deployment

  1. Log in to Heroku.
  2. Create a new app.
  3. Set region and app name.
  4. Link GitHub repo under Deploy tab.
  5. Install required packages (psycopg2, dj-database-url, etc.).
  6. Configure JWT, CORS, allowed hosts, etc.
  7. Ignore env.py.
  8. Generate requirements.txt.
  9. Click Deploy Branch.
  10. After build, click Open App.

⚠️ The database is currently being migrated to Supabase.


Credits

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages