-
-
Notifications
You must be signed in to change notification settings - Fork 61
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 asPost__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 name test files
<[(functionality|component)to test][?-api].cy.js>
so a test for Login functionality test file would belogin.cy.js
and a test for Post functionality would bepost.cy.js
but a test for Post API endpoints would bepost-api.cy.js
. -
Test cases are named using the
"should do X when input Y"
naming convention. So"should login user when entering valid credentials"
for example.