Skip to main content
  1. All Posts/

my-store-api

eCommerce TypeScript

my-store-api

eCommerce API built with JavaScript (Express/ Node)

Project Scope

This project will have the following scope:

  • Product management:

    • Products grid form.

      • Product entry form.
        • Product variation form.
    •   <li>
          Products categories management</p> <ul dir="auto">
            <li>
              Product category entry form.
            </li>
          </ul>
        </li>
        
        <li>
          User management</p> <ul dir="auto">
            <li>
              Users grid form. <ul dir="auto">
                <li>
                  User entry form.
                </li>
              </ul>
            </li>
            
            <li>
              Roles grid form <ul dir="auto">
                <li>
                  Role form
                </li>
              </ul>
            </li>
          </ul>
        </li>
        
        <li>
          Order management</p> <ul dir="auto">
            <li>
              Orders grid form. <ul dir="auto">
                <li>
                  Order entry form.
                </li>
              </ul>
            </li>
          </ul>
        </li>
        
        <li>
          Products page (Home page)</p> <ul dir="auto">
            <li>
              Products search.
            </li>
            <li>
              Product page. <ul dir="auto">
                <li>
                  Reviews.
                </li>
                <li>
                  Product avaliation (stars).
                </li>
                <li>
                  Cart button
                </li>
                <li>
                  Quantity field
                </li>
              </ul>
            </li>
          </ul>
        </li>
      </ul>
      

    Project Settings

    .env

    This file should contains the environment variables used on our application and this file should be created on the root of the project.
    Since this file has sensitive information do not share it with anyone.
    .env file example
    PORT=5000
    NODE_ENV=development
    MAIL_PASSWORD=123456
    DEBUG=app:*
    MONGODB_CONN=mongodb://root:example@localhost:27017

    Using a Docker MongoDB linux image

    Run the following command:

    docker-compose -f stack.yml up
    

    For more information in how to use a MongoDB image please check it here.

    Build and run the project locally:

    Once everything is set up just run the following commands

    $ npm install  
    $ npm run serve-debug  
    

    Sources:

    The Ultimate Guide to setting up Node.js with TypeScript and Express
    TypeScript Node Starter
    Koa JS CRUD Backend Implementation