{"id":28918011,"url":"https://github.com/alphazee09/alphazee_09_backend","last_synced_at":"2026-02-01T02:33:36.087Z","repository":{"id":299959650,"uuid":"1004741441","full_name":"alphazee09/alphazee_09_backend","owner":"alphazee09","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-19T05:40:07.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-19T06:31:39.756Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alphazee09.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-19T05:38:52.000Z","updated_at":"2025-06-19T05:40:11.000Z","dependencies_parsed_at":"2025-06-19T06:42:19.319Z","dependency_job_id":null,"html_url":"https://github.com/alphazee09/alphazee_09_backend","commit_stats":null,"previous_names":["alphazee09/alphazee_09_backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alphazee09/alphazee_09_backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphazee09%2Falphazee_09_backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphazee09%2Falphazee_09_backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphazee09%2Falphazee_09_backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphazee09%2Falphazee_09_backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alphazee09","download_url":"https://codeload.github.com/alphazee09/alphazee_09_backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphazee09%2Falphazee_09_backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28965397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T02:14:24.993Z","status":"ssl_error","status_checked_at":"2026-02-01T02:13:55.706Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-22T01:06:11.115Z","updated_at":"2026-02-01T02:33:36.080Z","avatar_url":"https://github.com/alphazee09.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# AlphaZee Client Platform - Backend Implementation\n\n## Overview\n\nThis is a complete backend implementation for the AlphaZee Client Platform, built with Flask and PostgreSQL. The backend provides a comprehensive API for managing clients, projects, contracts, payments, and communication.\n\n## Features Implemented\n\n### 🔐 Authentication \u0026 User Management\n- User registration and login with JWT tokens\n- Password reset functionality\n- Identity verification with ID card and signature uploads\n- Role-based access control (Admin/Client)\n- Session management\n\n### 📋 Project Management\n- Project submission with automatic account creation\n- Project status tracking and milestone management\n- File uploads and project documentation\n- Project type categorization\n- Progress tracking and reporting\n\n### 📄 Contract Management\n- Contract creation and digital signing\n- Contract lifecycle management (draft → sent → signed → active → completed)\n- Digital signature verification\n- Contract expiration handling\n- PDF generation support\n\n### 💳 Payment Processing\n- Stripe payment integration\n- Invoice generation and management\n- Payment tracking and history\n- Milestone-based payments\n- Tax calculation\n\n### 💬 Communication System\n- Messaging between clients and admin\n- Real-time notifications\n- Message threading and replies\n- File attachments support\n\n### 👨‍💼 Admin Panel\n- User management and verification\n- Project oversight and status updates\n- Contract and payment management\n- System analytics and reporting\n- Activity logging\n\n## Technology Stack\n\n- **Framework**: Flask 3.1.1\n- **Database**: PostgreSQL with SQLAlchemy ORM\n- **Authentication**: Flask-JWT-Extended\n- **Migrations**: Flask-Migrate\n- **Email**: Flask-Mail\n- **File Storage**: Local storage with AWS S3 support\n- **Payments**: Stripe integration\n- **CORS**: Flask-CORS\n\n## Database Schema\n\nThe database includes the following main tables:\n\n- `users` - User accounts and profiles\n- `identity_verifications` - Identity verification data\n- `projects` - Project information and status\n- `project_types` - Project categorization\n- `project_milestones` - Project milestone tracking\n- `project_files` - File attachments\n- `contracts` - Contract management\n- `contract_signatures` - Digital signatures\n- `payments` - Payment transactions\n- `invoices` - Invoice management\n- `messages` - Communication system\n- `notifications` - User notifications\n- `activity_logs` - System activity tracking\n\n## API Endpoints\n\n### Authentication (`/api/auth`)\n- `POST /register` - User registration\n- `POST /login` - User login\n- `POST /logout` - User logout\n- `POST /refresh` - Refresh JWT token\n- `POST /forgot-password` - Request password reset\n- `POST /reset-password` - Reset password\n\n### Users (`/api/users`)\n- `GET /profile` - Get user profile\n- `PUT /profile` - Update user profile\n- `POST /upload-avatar` - Upload profile picture\n- `POST /verify-identity` - Submit identity verification\n- `GET /verification-status` - Check verification status\n\n### Projects (`/api/projects`)\n- `GET /types` - Get project types\n- `POST /submit` - Submit new project (public endpoint)\n- `GET /` - Get user projects\n- `GET /{id}` - Get project details\n- `PUT /{id}/status` - Update project status (admin)\n- `GET /{id}/milestones` - Get project milestones\n- `POST /{id}/milestones` - Create milestone (admin)\n- `PUT /{id}/milestones/{milestone_id}/complete` - Complete milestone (admin)\n- `GET /{id}/files` - Get project files\n- `POST /{id}/files` - Upload project file\n\n### Contracts (`/api/contracts`)\n- `GET /` - Get contracts\n- `GET /{id}` - Get contract details\n- `POST /` - Create contract (admin)\n- `PUT /{id}/send` - Send contract to client (admin)\n- `POST /{id}/sign` - Sign contract\n- `PUT /{id}/activate` - Activate contract (admin)\n- `PUT /{id}/complete` - Complete contract (admin)\n\n### Payments (`/api/payments`)\n- `GET /` - Get payments\n- `GET /{id}` - Get payment details\n- `POST /` - Create payment request (admin)\n- `POST /{id}/process` - Process payment\n- `POST /{id}/intent` - Create Stripe payment intent\n- `POST /{id}/confirm` - Confirm payment\n- `GET /invoices` - Get invoices\n- `POST /invoices` - Create invoice (admin)\n\n### Messages (`/api/messages`)\n- `GET /` - Get messages\n- `GET /{id}` - Get message details\n- `POST /` - Send message\n- `POST /{id}/reply` - Reply to message\n- `PUT /{id}/read` - Mark message as read\n- `GET /unread-count` - Get unread message count\n- `GET /notifications` - Get notifications\n- `PUT /notifications/{id}/read` - Mark notification as read\n\n### Files (`/api/files`)\n- `POST /upload` - Upload general file\n- `GET /download/{path}` - Download file\n- `GET /info/{path}` - Get file information\n- `DELETE /delete/{path}` - Delete file\n\n### Admin (`/api/admin`)\n- `GET /dashboard` - Get admin dashboard\n- `GET /users` - Get all users\n- `GET /users/{id}` - Get user details\n- `PUT /users/{id}/status` - Update user status\n- `PUT /users/{id}/verification` - Update verification status\n- `GET /project-types` - Manage project types\n- `POST /project-types` - Create project type\n- `GET /activity-logs` - Get activity logs\n- `POST /system/cleanup` - System cleanup\n- `POST /system/broadcast` - Broadcast message\n\n## Installation \u0026 Setup\n\n### Prerequisites\n- Python 3.11+\n- PostgreSQL 14+\n- Virtual environment\n\n### 1. Clone and Setup\n```bash\ncd alphazee_backend\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\npip install -r requirements.txt\n```\n\n### 2. Database Setup\n```bash\n# Install PostgreSQL\nsudo apt update\nsudo apt install postgresql postgresql-contrib\n\n# Start PostgreSQL\nsudo systemctl start postgresql\nsudo systemctl enable postgresql\n\n# Create database and user\nsudo -u postgres createdb alphazee_db\nsudo -u postgres psql -c \"CREATE USER alphazee_user WITH PASSWORD 'alphazee_password';\"\nsudo -u postgres psql -c \"GRANT ALL PRIVILEGES ON DATABASE alphazee_db TO alphazee_user;\"\nsudo -u postgres psql -c \"ALTER USER alphazee_user CREATEDB;\"\n```\n\n### 3. Environment Configuration\n```bash\ncp .env.example .env\n# Edit .env file with your configuration\n```\n\n### 4. Database Migration\n```bash\nexport FLASK_APP=src/main.py\nflask db init\nflask db migrate -m \"Initial migration\"\nflask db upgrade\n```\n\n### 5. Run Application\n```bash\npython src/main.py\n```\n\nThe application will be available at `http://localhost:5000`\n\n## Environment Variables\n\n```env\n# Flask Configuration\nSECRET_KEY=your-secret-key-here\nJWT_SECRET_KEY=your-jwt-secret-key-here\n\n# Database Configuration\nDATABASE_URL=postgresql://alphazee_user:alphazee_password@localhost/alphazee_db\n\n# Email Configuration\nMAIL_SERVER=smtp.gmail.com\nMAIL_PORT=587\nMAIL_USE_TLS=true\nMAIL_USERNAME=your-email@gmail.com\nMAIL_PASSWORD=your-app-password\nMAIL_DEFAULT_SENDER=noreply@alphazee.com\n\n# Stripe Configuration\nSTRIPE_PUBLISHABLE_KEY=pk_test_your-stripe-publishable-key\nSTRIPE_SECRET_KEY=sk_test_your-stripe-secret-key\n\n# Application URLs\nFRONTEND_URL=http://localhost:5173\nBACKEND_URL=http://localhost:5000\n\n# CORS Configuration\nCORS_ORIGINS=http://localhost:5173,http://localhost:3000\n```\n\n## Production Deployment\n\n### Using Gunicorn\n```bash\npip install gunicorn\ngunicorn -w 4 -b 0.0.0.0:5000 src.main:app\n```\n\n### Using Docker\n```dockerfile\nFROM python:3.11-slim\n\nWORKDIR /app\nCOPY requirements.txt .\nRUN pip install -r requirements.txt\n\nCOPY . .\nEXPOSE 5000\n\nCMD [\"gunicorn\", \"-w\", \"4\", \"-b\", \"0.0.0.0:5000\", \"src.main:app\"]\n```\n\n### Environment Setup for Production\n- Set `DEBUG=False`\n- Use strong secret keys\n- Configure proper database credentials\n- Set up SSL/TLS certificates\n- Configure email server\n- Set up Stripe production keys\n- Configure file storage (AWS S3 recommended)\n\n## Security Features\n\n- JWT token-based authentication\n- Password hashing with bcrypt\n- CORS protection\n- SQL injection prevention with SQLAlchemy ORM\n- File upload validation\n- Rate limiting (can be added with Flask-Limiter)\n- Input validation and sanitization\n\n## File Storage\n\nThe system supports both local file storage and AWS S3:\n\n### Local Storage\nFiles are stored in the `uploads/` directory with organized subdirectories:\n- `avatars/` - User profile pictures\n- `identity/front_id/` - Front ID card images\n- `identity/back_id/` - Back ID card images\n- `identity/signatures/` - Digital signatures\n- `projects/{project_id}/` - Project files\n- `contracts/{contract_id}/signatures/` - Contract signatures\n\n### AWS S3 Storage\nConfigure AWS credentials in environment variables to use S3 storage.\n\n## Testing\n\nThe application includes comprehensive error handling and logging. Test the API endpoints using:\n\n```bash\n# Health check\ncurl http://localhost:5000/api/health\n\n# Test project types endpoint\ncurl http://localhost:5000/api/projects/types\n```\n\n## Monitoring \u0026 Logging\n\n- Application logs are written to console and can be redirected to files\n- Activity logging tracks all user actions\n- Database queries are logged in debug mode\n- Error handling with proper HTTP status codes\n\n## Support\n\nFor issues or questions regarding the backend implementation, please refer to the code comments and documentation within each module.\n\n## License\n\nThis backend implementation is proprietary software for AlphaZee Client Platform.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphazee09%2Falphazee_09_backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falphazee09%2Falphazee_09_backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphazee09%2Falphazee_09_backend/lists"}