A comprehensive Flask-based web application for managing extracurricular activities at university institutions, featuring advanced data mining, statistics, and AI-powered database querying.
- Students: Profile management, departments, and contact information
- Clubs: Club creation, membership tracking, and status management
- Events: Planning, venue management, and scheduling
- Sponsors: Financial contribution tracking and contract management
- Club Activities: Meeting/workshop management with Budget and Rating tracking
- Advanced Search: Multi-criteria filters (Department, Club, Date)
- Set Operations:
- Intersection: Students enrolled in both Club A AND Club B
- Union: Global search across multiple tables
- Difference: Students without clubs or Clubs without activities
- Relational Audit: 360° inspection of entity relationships (Spider-web view)
Conversational interface for natural language database queries with text-to-SQL translation.
Example queries:
- "Which Computer Science students were born after 2002?"
- "Rank clubs by descending budget"
- "Which club has the best average rating?"
- Real-time KPI dashboard
- Activity ranking by Budget (Gold/Silver/Bronze badges)
- Popularity ranking (Star system ⭐)
- Backend: Python 3.x, Flask
- Database: SQLite (Development), SQLAlchemy (ORM)
- Frontend: HTML5, Jinja2, CSS3 (Custom + Variables), FontAwesome
- AI: Google Generative AI SDK (
google-generativeai) - Design: Glassmorphism, Gradients (Indigo/Pink/Purple), Responsive
git clone https://github.com/your-username/activites-plus.git
cd activites-plus# Windows
python -m venv venv
venv\Scripts\activate
# Mac/Linux
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txt- Get a free API key from Google AI Studio
- Open
main.pyand modify:
GENAI_API_KEY = "YOUR_API_KEY_HERE"The application will automatically create site.db (or database.db) on first run.
For existing databases: To add Budget and Rating columns, run:
python update_db.pypython main.pyAccess via browser: http://127.0.0.1:5000
activites-plus/
│
├── static/
│ └── css/
│ ├── admin.css # Dashboard and table styles
│ ├── clubs.css # Club-specific styles
│ └── homepage.css # General styles
│
├── templates/
│ ├── admin_dashboard.html
│ ├── ai_search.html # AI Smart Search interface
│ ├── recherche.html # Advanced Search (Filters)
│ ├── classement_budget.html
│ ├── modifierAC.html
│ ├── listeAC.html
│ └── ... (other CRUD templates)
│
├── instance/
│ └── site.db # SQLite database
│
├── main.py # Flask entry point & Routes
├── models.py # SQLAlchemy models
├── update_db.py # Migration script (Budget/Rating)
└── requirements.txt # Dependencies
Flask==3.0.0
Flask-SQLAlchemy==3.1.1
SQLAlchemy==2.0.23
google-generativeai==0.3.1
werkzeug==3.0.1
Conversational interface that generates secure SQL and displays results dynamically in a modern table.
Route: /admin/smart-search
Visualization of activities sorted by budget with rank badges (1st, 2nd, 3rd) and intelligent color coding.
Route: /admin/activites/budget
Find complex intersections (e.g., Students in club X who are also in club Y) via dynamic forms.
Route: /admin/search
Contributions are welcome!
- Fork the project
- 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
Distributed under the MIT License.
- First Launch: Run the application and navigate to the admin dashboard
- Add Data: Start by creating clubs, then add students and events
- Try AI Search: Visit
/admin/smart-searchto query your database naturally - Explore Analytics: Check budget rankings and activity statistics
- Advanced Features: Use set operations to find complex relationships
- Keep your Gemini API key private and never commit it to version control
- Use environment variables for production deployments
- The AI search sanitizes SQL queries to prevent injection attacks
For issues or questions, please open an issue on GitHub or contact the development team.
Developed for ENSA Khouribga - Extracurricular Activities Management
Built with ❤️ for university communities