Analytics perform app. Both Tracker and Rest API implementations included in this repository.
npm install
npm run dev
npm run build
npm run start
<script src="https://try-analytics-tracker.herokuapp.com/try-analytics.min.js"></script>
<!-- Initialize -->
<script>
tryAnalytics('Token-XXXX');
</script>
API URL: https://try-analytics-tracker.herokuapp.com/
Method | Endpoint | Return |
---|---|---|
GET | /api/getResult?token=Token-123&url=https://myilmaz.net | JSON |
Method | Endpoint | Body | Return |
---|---|---|---|
POST | /api/saveResult | JSON | JSON |
- Promises are widely used to handle async operations.
- A separate serverConnectors layer is designed to manage the communication with API. If communication protocol changes in feature (like moving to webSocket) only serverConnector classes will be effected. The rest of the implementation will remain same.
- Used environment variables
- A simple http server implementation is done with nodejs and express.
- API and Data Management designed and separated for future implementation
- Used environment variables
- mongoose library used for MongoDB connection
- dotenv library used for environment variables
- It may separate router
- Model-View-Controller structure should be implemented
- Token validation should be implemented
- New endpoints should be implemented (Ex: /getResultByDomain, /getResultByToken)