A platform where developers can share API/module recommendations and earn revenue based on engagement.
- User Authentication: Register/login with JWT-based authentication
- Post Management: Create, edit, and manage API/module recommendation posts
- AI-Powered Search: OpenAI-enhanced search functionality
- Revenue Tracking: Google Ads integration with earnings calculation
- Click Analytics: Track post engagement and performance
- Pro API Access: External API for programmatic access (subscription-based)
- Admin Panel: Content and user management
- Node.js with TypeScript
- Express.js
- MySQL with mysql2
- JWT for authentication
- OpenAI API for enhanced search
- bcrypt for password hashing
- React with TypeScript
- React Router for navigation
- Tailwind CSS for styling
- Axios for API calls
- Node.js (v16 or higher)
- MySQL (v8.0 or higher)
- OpenAI API key (optional, for enhanced search)
- Google Ads credentials (optional, for revenue tracking)
- Clone and install dependencies:
npm run install-all- Set up the database:
# Create MySQL database and run the schema
mysql -u root -p < server/src/models/database.sql- Configure environment variables:
# Copy the example env file
cp server/.env.example server/.env
# Edit server/.env with your configuration:
PORT=5000
JWT_SECRET=your-very-secure-jwt-secret-key-here
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=your-mysql-password
DB_NAME=resourcer
OPENAI_API_KEY=your-openai-api-key (optional)
GOOGLE_ADS_CLIENT_ID=your-google-ads-client-id (optional)
GOOGLE_ADS_CLIENT_SECRET=your-google-ads-client-secret (optional)
GOOGLE_ADS_DEVELOPER_TOKEN=your-google-ads-developer-token (optional)Start both client and server:
npm startThis will run:
- Backend server on http://localhost:5000
- Frontend client on http://localhost:3000
Or run separately:
# Start only the server
npm run server
# Start only the client (in another terminal)
npm run client- User accounts with authentication
- Subscription types (free/pro)
- Total earnings tracking
- API/module recommendations
- Tags, work environment, APIs/modules
- Click counts and earnings
- Post clicks tracking
- Search queries logging
- Earnings calculation
- Pro subscription API usage tracking
- Rate limiting per subscription tier
POST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/verify- Token verification
GET /api/posts- Get all published postsGET /api/posts/:id- Get single postPOST /api/posts- Create new post (auth required)PUT /api/posts/:id- Update post (auth required)DELETE /api/posts/:id- Delete post (auth required)POST /api/posts/:id/click- Track post click
POST /api/search- Search posts with OpenAI enhancement
GET /api/user/profile- Get user profile (auth required)GET /api/user/posts- Get user's posts (auth required)GET /api/user/earnings- Get user's earnings (auth required)
POST /api/external/search- External API search (pro auth required)GET /api/external/usage- API usage statistics (pro auth required)
POST /api/admin/process-earnings- Process earnings (admin only)GET /api/admin/stats- Get admin statistics (admin only)GET /api/admin/users- Get all users (admin only)PUT /api/admin/posts/:id/status- Manage post status (admin only)
- 70% of ad revenue from their posts
- Minimum 100 clicks required for earnings
- Monthly payouts for eligible creators
- 30% platform fee from ad revenue
- Pro subscription fees for API access
- Google Ads integration for revenue tracking
resourcer/
├── client/ # React frontend
│ ├── src/
│ │ ├── components/ # Reusable components
│ │ ├── pages/ # Page components
│ │ ├── services/ # API services
│ │ ├── types/ # TypeScript types
│ │ └── utils/ # Utility functions
├── server/ # Node.js backend
│ ├── src/
│ │ ├── middleware/ # Express middleware
│ │ ├── models/ # Database models
│ │ ├── routes/ # API routes
│ │ └── utils/ # Utility functions
└── package.json # Root package.json
- Update database schema if needed
- Add/update API routes in server/src/routes/
- Update TypeScript types in client/src/types/
- Add frontend components and pages
- Test the complete flow
- Set up production MySQL database
- Configure environment variables for production
- Set up Google Ads account and get credentials
- Get OpenAI API key for search enhancement
# Build the client
cd client && npm run build
# Deploy server with PM2 or similar
cd server && npm run build- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.# Resourcer