To see Live preview click : Fin-Quest
If the error: Port already in use occur, run this
npx kill-port 5173
- Change the port you want to kill, here it is default as 5173
-
Initialize Project:
- Clone the project directory:
git clone https://github.com/Clusters-Config/Fin-Quest - Navigate into it:
cd Fin-Questcd frontend
- Clone the project directory:
-
Backend (Node.js/Express.js):
- Install dependencies:
npm install- express: Web framework.
- mongoose: MongoDB object modeling.
- cors: Enable Cross-Origin Resource Sharing.
- body-parser: Parse request bodies.
- dotenv: Load environment variables.
- jsonwebtoken: For authentication (JWT).
- bcryptjs: For password hashing.
- node For the runtime
- nodemon For Continous Running
- Install dependencies:
-
Frontend (React):
- Create React app:
npx create-react-app frontend - Navigate into the client directory:
cd frontend - Install dependencies:
npm install axios react-router-dom- axios: For making HTTP requests.
- react-router-dom: For routing.
- Create React app:
-
Project Structure:
Fin-quest/ ├── frontend/ # React frontend │ ├── public/ │ └── src/ │ ├── components/ │ ├── pages/ │ ├── service/ │ ├── App.js │ └── ... ├── backend/ # Node.js/Express backend │ ├── models/ │ ├── routes/ │ ├── config/ │ ├── index.js │ └── ... └── .env # Environment variables
- Database (MongoDB):
- Set up a MongoDB database (MongoDB Atlas is a good option).
- Create a
.envfile in the server directory and add your MongoDB connection URI:MONGODB_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/<database>?retryWrites=true&w=majority PORT=5000 JWT_SECRET=your_jwt_secret
- Models (models/):
- Create Mongoose models for users data and details
Create Schemas as per the models required
- Routes (routes/):
- Create routes for user authentication (register, login), profile, learning path.
- Use JWT for authentication.
- Example (routes/auth.js):
const express = require('express');
const router = express.Router();
// ... imports
router.post('/register', async (req, res) => { /* ... registration logic (hashing password, saving user) */ });
router.post('/login', async (req, res) => { /* ... login logic (comparing passwords, generating JWT) */ });
// ... other routes
module.exports = router;
- Server Setup (index.js):
const express = require('express');
const mongoose = require('mongoose');
const cors = require('cors');
require('dotenv').config();
const authRoutes = require('./routes/auth'); // Import routes
const app = express();
app.use(cors());
app.use(express.json());
mongoose.connect(process.env.MONGODB_URI, {
useNewUrlParser: true,
useUnifiedTopology: true,
}).then(() => console.log("Connected to DB")).catch(console.error);
app.use('/api/auth', authRoutes); // Use routes
const PORT = process.env.PORT || 5000;
app.listen(PORT, () => console.log(`Server running on port ${PORT}`));
- Components (components/):
- Create React components for:
- Login/Registration forms.
- User profiles (displaying user info).
- Personalized Learning Path
- Gamification Adventure
- Real World Simulation
- AI - Driven Insights
- Community Engagement
- Finflux
- Finance Forums
- Financial Assistant
- Side Hustlers
- Routing:
- Use
react-router-domto handle navigation between different pages.
- API Calls:
- Use
axiosto make API requests to the backend. - Example:
import axios from 'axios';
const loginUser = async (userData) => {
try {
const response = await axios.post('/api/auth/login', userData);
// ... handle response (store token, redirect)
} catch (error) {
// ... handle error
}
};
- State Management:
- Use React's
useStateanduseEffecthooks, or a state management library like Redux or Context API for more complex applications.
- Gamified Modules: Interactive games and quizzes to teach budgeting, saving, and investments.
- Real-World Simulations: Virtual bank accounts, loan calculators, and market simulators.
- AI Personalization: Tailored learning paths and an AI mentor for guidance.
- Social Features: Leaderboards, group challenges, and community forums for collaborative learning.
- Multimedia Tools: Videos, infographics, and animations for engaging financial concepts.
- Backend: Deploying Node.js/Express.js backend to a Render.
- Frontend: Build the React app (
npm run buildin the client directory) and deploy the static files to a platform Render.
This detailed breakdown should give you a solid foundation for building your FinQuest. Remember to break down the project into smaller, manageable tasks and test your code thoroughly throughout the development process.
- Badri Narayanan
- Damodara Prakash
- Gowri
- Gopika
- Atshaya III Year CSE - Knowledge Institute of Technology , Salem