A comprehensive backend system for managing student activities, programs, and user interactions at the Faculty of Science, Helwan University. Built with Django REST Framework and PostgreSQL, this platform serves as the backbone for the Student Activity Website, enabling seamless management of academic programs, events, and student engagement.
- User Authentication - JWT-based authentication system
- Program Management - Create, read, update, and delete programs
- Favorites System - Users can save favorite programs
- Contact Form - Integrated email notification system
- Admin Dashboard - Full-featured admin interface
- RESTful API - Well-documented API endpoints
- File Uploads - Support for program images and media
- Python 3.8+
- PostgreSQL
- Node.js & npm (for frontend)
- pip (Python package manager)
-
Clone the repository
git clone https://github.com/ahmedsamir45/SAF-Website-backend.git cd SAF-Website-backend -
Set up a virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables Create a
.envfile in the root directory with the following variables:SECRET_KEY=your-secret-key DEBUG=True DATABASE_URL=postgres://user:password@localhost:5432/saf_db EMAIL_HOST=smtp.gmail.com EMAIL_PORT=587 EMAIL_USE_TLS=True EMAIL_HOST_USER=[email protected] EMAIL_HOST_PASSWORD=your-app-password DEFAULT_FROM_EMAIL=[email protected] ADMIN_EMAIL=[email protected]
-
Run migrations
python manage.py migrate
-
Create a superuser
python manage.py createsuperuser
-
Run the development server
python manage.py runserver
POST /api/auth/jwt/create/- Obtain JWT tokenPOST /api/auth/users/- Register new userGET /api/auth/users/me/- Get current user profile
GET /api/programs/- List all programsPOST /api/programs/- Create new program (Admin only)GET /api/programs/{id}/- Get program detailsPUT /api/programs/{id}/- Update program (Admin only)
GET /api/programs/favorites/- Get user's favorite programsPOST /api/programs/{id}/favorite/- Toggle favorite status
POST /api/contact/- Submit contact form
| Variable | Description | Required | Default |
|---|---|---|---|
SECRET_KEY |
Django secret key | Yes | - |
DEBUG |
Debug mode | No | False |
DATABASE_URL |
Database connection URL | Yes | - |
EMAIL_HOST |
SMTP server host | No | - |
EMAIL_PORT |
SMTP server port | No | 587 |
EMAIL_USE_TLS |
Use TLS for email | No | True |
EMAIL_HOST_USER |
Email username | No | - |
EMAIL_HOST_PASSWORD |
Email password | No | - |
DEFAULT_FROM_EMAIL |
Default sender email | No | - |
ADMIN_EMAIL |
Admin email for notifications | No | - |
Run the test suite with:
python manage.py test- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For any questions or feedback, please contact [email protected]