Git Product home page Git Product logo

mohamedalabasy / udacity-node.js-online-store Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 280 KB

The goal of the project is to create an online store, users can create their personal accounts on the site, they can browse the existing products, and can add these products to the card with numbers in order to buy them.

License: Other

TypeScript 84.17% JavaScript 14.68% Shell 1.14%
eslint nodejs pgadmin sql typescript jasmine-tests jwt-authentication migrations prettier w

udacity-node.js-online-store's Introduction

Node.JS Online Store

Description:

The goal of the project is to create an online store, users can create their personal accounts on the site, they can browse the existing products, and can add these products to the card with numbers in order to buy them.

To run this project

Step 1 : To use this project must install Node.js and pgadmin Then Download the source code

git clone https://github.com/MohamedAlabasy/Udacity-Node.JS-Online-Store.git

Step 2 : Enter the project file then install package

npm i

To help you understand the project

Api Endpoints

user

`LOGIN` route: 'user/login' [POST]
`CREATE` new user route: 'user/create' [POST]
`INDEX` get all users route: 'user/Index' [GET]
`SHOW` user by ID route: 'user/show/:id' [GET]
`LOGOUT` new user route: 'user/logout/:id' [POST]

product

`CREATE` new product route: 'product/create' [POST]
`INDEX` to get all products route: 'product/Index' [GET]
`SHOW` product by ID route: 'product/show/:id' [GET]

order

`CREATE` new order route: 'order/create' [POST]
`SHOW` all user order route: 'order/show/:user_id' [GET]

order product

`CREATE` new order route: 'orderProduct/create' [POST]
`SHOW` all user order route: 'orderProduct/show/:order_id' [GET]

Folder Structure

├── src
│   ├── handlers
│   │   ├── authHandlers.ts => `for handel authentication function`
│   │   ├── orderProductsHandlers.ts => `for handel orders product function`
│   │   ├── ordersHandlers.ts => `for handel orders function`
│   │   └── productHandlers.ts => `for handel product function`
│   │
│   │
│   ├── middleware
│   │   ├── morganMiddleware.ts => `for log url, method and statue of requests`
│   │   │── notFoundMiddleware.ts => `for not Found Middleware`
│   │   └── errorMiddleware.ts => `for error Middleware`
│   │
│   │
│   ├── models
│   │   ├── ordersModels.ts => `for handel orders Models and functions used in handler`
│   │   ├── orderProductsModels.ts => `for handel orders product Models and functions used in handler`
│   │   │── productModels.ts => `for handel product Models and functions used in handler`
│   │   └── userModels.ts => `for handel user Models and functions used in handler`
│   │
│   │
│   ├── routes
│   │   ├── api
│   │   │   │── authRouter.ts => `for handel authentication route`
│   │   │   │── orderProductsRouter.ts => `for handel order products route`
│   │   │   │── orderRouter.ts => `for handel order route`
│   │   │   └── productRouter.ts => `for handel product route`
│   │   └── routes.ts => `import all routes and exports it to index`
│   │
│   │
│   ├── tests => `for testing purposes`
│   │   ├── helpers
│   │   │   └── reporter.ts
│   │   └── serverSpec.ts => `for testing endpoint api`
│   │
│   │
│   ├── utilities
│   │   │── checkTokens.ts => `for Request check Tokens`
│   │   └── validateRequest.ts => `for validate Request`
│   │
│   │
│   ├── database.ts => `to handel database driver`
│   └── index.ts => `to run the server`
└──

DataBase ERD

Build Status

Step 3 : To run project

node run watch

Step 4 : Open the browser and click : http://localhost:8080

Step 5 : Open postman and import : API Collation You will find it in the project file.


To run eslint to check error
npm run lint

To run eslint and auto fixed error

npm run lint:f

To compile the TS code

npm run tsc

To run the JS code

node dist/server.js

To run test

npm run tests

Here are the Command that were used in the project, You will find it in the project file.

udacity-node.js-online-store's People

Contributors

mohamedalabasy avatar

Watchers

 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.