AI Analytics configured, not working as expected, still in testing.
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.
- Custom user model with
rolefield (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
- Login and signup pages
- Dashboard for managing subscriptions
- Role-based UI (Admin / User)
- Dynamic analytics display
- 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
- Clone the repo:
git clone <repo_url>
cd subscription_management_backend- Create and activate virtual environment:
python3 -m venv .venv
source .venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Add environment variables:
DATABASE_URL=postgres://user:password@host:port/dbname OPENAI_API_KEY=your_openai_api_key
- Apply migrations:
python manage.py migrate- Create superuser (if not using auto-create):
python manage.py createsuperuser- Run the backend:
python manage.py runserverNavigate 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.