95 lines
2.1 KiB
Markdown
95 lines
2.1 KiB
Markdown
# Admin Panel - Hosting Platform Management
|
|
|
|
Admin panel for managing the hosting platform, customers, subscription plans, and Cloudflare accounts.
|
|
|
|
## Project Structure
|
|
|
|
```
|
|
AdminPanel/
|
|
├── backend/ # Flask API (Port 5001)
|
|
│ ├── app/
|
|
│ │ ├── routes/ # API routes
|
|
│ │ ├── models.py # Database models
|
|
│ │ └── main.py # Flask app
|
|
│ └── requirements.txt
|
|
├── frontend/ # React + Vite
|
|
│ └── src/
|
|
└── README.md
|
|
```
|
|
|
|
## Features
|
|
|
|
- **Admin Authentication** - Secure admin login system
|
|
- **Customer Management** - View and manage customers
|
|
- **Subscription Plans** - Create and manage subscription plans
|
|
- **Cloudflare Accounts** - Manage company CF accounts
|
|
- **Audit Logs** - Track all admin actions
|
|
|
|
## Backend Setup
|
|
|
|
```bash
|
|
cd backend
|
|
python3 -m venv venv
|
|
source venv/bin/activate
|
|
pip install -r requirements.txt
|
|
|
|
# Create database
|
|
createdb admin_hosting_db
|
|
|
|
# Run
|
|
python -m app.main
|
|
```
|
|
|
|
Default admin credentials:
|
|
- Username: `admin`
|
|
- Password: `admin123`
|
|
|
|
## Frontend Setup
|
|
|
|
```bash
|
|
cd frontend
|
|
npm install
|
|
npm run dev
|
|
```
|
|
|
|
## Database
|
|
|
|
Separate PostgreSQL database: `admin_hosting_db`
|
|
|
|
Tables:
|
|
- `admin_users` - Admin accounts
|
|
- `subscription_plans` - Subscription plans
|
|
- `cloudflare_accounts` - Company CF accounts
|
|
- `audit_logs` - Admin action logs
|
|
|
|
## API Endpoints
|
|
|
|
### Authentication
|
|
- `POST /api/auth/login` - Admin login
|
|
- `GET /api/auth/me` - Get current admin
|
|
- `POST /api/auth/logout` - Logout
|
|
|
|
### Plans
|
|
- `GET /api/plans` - List all plans
|
|
- `POST /api/plans` - Create plan
|
|
- `PUT /api/plans/:id` - Update plan
|
|
- `DELETE /api/plans/:id` - Delete plan
|
|
|
|
### CF Accounts
|
|
- `GET /api/cf-accounts` - List CF accounts
|
|
- `POST /api/cf-accounts` - Create CF account
|
|
- `PUT /api/cf-accounts/:id` - Update CF account
|
|
- `DELETE /api/cf-accounts/:id` - Delete CF account
|
|
|
|
### Customers
|
|
- `GET /api/customers` - List customers (via customer API)
|
|
- `GET /api/customers/:id` - Get customer details
|
|
- `PUT /api/customers/:id/plan` - Update customer plan
|
|
|
|
## Deployment
|
|
|
|
- **Domain:** admin.argeict.net
|
|
- **Backend Port:** 5001
|
|
- **Database:** admin_hosting_db
|
|
|