{"id":31053111,"url":"https://github.com/nishantcoder108/cms-for-pool","last_synced_at":"2025-09-15T01:52:21.767Z","repository":{"id":309713478,"uuid":"1037290739","full_name":"NishantCoder108/cms-for-pool","owner":"NishantCoder108","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-13T12:31:27.000Z","size":66,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-06T21:00:44.508Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/NishantCoder108.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-08-13T10:55:27.000Z","updated_at":"2025-08-13T12:31:30.000Z","dependencies_parsed_at":"2025-08-13T12:39:05.493Z","dependency_job_id":"d0fb0341-65fc-49f4-9eba-b43acacbf266","html_url":"https://github.com/NishantCoder108/cms-for-pool","commit_stats":null,"previous_names":["nishantcoder108/cms-for-pool"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NishantCoder108/cms-for-pool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NishantCoder108%2Fcms-for-pool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NishantCoder108%2Fcms-for-pool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NishantCoder108%2Fcms-for-pool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NishantCoder108%2Fcms-for-pool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NishantCoder108","download_url":"https://codeload.github.com/NishantCoder108/cms-for-pool/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NishantCoder108%2Fcms-for-pool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275194020,"owners_count":25421441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-09-15T01:52:16.553Z","updated_at":"2025-09-15T01:52:21.759Z","avatar_url":"https://github.com/NishantCoder108.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CMS for Pool \u0026 Token Management System\n\nA modern, containerized Content Management System (CMS) for managing pools, custom tokens, and wallets with a robust backend API.\n\n## 🚀 Features\n\n- **🔐 Secure CMS Interface** - Directus-powered content management\n- **📊 Data Management** - Manage pools, tokens, and wallets through intuitive forms\n- **🌐 RESTful API** - TypeScript backend with automatic authentication\n- **🐳 Docker Ready** - Complete containerized development environment\n- **🔄 Real-time Updates** - Changes in CMS instantly available via API\n- **🛡️ Security First** - Helmet middleware and CORS protection\n\n## ��️ Architecture\n```\n\n┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐\n│   Directus CMS  │    │  Backend API    │    │   Frontend      │\n│   (Port 8055)   │◄──►│  (Port 3001)    │◄──►│  (Port 3000)    │\n└─────────────────┘    └─────────────────┘    └─────────────────┘\n         │                       │                       │\n         ▼                       ▼                       ▼\n┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐\n│   PostgreSQL    │    │   Redis Cache   │    │   React App     │\n│   (Port 5432)   │    │   (Port 6379)   │    │   (Demo UI)     │\n└─────────────────┘    └─────────────────┘    └─────────────────┘\n```\n\n## 🔄 Workflow\n\n### 1. **Content Management**\n   - **User** log into Directus CMS\n   - **Add/Edit** pools, custom tokens, and wallets\n   - **Data saved** to PostgreSQL database\n\n### 2. **API Layer**\n   - **Backend** automatically authenticates with Directus\n   - **Fetches data** via Directus API\n   - **Applies business logic** if needed\n   - **Serves data** to frontend applications\n\n### 3. **Data Consumption**\n   - **Frontend apps** call backend API\n   - **Real-time data** from CMS\n   - **Instant updates** when content changes\n\n## 🛠️ Tech Stack\n\n### **Backend**\n- **Runtime**: Node.js with TypeScript\n- **Framework**: Express.js\n- **Security**: Helmet, CORS\n- **Database**: PostgreSQL (via Directus)\n- **Cache**: Redis\n- **Authentication**: Directus JWT tokens\n\n### **CMS**\n- **Platform**: Directus (Headless CMS)\n- **Interface**: Modern web-based admin panel\n- **Database**: PostgreSQL\n- **Authentication**: Built-in user management\n\n### **Infrastructure**\n- **Containerization**: Docker \u0026 Docker Compose\n- **Database**: PostgreSQL 15\n- **Cache**: Redis 7\n- **Networking**: Custom bridge network\n\n## 📋 Prerequisites\n\n- **Docker** (version 20.10+)\n- **Docker Compose** (version 2.0+)\n- **Node.js** (version 18+)\n- **npm** or **yarn**\n\n##  Quick Start\n\n### 1. **Clone the Repository**\n```bash\ngit clone https://github.com/NishantCoder108/cms-for-pool\ncd cms-for-pool\n```\n\n### 2. **Start the CMS Services**\n```bash\ncd cms\ndocker-compose up -d\n```\n\n### 3. **Set Up Backend**\n```bash\ncd backend\nnpm install\nnpm run dev\n```\n\n### 4. **Access Your Services**\n- **CMS Interface**: http://localhost:8055\n- **Backend API**: http://localhost:3001\n- **Database**: localhost:5432\n\n##  Configuration\n\n### **Environment Variables**\n\nCreate `.env` file in the backend directory:\n\n```env\nDIRECTUS_URL=http://localhost:8055\nDIRECTUS_ADMIN_EMAIL=admin@darklake.fi\nDIRECTUS_ADMIN_PASSWORD=admin\nPORT=3001\nNODE_ENV=development\n```\n\n### **CMS Setup**\n\n1. **Login to Directus**: `admin@darklake.fi` / `admin`\n2. **Create Collections**:\n   - `pools` - For managing trading pools\n   - `custom_tokens` - For custom token data\n   - `wallets` - For wallet management\n\n##  API Endpoints\n\n### **Health Check**\n```http\nGET /health\n```\n\n### **Pools Management**\n```http\nGET /api/pools          # Get all pools\nGET /api/pools/:id      # Get specific pool\n```\n\n### **Custom Tokens**\n```http\nGET /api/tokens         # Get all tokens\nGET /api/tokens/:id     # Get specific token\n```\n\n### **Wallets**\n```http\nGET /api/wallets        # Get all wallets\nGET /api/wallets/:id    # Get specific wallet\n```\n\n## 🧪 Testing\n\n### **Test Commands**\n```bash\n# Test backend health\ncurl http://localhost:3001/health\n```\n\n### pools API\ncurl http://localhost:3001/api/pools\n```json\n[\n    {\n        \"id\": \"4415777a-d727-42cc-8f94-a105e0a33bf1\",\n        \"Name\": \"JPool\",\n        \"Description\": \"High-yield staking with liquid JSOL, optional MEV\",\n        \"Chain\": \"SOL\",\n        \"Address\": null,\n        \"Pool_Type\": \"Liquid + Direct Staking\",\n        \"TVL\": \"8000004\",\n        \"APY\": \"7700000\"\n    },\n    {\n        \"id\": \"59ce182b-c031-4a59-ab14-99c14882ce18\",\n        \"Name\": \"DXDY-DXL Pool\",\n        \"Description\": \" Pool High liquidity pool for swapping DXDY and DXL on Solana.\",\n        \"Chain\": \"SOL\",\n        \"Address\": \"mSoLUSdC1234567890ExampleAddress\",\n        \"Pool_Type\": \"Liquidity Pool\",\n        \"TVL\": \"1500000\",\n        \"APY\": \"12200000\"\n    },\n]\n\n```\n\n\n###  tokens API\ncurl http://localhost:3001/api/tokens\n\n```json\n\n[\n    {\n        \"id\": \"592e85e4-a722-40e8-8475-c0658e3d84be\",\n        \"Name\": \"Darklake Staking Token\",\n        \"Symbol\": \"DLST\",\n        \"Address\": \"0xabcdef1234567890abcdef1234567890abcdef12\",\n        \"Chain\": \"ETH\",\n        \"Decimals\": 9,\n        \"Logo_URL\": \"https://beta.darklake.fi/image/dlst.png\",\n        \"Website\": \"https://beta.darklake.fi\"\n    }\n]\n\n```\n\n\n### wallets API\ncurl http://localhost:3001/api/wallets\n\n```json\n  {\n        \"id\": \"951b7755-277e-47c8-abc1-98b584bd47bd\",\n        \"Name\": \"Marketing \u0026 Partnerships\",\n        \"Address\": \"0xabcdef1234567890abcdef1234567890abcdef34\",\n        \"Chain\": \"ETH\",\n        \"Description\": \"Wallet for marketing expenses and partnership payments\",\n        \"Wallet_Type\": \"Operations\",\n        \"Contract_Balance\": 75000,\n        \"tags\": [\n            \"low-risk\",\n            \"ethereum\"\n        ]\n    }\n\n```\n\n\n\n\n## 🔐 Authentication\n\nThe system uses **automatic authentication**:\n\n- **Backend** automatically logs into Directus\n- **JWT tokens** are managed transparently\n- **Token refresh** happens automatically on expiry\n- **No manual token management** required\n\n## 🐳 Docker Services\n\n### **Service Overview**\n```yaml\nservices:\n  postgres:     # PostgreSQL database\n  directus:     # CMS platform\n  redis:        # Caching layer\n  backend:      # API server\n  frontend:     # Demo interface\n```\n\n### **Port Mapping**\n- **8055**: Directus CMS\n- **3001**: Backend API\n- **5432**: PostgreSQL\n- **6379**: Redis\n\n## 📈 Development Workflow\n\n### **1. Content Creation**\n```mermaid\ngraph LR\n    A[User Login] --\u003e B[Create/Edit Content]\n    B --\u003e C[Save to Database]\n    C --\u003e D[Data Available via API]\n```\n\n### **2. API Consumption**\n```mermaid\ngraph LR\n    A[Frontend Request] --\u003e B[Backend API]\n    B --\u003e C[Directus Authentication]\n    C --\u003e D[Database Query]\n    D --\u003e E[Response to Frontend]\n```\n\n##  Deployment\n\n### **Development**\n```bash\n# For CMS run\ndocker-compose up -d\n\n# For CMS stop\ndocker-compose down \n\nnpm run dev\n```\n\n\n## 🤝 Contributing\n\n### **Development Setup**\n1. Fork the repository\n2. Create feature branch\n3. Make changes with tests\n4. Submit pull request\n\n### **Code Standards**\n- Follow TypeScript best practices\n- Use consistent formatting\n- Add proper error handling\n- Include API documentation\n---\nBuilt with ❤️ by the Nishant\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnishantcoder108%2Fcms-for-pool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnishantcoder108%2Fcms-for-pool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnishantcoder108%2Fcms-for-pool/lists"}