Skip to content

Latest commit

 

History

History
83 lines (68 loc) · 4.6 KB

README-ENGLISH.md

File metadata and controls

83 lines (68 loc) · 4.6 KB

icon
QuizSphere

Create public or private quizzes, favorite the best ones and share them with your friends.

-App link in the PlayStore: https://play.google.com/store/apps/details?id=com.gust4
-Youtube link showing the app: https://www.youtube.com/watch?v=bO2aJ0DFudk
-Server link hosted in Heroku: https://quiz-sphere-backend.herokuapp.com

📜 About

This project contains the backend from the QuizSphere application (frontend mobile code: https://github.com/Gust4voSales/QuizSphere-Cliente). The app was developed with the objective of gaining experience and knowledge using updated technologies. QuizSphere is a mix of a quiz game and social networking features.

What the app does/allows:

  • Play quizzes;
  • You can create quiz games that can be either public or private (only the author from the quiz or whomever has received the private quiz can play it);
  • Search for quizzes;
  • Evaluate quizzes with likes;
  • Add/remove a quiz from your favorites' list
  • Add friends;
  • Share quiz with your friends;
  • Receive real-time notifications in the app whenever a user accepts your friends invitations or when someone shares a quiz with you;

🧩 Server routes

Route HTTP method Function Requires authentication
/users/register POST Creates a new user No
/auth/login POST Performs user login returning an authentication Token if success No
/users/:id GET Returns a single user information Yes
/quiz/create POST Creates a new quiz Yes
/quiz/show/:id GET Receives the quiz ID and returns its data Yes
/quiz/list GET Returns the quiz list, filters can be added Yes
/quiz/saved/add/:quizId POST Add a quiz to user's liked quizzes list Yes
/quiz/saved/remove/:quizId DELETE Remove a quiz from user's liked quizzes list Yes
/quiz/saved GET Returns the user's favorite quizzes list Yes
/quiz/:quizId/like POST Likes a quiz Yes
/quiz/:quizId/dislike DELETE Dislikes a quiz Yes
/quiz/share/:quizId POST Shares a quiz with a friend Yes
/quiz/received GET Returns the received quizzes list Yes
/friends GET Returns the user's friends list Yes
/friends/pendingInvitations GET Returns the user's pending friendship requests Yes
/friends/add?userName= POST Add some user as a friend Yes
/friends/accept/:recipientId POST Accepts a friendship request Yes
/friends/decline/:recipientId DELETE Decline a friendship request Yes
/friends/remove/:relationId DELETE Remove a user from user's friends list Yes
/notifications GET Returns user's notifications list Yes
/notifications/setasread PUT Updates the received notifications as “seen” Yes

If you want to test the API without a front-end client you can use Insomnia. Import the workspace with one click!

Run in Insomnia

⚙ Features

  • Node Js — An asynchronous event-driven JavaScript runtime
  • Express — A Node.js framework that allows an easy way to develop web applications
  • MongoDB — Non-relation database
  • Mongoose — A library that provides a schema-based solution to model your application data with MongoDB
  • SocketIO — Socket.IO enables real-time, bidirectional and event-based communication.
  • JSON Web Tokens — It's a technique for remote authentication between two parts and it's one of the most used strategies to authenticate users in APIs RESTful

🛠 Getting started

  1. Clone this repo running on your terminal git clone https://github.com/Gust4voSales/QuizSphere-Backend.git
  2. Inside the project's folder run yarn to install all dependencies
  3. Create the application's database using MongoAtlas platform (follow this tutorial: https://medium.com/@sergio13prez/connecting-to-mongodb-atlas-d1381f184369)
  4. Create a .env file based on the .env.example
  5. Fill the .env file adding the MongoAtlas connection URL generated on the previous step and the others fields as well
  6. Lastly, yarn dev to start the server

App development page on Trello - https://trello.com/b/niEoJsnl/quizspher