-
Notifications
You must be signed in to change notification settings - Fork 3
Backend Code Conventions
Alper Canberk Balcı edited this page Oct 31, 2022
·
7 revisions
- New functionalities and features must come with unit tests.
- A good unit test should:
- focus on a single use-case at a time
- have a minimal set of assertions per test
- demonstrate every possibility. The rule of thumb is: if it can happen, it should be covered
- Documentation before the implementation of an API is a good practice.
- We are now putting them on the Sidebar under API Documentations.
- Later we will try and use Swagger, too.
- We use snake_case in function and variable names.
- We use PascalCase in class names.
- Separation of functions: A function must do one specific thing.
- Separation of modules/things: Different features must be under different classes/functions/places, or folders.
We may not encounter with hackers for this project. But knowing the HTTP error codes to facilitate troubleshooting might be nice, so here is a table.
Error Code | Title | Description |
200 | OK | Standard response for successful HTTP requests. The actual response will depend on the used. In a GET request, the response will contain an entity corresponding to the requested resource. In a POST request, the response will contain an entity describing or containing the result of the action. |
400 | Bad Request | The server cannot or will not process the request due to something that is perceived to be a client error. |
401 | Unauthorized | Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. |
403 | Forbidden | User not having the necessary permissions for a resource or needing an account of some sort, or attempting a prohibited action. |
404 | Not Found | The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible. |
500 | Internal Server Error | the server encountered an unexpected condition that prevented it from fulfilling the request. |
- Health checks help with monitoring the uptime of your service so that you can resolve issues quickly and mitigate the impact before it prolongs.
- We should have health checks and maybe later logging.
- Comments should be written in a new line under the code line we comment on.
- Comments should start with a blank space " " as we write Python code, it is usual.
- Comments should start with capital letters.
- Comments should end with a ".".
🏠 Homepage
- Alper Canberk Balcı
- Baver Bengin Beştaş
- Burak Mert
- Halil Burak Pala
- Kardelen Demiral
- Sinan Kerem Gündüz
- Yavuz Samet Topçuoğlu
- Mehmet Emre Akbulut
- Oğuzhan Demirel
- Engin Oğuzhan Şenol
- Irfan Bozkurt
- Ozan Kılıç
Meeting Notes From CMPE352
Meeting Notes From CMPE451
- Meeting 13.1
- Meeting 14.1
- Meeting 15.1
- Meeting 16.1
- Meeting 18.1
- Meeting 19.1
- Meeting 20.1
- Meeting 21.1
- Meeting 23.1
- Meeting 24.1
Backend Team Meetings
Frontend Team Meetings
Mobile Team Meetings
- Customer Meeting 1
- Customer Meeting 2
- Customer Meeting 3
- Customer Meeting 4
- Customer Meeting 5
- Milestone 1 Presentation Notes
- Milestone 2 Presentation Notes
- Milestone 3 Presentation Notes
Scenarios
- Scenario 1 for CMPE451:Milestone 1
- Scenario 2 for CMPE451:Milestone 1
- Scenario 1 for CMPE451:Milestone 2
- Scenario 2 for CMPE451:Milestone 2
- Scenario 3 for CMPE451:Milestone 2
- Scenario 1 for CMPE451:Final Milestone
- Scenario 2 for CMPE451:Final Milestone
- Scenario 1 for CMPE352
- Scenario 2 for CMPE352
- Scenario 3 for CMPE352