Skip to content

A full-stack subscription management system with admin and user roles, powered by Django REST Framework (backend) and React (frontend). This project includes automated AI suggestions using OpenAI API and role-based access management.

Notifications You must be signed in to change notification settings

abynxv/Subscription-Management-Project

Repository files navigation

AI Analytics configured, not working as expected, still in testing.

Subscription Management Project

A full-stack subscription management system with admin and user roles, powered by Django REST Framework (backend) and React (frontend). This project includes automated AI suggestions using OpenAI API and role-based access management.


Features

Backend (Django + DRF)

  • Custom user model with role field (admin / user)
  • Superuser creation
  • Role-based access control
  • REST API endpoints for:
    • User authentication (login/signup)
    • Subscription management
    • Analytics & AI suggestions
  • Integration with OpenAI API for subscription insights
  • PostgreSQL database
  • CORS enabled for frontend communication

Frontend (React)

  • Login and signup pages
  • Dashboard for managing subscriptions
  • Role-based UI (Admin / User)
  • Dynamic analytics display

Tech Stack

  • Backend: Django 4.2, Django REST Framework, psycopg2, djangorestframework-simplejwt
  • Frontend: React, Vite (or Create React App), TailwindCSS (optional)
  • Database: PostgreSQL
  • Async tasks & caching: Celery, Redis (optional)
  • APIs: OpenAI API for AI suggestions
  • Deployment: Render

Setup Instructions

Backend

  1. Clone the repo:
git clone <repo_url>
cd subscription_management_backend
  1. Create and activate virtual environment:
python3 -m venv .venv
source .venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Add environment variables:

DATABASE_URL=postgres://user:password@host:port/dbname OPENAI_API_KEY=your_openai_api_key

  1. Apply migrations:
python manage.py migrate
  1. Create superuser (if not using auto-create):
python manage.py createsuperuser
  1. Run the backend:
python manage.py runserver

Frontend

Navigate to frontend directory:

cd frontend

Install dependencies:

npm install

Run development server:

npm run dev

Build for production:

npm run build

Deploy the build folder (for Render or other static hosting)

Deployment Notes (Render)

Set ALLOWED_HOSTS in settings.py or via environment variable:
ALLOWED_HOSTS = ["subscription-management-project.onrender.com"]

Important Notes

Roles: admin has full access; user has limited access.

AI Suggestions: Requires valid OPENAI_API_KEY.

Database: PostgreSQL recommended in production. SQLite only for local testing.

Security: Ensure secret keys and API keys are never committed to the repo.

Admin UI

Screenshot from 2025-08-27 05-39-56 Screenshot from 2025-08-27 05-35-26

User Interface

Screenshot from 2025-08-27 05-38-43 Screenshot from 2025-08-27 05-38-54 Screenshot from 2025-08-27 05-37-42

About

A full-stack subscription management system with admin and user roles, powered by Django REST Framework (backend) and React (frontend). This project includes automated AI suggestions using OpenAI API and role-based access management.

Topics

Resources

Stars

Watchers

Forks