LeadAndTraining is a high-performance RESTful application designed to streamline the lifecycle of student leads and vocational training programs. It provides a centralized backend to manage prospective client data, track training progress, and automate the conversion of leads into active participants.
- Backend: Python 3.10+ with Flask Framework
- API Architecture: RESTful Design
- Database: MongoDB (NoSQL for flexible data modeling)
- Authentication: JWT (JSON Web Tokens) via Flask-JWT-Extended
- Configuration:
python-dotenvfor secure environment variables - Validation: Marshmallow (suggested for request/response schema)
- Lead Lifecycle Tracking: Manage leads from "New" to "Enrolled" or "Closed."
- Training Module Management: Create, update, and assign training sessions to specific leads.
- Secure API Access: Protected endpoints ensuring only authorized admins can modify data.
- Scalable Architecture: Built with a decoupled frontend-ready approach.
- Dynamic Queries: Leverages MongoDBβs flexibility for complex lead filtering.
- Python 3.10 or higher
- MongoDB installed and running (locally or Atlas)
Clone the repository and navigate to the project directory:
git clone https://github.com/Sundaraj0828/leadandtraining.git
cd leadandtrainingCreate a .env file in the root directory to protect your credentials:
FLASK_APP=app.py
FLASK_ENV=development
MONGO_URI=mongodb://localhost:27017/lead_training_db
JWT_SECRET_KEY=your_random_secure_string_herepip install -r requirements.txtflask runThe server will start at http://127.0.0.1:5000/.
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /api/leads |
Retrieve all leads | Yes |
| POST | /api/leads |
Create a new lead | Yes |
| GET | /api/leads/<id> |
Get specific lead details | Yes |
| PUT | /api/training/<id> |
Update training status | Yes |
| POST | /api/auth/login |
Obtain JWT access token | No |
βββ app/
β βββ models/ # MongoDB Schemas
β βββ routes/ # REST API Endpoints
β βββ utils/ # Helpers & Auth decorators
β βββ __init__.py # Flask app factory
βββ .env # Environment variables (Hidden)
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation
Distributed under the MIT License. See LICENSE for more information.
Developed with β€οΈ by [L.C. Sundaraj/Sundaraj0828]