In order to run the app locally you need to have a running local Frontend in one terminal and a running local Backend in another terminal. Currently we are using one DB (mongo) for prod and dev until we'll have a credit to have another one. (mongodb+srv://haytiSham_db:sDjE4PezjPl26wNs@cluster0.zzyhy.mongodb.net/haytiSham)
- Each UI change should be aligned with the mock.
- Each new string in the UI should be added to
lang-he.js
file and used withreact-18next
library.- For example, search for
t('iHaveBeenThereHashtag')
.
- For example, search for
- Re-use existing strings from the
lang-he.js
file.
- Node ^12
- NPM ^6
First, install all Frontend dependencies:
npm install
Run in locally with webpack-dev-server (FE)
npm run start:dev
Run in build with webbpack (FE)
npm start
Fix lint (FE)
npm run lint:fix
- Prerequisite
- Node & NPM check your installed node in command line 'node –v' check your installed npm in command line 'npm -v' https://nodejs.org/en/download/
- Install dependencies
cd server_api
npm i
- Runing the server
npm start
- Runing the server for dev
npm start dev
- Basic test http://localhost:5000/api/status
- This application is deployed using Heroku: https://haytisham.herokuapp.com/
Specified here, made by Lishay Noam: https://www.figma.com/file/UcF9E1rT6rwKIQkkLD5EqN/hayiti_sham?node-id=446%3A286
no parameters return a static list of tags (string)
no parameters return a static map of tags (number - string)
return a list of moderated stories for an anonymous user
parametesr:
- tags (optional) - array of tags numbers, default all tags
- page (optional) - page number, default 1
- pageSize (optional) - page size number, default 100
- sortField (optional) - string , default sequence
- sortDirection (optional) - string , default DESC
add an original story (added by an anonymous user) this story will not be automatic published (only moderated stories are visible)
parametesr:
- whatTriggeredChange (string)
- howDidYouManged (string)
- additionalnfo (string)
- whatHelpedYou (string)
- background (string)
- storyContent (string)
- mail (string)
- name (string)
- contact (boolean) default false
parametesr:
- userName
- password
For successful login the API return status 200 and JWT token This token should be sent as part of all the admin moderator requests
require the authentication token return list of original stories that were not moderated yet
parametesr:
- page (optional) - page number, default 1
- pageSize (optional) - page size number, default 100
- sortField (optional) - string , default sequence
- sortDirection (optional) - string , default DESC
require the authentication token
parametesr:
- originalStory (string) - original story id
- moderatedStory (string) - moderated stroy id
The API accepts originalStory or moderatedStory, at least one of them should be provided return: The API returns the original story and matched the moderated story { originalStory, moderatedStory }
require the authentication token add or edit a moderated story
parametesr:
- whatTriggeredChange (string)
- howDidYouManged (string)
- additionalnfo (string)
- quote (string)
- whatHelpedYou (string)
- background (string)
- storyContent (string)
- publish (boolean), default true
- originalStory (string)
- tags (numbers array)
require the authentication token publish or unpublish moderated story
parametesr:
- moderatedStory (string)
- publish (boolean)
Collections:
- counter - index counters for stories
- original_stories - original stories (as submitted by users) - these stories are visible only for the admin
- moderated_stories - moderated stories changed by admin - these stories are visible on the site
- users - admin users