Skip to content

LarkaFenrir/idea-cloud

Repository files navigation

  _____      _                 _____  _                    _ 
 |_   _|    | |               / ____|| |                  | |
   | |    __| |  ___   __ _  | |     | |  ___   _   _   __| |
   | |   / _` | / _ \ / _` | | |     | | / _ \ | | | | / _` |
  _| |_ | (_| ||  __/| (_| | | |____ | || (_) || |_| || (_| |
 |_____| \__,_| \___| \__,_|  \_____||_| \___/  \__,_| \__,_|

Project Overview

Idea Cloud is a collaborative web platform designed to bridge the gap between people with ideas and people able to implement those ideas. It provides an environment where non-technical users can pitch project ideas, while developers and creators can form organized groups to bring those visions to life.

We initially deployed the project on Heroku but won't continue the membership after the course is done.

Project Context: This application serves as the final capstone project for a 1-year Python backend development course. It was built collaboratively by a team of 5 developers over a period of 6 weeks.

This project was developed over a 6-week timee frame by a team of 5 developers. Our goal was to create a robust, scalable backend using Django. It was a learning experience for all of us and there's still a lot of features that could be added.

Note: The primary focus of this project is the backend architecture, API design, and database management. The included frontend is strictly presentational to show what the website could look like.

Core Features & Functionality

  • Project Pitching & Collaboration:

    • Users can post detailed project ideas and form dedicated groups to bring those ideas to life with other collaborators.
  • Social System & Moderation:

    • Includes a full "Like" and comment system for community feedback, protected by a custom profanity filter to keep content clean.
  • Optimized Database Queries:

    • We used .annotate(), exists, and OuterRef subqueries to handle like counts and user-status flags efficiently, avoiding the "N+1" performance issues that slow down APIs.
  • User Management & Security:

    • Built a custom user model and implemented Token-based authentication (DRF) for secure registration and login flows.
  • Automated File Cleanup:

    • Custom logic overrides the model's delete() method to automatically remove orphaned image files from the server's storage when a project is deleted.
  • Base64 Image Processing:

    • The backend accepts Base64 strings for images, validates that they are actually JPGs, and saves them directly to the server.
  • Input Sanitization:

    • We use to_internal_value() in our serializers to strip HTML tags and trim unnecessary whitespace before any data hits the database.
  • Smart Permission Logic:

    • Implemented a 15-minute window for editing comments and a relational locking system that prevents projects or groups from being modified once they are marked as "Finished".
  • Live API Documentation:

    • Integrated Swagger so anyone can explore and test the backend endpoints directly through the browser.
  • Cloud deployable:

    • The project is easy to set up in a cloud environment as is. We used Heroku for our tests but other providers work just as well.
  • Gunicorn Deployment:

    • Integrated as the WSGI HTTP Server to handle multiple concurrent connections, ensuring the application remains stable and responsive under real-world traffic.
  • Whitenoise Static Serving:

    • Configured for efficient static file management, allowing the Django application to serve its own assets (CSS, JS, images) directly. This simplifies the infrastructure by removing the need for a standalone Nginx server in cloud environments.

Tech Stack

Component
Technology
Backend Python 3.14+, Django 6.0+
API Framework Django REST Framework (DRF)
Frontend HTML5, CSS3, Django Templates
Database PostgreSQL (Production/Local)
Documentation Swagger, Postman
Authentication: DRF Authtoken
Server (WSGI) : Gunicorn
Static Assets: WhiteNoise

Setup & Installation

Prerequisites

  • Python 3.14+
  • PostgreSQL (Ensure a local instance is running)
  • Git

Installation Steps

  1. Clone the Repository
git clone https://github.com/SlimariusSlimus/dci_final_project.git
cd idea_cloud
  1. Set up the Virtual Environment
python -m venv env       # may be python3 on your system
source env/bin/activate  # On Windows: env\Scripts\activate
  1. Install Dependencies
pip install -r requirements.txt
  1. Configure Environment Variables Rename the provided example_dotenv to .env in the root directory and update your configuration:
DJANGO_SECRET_KEY=your_secret_key_here
DJANGO_DEBUG=True
DATABASE_URL="local"
DB_NAME=final_project
# In your psql terminal or pgAdmin
CREATE DATABASE final_project;

You can skip this step but if you're running into problems, try to delete the migration files and do this:

python manage.py makemigrations
python manage.py migrate
  1. Static Files & Initial Data
python manage.py collectstatic --noinput
  1. Configure Environment Variables

Install this plugin in the same environment as your Django application

pip install django-plugin-database-url 

Once installed, any DATABASE_URL environment variable will be automatically used to configure your Django database setting, using dj-database-url.

DATABASE_URL is specified in settings to .env vairables to consider below:

DJANGO_SECRET_KEY=[input your secret key]
DATABASE_URL=local
DB_NAME=[input your DB name]
DB_USER=[input your postgres username]
DB_PASSWORD=[input your password]
DB_HOST=localhost
DB_PORT=5432

DEBUG=True
  1. Run the Server
python manage.py runserver

The application will be available at localhost: `http://127.0.0.1:8000/'


Testing & Quality Assurance

The backend features a comprehensive test suite with 90% code coverage, ensuring the reliability of serializers, custom permissions, query logic, and user flows.

To execute the automated test suite and check coverage:

python manage.py test
coverage run manage.py test   # to run the test
coverage report               # to get a report of the testing in the console; add --skip-covered to only show files that don't have 100% coverage
coverage html                 # to get a browsable html file

API Documentation & Integration

We designed the API to be easily consumed by any frontend or mobile application.

Postman Collection: A fully configured Postman collection (IdeaCloud.postman_collection.json) is included in the root directory. Import it into Postman to test all available endpoints, complete with example request bodies and authorization headers. (You will have to create tokens for the users manually and add them in the variables tab)

Interactive Documentation: Once the local server is running, you can explore the Open API endpoints interactively via Swagger UI at http://127.0.0.1:8000/swagger-api/.


Project Structure

  • projects/: Core business logic for managing ideas, group formation, image handling, likes, and comments.

  • users/: Custom user models, token authentication, custom permissions, and profile management.

  • config/: Main project settings, URL routing, and custom image processing helpers.

  • front_end/: Django views and templates serving the web UI.

  • templates/: Includes .html files displaying frontend views.

  • static/ & media/: Storage for CSS, JS, global assets, and user-uploaded content.

  • Procfile runtime.txt: Heroku related support files storing wsgi and python config, required for cloud deployment.

The Team

Name GitHub Name Role(s) in the Project
mamasitta Teacher & Mentor
Mattis M. SlimariusSlimus Backend
Tech Lead
Muhammad Radwan mradwan123 Scrum Master
Backend
Frontend
Malte R. Lamarr12345 Backend
Frontend
Martina C. LarkaFenrir Frontend
Backend
alaakaroum Backend

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

About

Platform designed to connect visions and skills.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors