Skip to content

Instantly share code, notes, and snippets.

@saniyathossain
Last active February 2, 2022 07:06
Show Gist options
  • Save saniyathossain/32a43a35362afda00b5f10df0b8319ff to your computer and use it in GitHub Desktop.
Save saniyathossain/32a43a35362afda00b5f10df0b8319ff to your computer and use it in GitHub Desktop.
Stacks, Coding Guidelines, Acronyms
STACKS:
Project management: Agile, Scrum, JIRA (tool)
Version Control: GIT, Github (Repo), Gitlab (Repo), Bitbucket (Repo), Azure (Repo)
Back-end: PHP (MVC (Model View Controller): Laravel, CakePHP, Symphony, Codeigniter, YII, micro-framework: Lumen, Slim), CMS (Content Management System): Wordpress, Prestashop, Joomla, Magento, Opencart
ORM (Object Relational Mapping): Eloquent (Built in with laravel framework), CakePHP ORM (Built in with CakePHP framework), RedBeanPHP
PHP modules: PHP FPM, PHP CLI
Unit Test: PHPUnit, Codeception, PEST (framework)
Async PHP: Swoole, ReactPHP, Laravel Octane
Cache: File, Memcache, Redis, Database
Database: MySQL, MariaDB, Postgresql, MS SQL; NO-SQL: MongoDB, Cassandra
API: Rest, SOAP, GRPC, GraphQL
NODE JS: Typescript, Frameworks: Express JS, Nest JS
Front-end: Vue, Angular, ReactJS
CSS: Frameworks: Tailwind, Bootstrap
Devops: Docker, Kubernetes
Monitoring: Grafana, Prometheus
CI-CD: Jenkins Pipeline, Github Actions
TD-Agent: Fluentd - use case: transfer docker standard output (stdout, stderr) logs to elasticsearch
Search: Elasticsearch, Kibana
Queue: RabbitMQ, Redis
Storage: MinIO
Web Server: Nginx, Apache, supervisord
Server Maintainance: Housekeeping
Web Socket: Socket: use case: live notification, or similar thing like google maps vehicle movement show in realtime
Others: Queue, Cron job, Worker or Background services, Load Balancer (LB), Proxy Server, Reverse Proxy, Proxy-pass, Database Master Slave Concept, Redis Sentinel Concept, Redis search, Single Sign-on (SSO): for example: when you login to gmail, you don't need to login again in other google services like google drive, sheets, docs etc. multiple services uses single login
Coding guidelines:
IDE: VSCode, extensions: PHP intelliphense, PHP DocBlocker, Tabnine, PHPCS
Git Tool: Sublime Merge
Standards, detect code error: PSR12, sonarlint, PHPStan
Debugging Tool: clockwork package
Some tips: Cache DB Fallback when possible, Error handle: use try catch, manage throw exception, log properly, using queue events for async tasks like for example sending notification should be done using calling event, as it should be an asynchronus and non blocking (should not be blocked for any other task, error etc.) process.
Codes should be as much as possible at least for next tasks (if you have not followed these yet):
PHP
a. follow a design pattern based on project and context
b. use SOLID as much as possible
c. properly use OOP as much as possible
d. properly use Dependency injection or laravel service container (later on this would be very much helpful for unit testing, mocking etc.)
e. try to keep things simple and DRY (do not repeat yourself): using interface, abstract classes is usually very helpful, also some cases traits can be useful as well
f. try to keep things with context. for example query should be inside model, request filtering, authentication, authorization should be done in middleware, request validation should be done in a class (Laravel Form Request class), controllers should not contain much logic, controller should push codes to a service class, and service class should be responsible to hold business logic. inside codes directory/namsepaces should be managed by preferable design pattern for the project context.
g. similar or multiple used things can be kept in a library, again library can contain abstract class, and interfaces
h. should use newer versions for php and laravel and understand the new features of the latest php versions. for example php 7.4 supports type casting in function arguments, or return types, which is very useful and important and good practice. if iy can be done and managed properly debugging becomes easier.
i. for apis V1, V2 should be used in path like /v1/products and also in controller, services etc. and for responses transformer class or laravel api resource class can be used.
j. use clockwork package (in dev environment) to check query, performance, log, whenever needed query can be cached (not for all cases, depends on context).
DB query optimzations
a. use transaction for multiple insert, update, delete like queries.
b. use index in db tables: where is needed, on which column/s where query is widely used.
c. foreign key constraint use where needed.
d. avoid select * in query. instead use specific column names when possible.
e. try using limit, order by in query.
f. try avoiding '%term%' wildcard, instead try using 'term%' to use index in the field to be used in like query.
API
a. necessary http verbs used in rest api coummunication - GET, POST, PUT, PATCH, DELETE
b. difference and usage between PUT and PATCH verb
c. JWT based authentication: how does it works.
d. http commonly used headers meanings and usages: Cache-Control, Host, User-Agent, Authentication, Accept, Accept-Encoding, Accept-Language.
e. use cases of http status codes. 1xx series is used for information, 2xx series for success, 3xx series for redirection, 4xx series for client error, 5xx series for server error.
f. standard format of success, error, validation responses.
g. file upload with api.
Some acronyms we learned:
1. EOD: end of day.
2. EST: Estimation
3. FE: frontend
4. BE: backend
5. Technical Debt: sometimes we do some works, and keep some works (due to time shortage) like : we'll do them later, these works day by day increases and after a time become a huge pile of tasks. these are known as technical debts.
6. RCA: Root cause analysis: we need to give report for some cases of incident
7. CR: Change Request
8. PO: product owner: the owner of the product/project we work on. generally from business end.
9. CI-CD: continuous integration, continuous deployment
10. IPN: instant payment notification
11. UI: User Interface
12: UX: User Experience
13. SDK: Software Development Kit
14. JWT: JSON Web Token
15. JSON: Javascript Object Notation
16. SSO: Single Sign on
17. LDAP: Lightweight Directory Access Protocol
18. CSRF: Cross site request forgery
19. CORS: Cross-Origin Resource Sharing
20. UAT: User Acceptance Testing
21. SDLC: Software Development Life Cycle
22. REST: REpresentational State Transfer
23. SOAP: Simple Object Access Protocol
24. SAAS: Software as a Service
25. KPI: Key Performance Indicators
26. OPEX: Operational Expenditure
27. CAPEX: Capital Expenditure
28. WYSIWYG: What You See Is What You Get
29. TBD: To Be Determined
30. API: Application Programming Interface
31. SOLID: Single responsibility, Open-closed, Liskov substitution, Interface segregation, Dependency inversion
32. SIT: Systems Integration Testing
33. BRB: Be Right Back
34. TDD: Test Driven Development
35. UUID: Universally unique identifier
36. EOS: End Of Sprint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment