Code Monkey home page Code Monkey logo

chingu-trivia's Introduction

🌻 Chingu Trivia

Welcome to the Chingu Trivia πŸš€, a web application built with the MERN (MongoDB, Express.js, React, Node.js) stack! This app allows users to engage in trivia quizzes across three categories: HTML, CSS, and JavaScript. The app includes user authentication using JSON Web Tokens (JWT) for secure login and score-saving and fetching capabilities.

🎯 Note: You don't need to signup/login to take the quiz. However to fetch and save scores, signing up is necessary.

πŸ“· Screenshots :

Girl.mp4

πŸš€ Features

  • Authentication with JWT: Securely authenticate users to save and fetch scores.
  • Score Saving and Fetching: Track your progress and get your latest score.
  • Three Quiz Categories: Choose from HTML, CSS, and JavaScript quizzes.
  • Lottie Animations: Elevate the user experience with engaging animations.
  • Responsive Design: Enjoy seamless gameplay across devices.

Tech Stack πŸ› οΈ

  • MongoDB: For storing user data and scores.
  • Express.js: Backend framework for building robust APIs.
  • React: Frontend library for a dynamic and interactive UI.
  • Node.js: Server-side JavaScript for handling requests.
  • JWT (JSON Web Tokens): Ensures secure authentication.
  • Lottie Animations: Add flair with dynamic animations.

✨ Getting Started:

  1. Clone the Repository:
    git clone https://github.com/Sushmita-Ghosh/chingu-trivia.git
  2. Install Dependencies for both frontend & backend:
 cd frontend
 npm install
 
 cd backend
 npm install
  1. Set Variables in the config.js in backend folder:
    MONGO_URI = Create a cluster in mongodb and we need to provide the url here
    SECRET_KEY= Put any string here
    
    After updation it should look something like this:
    MONGO_URI = "mongodb+srv://<username>:<password>@cluster0.cnjhdht.mongodb.net/chinguusers";
     SECRET_KEY = "mySecret";
  2. Launch frontend & backend in two different terminal:
    cd frontend --> do this in terminal 1
    npm run dev
    
    cd backend   --> do this in terminal 2
    npm run start

πŸ’‘ Future Enhancements:

  • Need to add the logout functionality. (Currently the token expires in 24hrs but we have removed it from localhost manually).
  • Currently the flow is dependent on signup for the username field, so the user would have to sign up for the username to be accessed. Need to add logic for fetching usernames for all signed-up users who are directly logging in.
  • Want to include tests with React Testing Library and Jest.
  • Further refactoring of code.

🌻 Deployment:

  • Used Render for web service/api deployment.
  • Used Netlify for the frontend development
  • The project is available here✨.

πŸ“ Folder Structure:

chingu-trivia/
|-- frontend/
|   |-- src/
|       |-- components/
|       |-- assets/
|       |-- context/
|       |-- constants/
|       |-- App.jsx
|       |-- main.jsx
|   |-- package.json
|
|-- backend/
|   |-- controllers/
|   |-- models/
|   |-- routes/
|   |-- config/
|   |-- middlewares/
|   |-- service/
|   |-- connectDB.js
|   |-- index.js
|   |-- package.json
|
|-- .gitignore
|-- README.md

chingu-trivia's People

Contributors

sushmita-ghosh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.