GithubHelp home page GithubHelp logo

ashishkapoor / ecommerce-blog-api Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 7.42 MB

An api using express, postgres, and sequelize.

JavaScript 95.43% HTML 1.42% Dockerfile 3.15%
nodejs express restful-api sequelize postgresql

ecommerce-blog-api's Introduction

Simple e-commerce API including blog services.

The project is an idea that I came up with after my own extensive research on businesses that really work well in the current times.

What is E-Commerce Blog API?

This project is supposed to be an API only for the e-commerce blog API. We will be serving products like:

  1. Bags (Men and Women) <--> Startin point
  2. Watches (Men, Unisex, and Women)
  3. Clothing (Men and Women)
  4. Jewellery (Men and Women)
  5. Shoes (Men and Women)
  6. Makeup supplies (Men and Women)
  7. A blog CRUD.
  8. Yoga matt.

Getting started.

So far we are using:

  • .eslintrc.js is currently set to 'eslint:airbnb' coding standards.
  • server.jsis where our server and database orm setup and configuration is found.
  • dump.sql is data dump of dummy data(I know we can do better).
  • config.js contains all the environments.
  • package.json contains all the dependencies.

Express framework https://expressjs.com

Postgresql https://www.postgresql.org/docs/

Sequelize: http://docs.sequelizejs.com/manual/installation/usage.html

How to contribute?

Currently, It will be just the two of us. I have no idea about how docker and vault works. I’m only aware of JWT but even for it’s implementation It’s safe to say that you can initiate the setup. I really wish to make use of Express, Postgresql, and sequelize (ORM), stripe for payment gateway.

Note:

master = Production branch
develop = Development branch
  • Continuous Integration: we will be having issue-<number> branches to be merged with all the updates on develop branch.
  • Continuous Delivery: if possible @prafiles hook up the master and develop branch with free heroku servers.
  • Continuous Deployment: Create a pipeline @prafiles which makes it deploy each time we merge anything on the master and develop branch.
  • Continuous Testing: Leave the testing part up to me. We'll keep all the apis synced on postman.

Structure (Tentative)

  • The Routes are defined inside /routes folder.
  • The Models schemas are defined inside the /models folder.
  • The Restful services can be found inside /app/api folder.
  • All public files are kept inside /app/public folder.

Models:

  • Products,
  • Shopping Cart,
  • Blog/posts,
  • Orders,
  • Users.

Also, Featuring:

  • Payment integration using stripe at checkout.

ecommerce-blog-api's People

Contributors

ashishkapoor avatar

Watchers

 avatar

ecommerce-blog-api's Issues

Advance: Authentication

Api should be able to:-

  • Forgot Password: (optional),
  • Storing secrets in environment variables (optional)
  • Protect Routes with authentication middleware.
  • Logging out users.
  • Role based authentication.

Draft: v1.0

  1. Products ✅
  2. Shopping Cart ✅
  3. Users ✅
  4. Authors ✅
  5. Posts ✅

Basic: Authentication

Api should be able to:-

Pseudo:

  • Register: Post /api/users,

  • Login: Post /api/logins,

  • Hashed password

  • Using JWT while hashing passwords in the password field.

  • Getting current user.

Dockerization and CI/CD

We should also add containerisation support via Dockerfile and docker-compose.yml for Docker for respective alternatives for Kubernetes.

We can then build a CI/CD pipeline around this. What is you suggestion on this?

Push credentials via environment

We've a config.json which has fields for all of the database credentials. We should push this via Environment or Secret Manager like Vault.

Route Structure doesn't follow MVC or a standard design philosophy.

Hi!

I just checked out the code, and it seems that while we do have a routes folder, we use a separate structure inside app for the api routes. This seems a bit inconsistent.

Furthermore, we should also separate logic, if complex, from routes, hence perhaps you can have general router for the api, pointing to the individual views for the CRUD for each model.

Let me know about your thoughts.

Documentation Enhancement

Hi! Great work on the API btw.

I was just curious of what the application is about and maybe the documentation itself wasn't making it obvious to me. While there are certainly a lot of keywords, I think mostly they lack the context in the Readme.md.

I think Readme should contain a generic section, focusing on following sections:

  1. What is E-Commerce Blog API?
  2. Getting started.
  3. How to contribute?

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.