Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<general_rules>
Always run the installscripts in numerical order (1-5) for deployment. Before any deployment, first execute `source installscripts/1.setVariable.sh` to set all required environment variables including OSE_DOMAIN, project names, Gmail credentials (FROM_GMAIL, FROM_GMAIL_PASSWORD), and Twitter API credentials (TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET, TWITTER_OAUTH_ACCESS_TOKEN, TWITTER_OAUTH_ACCESS_TOKEN_SECRET). When modifying service configurations, always check the corresponding service directory structure and ensure environment variables are properly configured for inter-service communication (USER_REG_SVC, TWITTER_FEED_SVC, EMAIL_APPLICATION_DOMAIN). Use OpenShift templates from .openshift_template/ directory for automated deployments. Before making changes to any service, verify the service is running and accessible via its exposed route. When adding new REST API endpoints, ensure CORS is properly configured for cross-service communication. Always test service connectivity after deployment using the exposed service URLs.
</general_rules>

<repository_structure>
This repository contains 4 polyglot microservices: nodejs-users-api (NodeJS backend with MongoDB for user registration, exposes REST APIs), python-email-api (Python email service with MySQL for email logging), java-twitter-feed-api (Java service with Tomcat for Twitter feed integration), and php-ui (PHP frontend that consumes the other services via REST APIs). The installscripts/ directory contains 5 numbered deployment scripts that must be run in order: 1.setVariable.sh (environment setup), 2.deployEmailSvc-PythonMySQL.sh (email service), 3.deployTwitter-Tomcat.sh (Twitter service), 4.deployUserRegBackend-NodejsMongo.sh (user registration backend), and 5.deployFrontend-PHP.sh (frontend). The .openshift_template/ directory contains OpenShift deployment templates (template.json, python.template, jboss_templates.json, tomcat_templates.json) for automated service deployment. Each service directory contains its own configuration files and dependencies, with services communicating via REST APIs using internal service names and exposed routes.
</repository_structure>

<dependencies_and_installation>
Each service uses its own package manager: nodejs-users-api uses npm with package.json (dependencies: express, mongoose, jsonwebtoken, cors, body-parser, morgan, request-json), python-email-api uses pip with requirements.txt (dependencies: email, falcon, gunicorn, PyMySQL), java-twitter-feed-api uses Maven with pom.xml (dependencies: Jersey, Twitter4J, Jackson, JUnit for testing), and php-ui has no package manager (contains 8 PHP files: index.php, login.php, register.php, profile.php, friends.php, tweets.php, hack.php, head.php plus script.js and style.css). Install dependencies by running the appropriate command in each service directory: `npm install` for NodeJS, `pip install -r requirements.txt` for Python, `mvn install` for Java. The PHP service requires no dependency installation as it uses standard PHP libraries.
</dependencies_and_installation>

<testing_instructions>
Limited testing framework is implemented - only nodejs-users-api/test.js exists (basic Express server test using sphp). No comprehensive test suites are available for other services. Test services by making REST API calls to their exposed endpoints after deployment. For integration testing, ensure all services are deployed with proper environment variables configured, then test the complete user flow: user registration via PHP frontend -> NodeJS backend -> email notification via Python service, and Twitter feed integration via Java service. Test service connectivity by accessing the exposed routes (use `oc get route` to find URLs). Verify database connections by checking service logs (`oc logs <service-name>`). For manual testing, use the PHP frontend at the exposed route to test the complete application workflow including user registration, login, and Twitter feed display.
</testing_instructions>