-
-
Notifications
You must be signed in to change notification settings - Fork 59
Developer Guide
We are editor and IDE agnostic in this project. You can use whatever editor or IDE you normally use. If you have not chosen a editor or IDE, we have Visual Studio and Visual Studio Code settings files included that will help you get going to work on this very easily.
- REACT 18.2
- MUI v5 (UI Library)
- NodeJS latest LTS
- Express 4
- SQLite 3
- Cypress
- Jest
- RTL
This app was bootstrapped with Create React App.
It is not hosted anywhere yet.
TODO: add coding style conventions:
- Think on current coding style conventions we've been following and add them here.
- Components that are intended to be used as reusable components should be named as
<Custom[ComponentName]>
so a reusable Alert component should be namedCustomAlert
. - We name component files the same as the components they represent with an
.jsx
extension soCustomAlert.jsx
.
- We name CSS files the same as the component they belong to so the CSS file for the
Post.jsx
component would bePost.css
. - We name CSS classes using the BEM naming convention in the following manner:
-
.Componenent__inner-element
: So that for thePost.css
the rule styling the close button would be written as.Post__close-button
.
-
- We name our database tables with singular and uppercase names:
User
,Post
,Event
,Friendship
, etc. - We name our database table fields camelcased:
date
,title
,locationName
,imageUrl
, etc.
- We name our routers
<[CRUD action of the router][modelName]Router>
when importing them on server/app.js. A router to add a new user post would be namedcreatePostRouter
. - The exception is with Read actions instead of calling a router say
readPostRouter
to get all user's posts, it would be namedgetPostRouter
so use get instead. - We create folders for different routes and give them model names:
/users
,/posts
,/events
, etc. - We names router files
<[CRUD action of the router][modelName]>.js
sogetPost.js
orcreatePost.js
orupdatePost.js
ordeletePost.js
.
- We name endpoints
/api/[modelName]/[:id] (in case id required)
so for Event models CRUD actions endpoints/api/event/:id
would be used.
-
We separate our test in 2 folders UI and API depending on the kind of test.
-
We name test files
<[(functionality|component)to test].cy.js>
so a test for Login User functionality test file would belogin-user.cy.js
and a test for Add Post functionality would beadd-post.cy.js
but a test for Create Post API endpoints would becreate-post.cy.js
. -
Test cases are named using the
"Verify behavior occurs"
naming convention. So:-
"Verify user stays logged in after page reload"
or -
"Verify user cannot login with invalid credentials"
or -
"Verify a post is created when submitting post form"
or "Verify a post is removed when clicking on the post's close button"
...are all valid names.
-