Steve
U-Circle is a SPA based Progressive Web App which is built using MERN stack on top of React-Boilerplate. It is dedicated to providing a platform in XJTLU for answering your enquiries regarding academic studies and occupational queries. Users can share questions and answers with alumnus and students in XJTLU. The project is still under development and unfinished parts of it would be the future work of CSE208 group project.
- Open Terminal or Bash
git clone git@github.com:fuchenxu2008/U-Circle.git
to clone this repositorycd U-Circle
yarn
to install all NPM dependencies.yarn start
to start development server at port 3000.- Go to http://localhost:3000 to access the application locally.
Access online version at https://quora.kyrie.top
- Recieve HTTP request from user through API end point.
- Extract user ID and question ID to subscribe from request.
- Find that question record by the given question ID in the database.
- Check if subscribers property of the question object includes the given user ID already.
- If given user ID already exists, remove it from the list to unsubscribe.
- If not, add given user ID to the list of subscribers of the question to subscribe.
- Save the modified new question object back to the database.
- On successful save, send the updated question as response to front end.
- In case of any error, send errored response with status code 400 to front end.
- Recieve HTTP request from user search query through API end point.
- Extract type, major, keyword from request which refer to question properties.
- Escape search query's special characters to avoid Regex(Regular Expression) evaluation errors.
- If major or keyword appears to be empty, ignore it from search terms.
- Find the matching questions based on the search terms using Regex(Regular Expression).
- Send the result to user on success and error on failure.
- When user answer a question, construct a notification object including information of the answerer, the user or users to be notified and the related question.
- Pass the notification object and server websocket to the controller.
- Iterate the target users group, for each of the users, send them a notification through websocket and create a record in database with the notification object and intialize its property markRead as false.
- Find the notification model in database by given user ID and related question ID
- For each question found, modify its property markRead to true.
- Save the updated notification objects back to database.