Giter Site home page Giter Site logo

citricco_2's Introduction

Citricco Store

Components

citricco-app/
├── components
│   ├── layout
│   │	├── footer
│   │	│	└── Footer.js		
│   │	└── navbar
│   │  		└── Navbar.js
│   ├── pages
│   │	├── index
│   │	│	└── Index.js		
│   │	├── newProduct
│   │   │	└── NewProduct.js
│   │	├── productDetails
│   │	│	└── ProductDetails.js		
│   │	└── productList
│   │  		├── ProductCard.js
│   │		└── ProductList.js
│   ├── shared		

Endpoints table

Id Method Path Description
1 Get / Home
2 Get /products/all Listado de productos
3 Get / post /products/details/:id Detalles de cada producto
4 Get / Post /products/newProduct Crear producto
5 Get / post /collections/price=&color= Filtrado para búsqueda (hay que ver qué filtros poner)
6 Get /pages/about Sobre la tienda, productos y sus creadoras
7 Get /pages/contact Contacto
8 Get / post /account/login ? Cuenta de usuario y comprobación de login
9 Get/post /account/register Signup
10 Post /account/logout Logout
11 no lo sé /cart Carrito de compra

(podríamos añadir en alguna vista una barra simple de búsqueda con ajax)

Models

Earring

const ProductSchema = ... ({
		name: {
			type: String, 
			required: true,
			default: 'unknown'
			},
		price: {
			type: Number,
			required: true
		},
		quantity: {
    		type: Number,
    		default: 0 
    	},
		image: {
			type: String,
			default: 'algunaFotoRandom'
		},
		category: {
			type: [String],
			enum: ['no', 'se', 'bla', 'bla']
		},
		createdAt: {
    		type: Date, 
    		default: Date.now
		}

User

const userSchema = new Schema({
	username: {
		type: String
	},
	password: {
		type: String
	},
	role: {
		type: String,
		enum: ['Customer', 'Admin'],
    }
},{
    timestamps: true
})

Cart

const CartSchema = new Schema({
	owner: {
		type: Schema.Types.ObjectId,
		ref: 'User'
	},
	total: {
		type: Number,
		default: 0
	},
	items: [{
	    item: {
		    type: Schema.Types.ObjectId,
		    ref: 'Product'
	    },
	 
	    quantity: {
		    type: Number,
		    default: 0
	    },
	    
	    price: {
		type: Number,
	    default: 0
    }
    }]
},{
    timestamps: true
})

citricco_2's People

Contributors

anabm90 avatar gabicase 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.