Skip to content

Instantly share code, notes, and snippets.

View Abhijit47's full-sized avatar
🎯
Focusing

Abhijit Abhijit47

🎯
Focusing
View GitHub Profile
@Abhijit47
Abhijit47 / CourseModel.js
Created September 13, 2023 09:05
Course Model
const mongoose = require("mongoose");
const { Schema } = mongoose;
// define a course schema
const courseSchema = new Schema({
name: {
type: String,
required: true,
},
description: {
@Abhijit47
Abhijit47 / UserProfile.jsx
Created August 22, 2023 11:26
insta userProfile frontend
import React, { useEffect, useState } from 'react';
import axios from 'axios';
import { useParams } from 'react-router-dom';
import { toast } from 'react-toastify';
import './UserProfile.css';
const UserProfile = () => {
const [userData, setUserData] = useState({});
const [postData, setPostData] = useState([]);
const [isLoading, setIsLoading] = useState(false);
@Abhijit47
Abhijit47 / userController.js
Created August 4, 2023 13:34
instaAPI User Controller
const bcrypt = require('bcrypt');
const User = require('../models/userModel');
const { successResponse, errorResponse, createToken } = require('../utilities/utils');
const { signUpValidation, signInValidation } = require('../validator/userValidator');
const signUp = async (req, res, next) => {
try {
// 1. Get data from req.body
const { name, email, password } = req.body;
@Abhijit47
Abhijit47 / User.js
Created June 27, 2023 14:46
Login-Registration API with Mongoose in CJS
const mongoose = require('mongoose');
// Define a schema
const userSchema = new mongoose.Schema({
name: {
type: String,
required: [true, 'name field should not be empty'],
minLength: 4,
maxLength: 30,
lowercase: true,
@Abhijit47
Abhijit47 / server.js
Created June 26, 2023 14:35
Login-Registration API
/**
* Write API for Registration adn Login page of the application.
1.create a registration
name
email
age
password:
2.create a sigin and verify that if user is there database login to website
@Abhijit47
Abhijit47 / server.js
Created June 26, 2023 11:21
room_booking_API
import dotenv from 'dotenv';
dotenv.config();
import express from 'express';
import cors from 'cors';
import { BSON, MongoClient } from 'mongodb';
const MONGO_URL = process.env.DATABASE_URI;
const MONGO_PASSWORD = process.env.DATABASE_PASSWORD;
const PORT = 9999 || process.env.PORT;
// Initiate app
flipkart> db.users.find()
[
{
_id: ObjectId("649588837ef25cfc573be8ab"),
name: 'Vicki Lakin',
email: 'Xzavier_Hauck14@hotmail.com',
address: 'Estonia',
password: 'n95mt3468ZzAIwu'
},
{
@Abhijit47
Abhijit47 / employe.sql
Created June 22, 2023 14:56
MySQL Home task
use employeedb;
show tables;
show table status;
-- Create table into db
create table employee(
id int unsigned not null auto_increment,
username varchar(30) not null,
age int unsigned not null,
@Abhijit47
Abhijit47 / attendence_and_tasks
Last active June 21, 2023 14:41
DB Smaple Dataset
[
{
"name": "Grant Barton",
"attendence": true,
"task_completed": true,
"date_from": "2023-06-20T19:14:05.182Z",
"date_to": "2023-08-04T06:12:13.144Z",
"id": "1"
},
{
@Abhijit47
Abhijit47 / data.json
Created June 12, 2023 06:37
Table data
[
{
"id": 1,
"Name": "Tiger Nixon",
"Position": "System Architect",
"Office": "Edinburgh",
"Age": 61,
"StartDate": "2011/04/25",
"Salary": "$320,800"
},