A modern, full-stack web application built with Django REST Framework backend and React TypeScript frontend, featuring user authentication, content management, and a beautiful Material-UI interface.
- User Authentication: Registration, login, logout with JWT tokens
- User Profiles: Extended user profiles with bio, location, social links
- Content Management: Posts with categories, tags, and comments
- Interactive Features: Likes, bookmarks, and nested comments
- API Documentation: Auto-generated API docs with DRF
- Security: JWT authentication, CORS handling, input validation
- Database: SQLite (development) / PostgreSQL (production ready)
- Modern UI: Material-UI components with dark/light theme
- Authentication: Login, registration, protected routes
- Responsive Design: Mobile-first, fully responsive layout
- State Management: React Query for server state, Context API for auth
- Type Safety: Full TypeScript implementation
- Form Handling: React Hook Form with validation
- Routing: React Router for navigation
- Framework: Django 4.2.7
- API: Django REST Framework 3.14.0
- Authentication: JWT (djangorestframework-simplejwt)
- Database: SQLite (development)
- Image Processing: Pillow
- CORS: django-cors-headers
- Environment: python-decouple
- Framework: React 19 with TypeScript
- UI Library: Material-UI (MUI) 5
- State Management: TanStack React Query
- Routing: React Router DOM
- Forms: React Hook Form with Yup validation
- HTTP Client: Axios
- Icons: Material-UI Icons
- Python 3.8+
- Node.js 16+
- npm or yarn
-
Navigate to backend directory
cd backend -
Create and activate virtual environment
python -m venv venv # Windows .\venv\Scripts\Activate.ps1 # macOS/Linux source venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
# Copy .env.example to .env and configure cp .env.example .env -
Run migrations
python manage.py makemigrations python manage.py migrate
-
Create superuser
python manage.py createsuperuser
-
Start development server
python manage.py runserver
The backend will be available at http://localhost:8000
-
Navigate to frontend directory
cd frontend -
Install dependencies
npm install
-
Set up environment variables
# Create .env file echo "REACT_APP_API_URL=http://localhost:8000/api" > .env
-
Start development server
npm start
The frontend will be available at http://localhost:3000
POST /api/auth/register/- User registrationPOST /api/auth/login/- User loginPOST /api/auth/logout/- User logoutPOST /api/auth/token/refresh/- Refresh JWT tokenGET /api/auth/current/- Get current userPATCH /api/auth/profile/update/- Update user profile
GET /api/posts/- List posts (with filtering, search, pagination)POST /api/posts/- Create new postGET /api/posts/{slug}/- Get post detailsPATCH /api/posts/{slug}/- Update postDELETE /api/posts/{slug}/- Delete postPOST /api/posts/{slug}/like/- Toggle likePOST /api/posts/{slug}/bookmark/- Toggle bookmark
GET /api/categories/- List categoriesGET /api/categories/tree/- Category tree structureGET /api/categories/{slug}/- Category details
GET /api/posts/{slug}/comments/- List post commentsPOST /api/posts/{slug}/comments/- Create comment
backend/
βββ core/ # Django project settings
βββ users/ # User authentication app
βββ posts/ # Posts management app
βββ categories/ # Categories app
βββ manage.py
βββ requirements.txt
βββ .env
frontend/
βββ src/
β βββ components/ # Reusable UI components
β β βββ auth/ # Authentication components
β β βββ layout/ # Layout components
β β βββ posts/ # Post-related components
β βββ contexts/ # React contexts (Auth, Theme)
β βββ hooks/ # Custom hooks
β βββ pages/ # Page components
β βββ services/ # API services
β βββ types/ # TypeScript type definitions
β βββ App.tsx
βββ package.json
βββ .env
- Users can register with email, username, and profile information
- JWT tokens are used for authentication
- Automatic token refresh on expiration
- Protected routes require authentication
- Users can create posts with rich content
- Posts can be categorized and tagged
- Support for featured images
- Draft and published status
- SEO-friendly with meta tags
- Like/unlike posts
- Bookmark posts for later reading
- Comment on posts with nested replies
- User profiles with bio and social links
- Dark/light theme toggle
- Responsive design for all devices
- Loading states and error handling
- Form validation with helpful messages
- Search and filtering capabilities
- JWT token authentication
- CORS protection
- Input validation and sanitization
- Rate limiting (production ready)
- Secure password hashing
- XSS protection
- Configure production settings
- Set up PostgreSQL database
- Configure static files with WhiteNoise
- Set environment variables
- Deploy with Gunicorn
- Build production bundle:
npm run build - Configure environment variables
- Deploy build folder
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Commit changes:
git commit -m 'Add feature' - Push to branch:
git push origin feature-name - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Real-time notifications
- Email verification
- Password reset functionality
- Advanced search with Elasticsearch
- File upload improvements
- Admin dashboard
- API rate limiting
- Cache implementation
- Test coverage improvement
- Docker containerization
- Some Material-UI Grid component compatibility issues (using Box as alternative)
- React Query devtools only in development mode
If you have any questions or issues, please open an issue in the repository or contact the development team.
Built with β€οΈ using Django & React