📜  oylar ingilizcha (1)

📅  最后修改于: 2023-12-03 15:18:11.169000             🧑  作者: Mango

Oylar Ingilizcha

Introduction

"Oylar Ingilizcha" is a web application for learning English words with their pronunciation and definitions. The app provides an interactive interface for users to learn and practice English words from different categories.

Features
  • User Authentication: Users can create an account and log in to access the app’s features.
  • Categories: The app has different categories such as animals, fruits, colors, etc., to help the users learn the words in a more structured way.
  • Pronunciation: Users can listen to the pronunciation of each word multiple times and practice their own pronunciation.
  • Definitions: The app provides the definition of each word to help users understand the meaning of the word in context.
  • Flashcards: Users can create flashcards from the words they have learned to revise and test their knowledge.
  • Progress Tracking: Users can track their progress and see how many words they have learned and how many they still need to learn.
Technologies
  • Front-end: HTML, CSS, JavaScript, React
  • Back-end: Node.js, Express
  • Database: MongoDB
  • Authentication: Passport.js
Example Code
const express = require('express');
const router = express.Router();
const Word = require('../models/word');
const { ensureAuthenticated } = require('../config/auth');

// Get all words from the database
router.get('/', ensureAuthenticated, async (req, res) => {
  try {
    const words = await Word.find({ user: req.user.id });
    res.render('words/index', { words });
  } catch (err) {
    console.error(err);
  }
});

// Add a new word to the database
router.post('/', ensureAuthenticated, async (req, res) => {
  const { name, category, pronunciation, definition } = req.body;
  const newWord = new Word({
    name,
    category,
    pronunciation,
    definition,
    user: req.user.id
  });
  try {
    await newWord.save();
    res.redirect('/words');
  } catch (err) {
    console.error(err);
  }
});
Conclusion

"Oylar Ingilizcha" is a great application for anyone who wants to learn English in a fun and interactive way. With its unique features and technologies, it provides a great learning experience for users of all levels.