A full-stack application for managing and displaying different types of questions including MCQs, Anagrams, and Read Along exercises.
- Multiple question types (MCQ, Anagram, Read Along)
- Search functionality
- Real-time progress tracking
- User statistics
- Responsive design
- Frontend: React, styled-components, react-query
- Backend: Node.js, Express, MongoDB
- Database: MongoDB
- Node.js (v14 or higher)
- MongoDB (v4 or higher)
- npm or yarn
speakx/ ├── client/ # React frontend │ ├── public/ │ ├── src/ │ │ ├── components/ # React components │ │ ├── services/ # API services │ │ ├── styles/ # Global styles │ │ └── App.js # Main app component │ └── package.json ├── server/ # Node.js backend │ ├── src/ │ │ ├── models/ # Database models │ │ ├── routes/ # API routes │ │ └── index.js # Server entry point │ └── package.json └── package.json # Root package.json
-
Clone the Repository bash git clone https://github.com/yourusername/speakx.git cd speakx
-
Install Dependencies bash Install root dependencies npm install Install all dependencies (client and server) npm run install:all
-
Environment Setup Create
.envfiles in both client and server directories: For server (server/.env): env PORT=3001 MONGODB_URI=mongodb://localhost:27017/speakx NODE_ENV=development
For client (client/.env):
env
REACT_APP_API_URL=http://localhost:3001/api
-
Start MongoDB bash Start MongoDB service mongod
-
Import Sample Data bash From the server directory cd server npm run seed
- Development Mode Start all services (from root directory): bash npm start
Or start services separately: Terminal 1 (MongoDB): bash mongod
- Access the Application
- Frontend: http://localhost:3000
- Backend API: http://localhost:3001
- Search Questions bash POST /api/questions/search
Request body: json { "query": "string", "page": 1, "limit": 10, "type": "MCQ" }
- Get Question by ID bash GET /api/questions/:id
-
MCQ Question json { "type": "MCQ", "title": "Question text", "options": [ { "text": "Option 1", "isCorrectAnswer": true } ] }
-
Anagram Question json { "type": "ANAGRAM", "anagramType": "WORD", "blocks": [ { "text": "A",
-
MongoDB Connection Error bash Check MongoDB status mongo --eval "db.serverStatus()" Verify MongoDB service is running mongod
-
Node Modules Issues bash Clear node_modules and reinstall rm -rf node_modules npm cache clean --force npm install
-
Port Conflicts
- Check if ports 3000 or 3001 are in use
- Modify ports in .env files if needed
-
"Error loading questions":
- Check if the backend server is running
- Verify MongoDB connection
- Check browser console for specific errors
-
"MongoDB Connection Error":
- Verify MongoDB is running
- Check MONGODB_URI in server/.env
- Ensure MongoDB port (27017) is available
-
Fork the repository
-
Create your feature branch bash git checkout -b feature/AmazingFeature
-
Commit your changes bash git commit -m 'Add some AmazingFeature'
-
Push to the branch bash git push origin feature/AmazingFeature
-
Open a Pull Request
json { "start": "Starts both client and server", "install:all": "Installs all dependencies", "start:client": "Starts React client", "start:server": "Starts Node.js server" }
- MongoDB Compass - GUI for MongoDB
- Postman - API testing
- React Developer Tools - Browser extension
- Redux DevTools - State management debugging
This project is licensed under the MIT License - see the LICENSE file for details.