Giter Site home page Giter Site logo

mmanjoura / ecommerce-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paw1a/ecommerce-api

0.0 1.0 0.0 3.73 MB

Rest api of e-commerce web application

JavaScript 26.63% Python 2.07% Go 69.03% CSS 1.63% Makefile 0.27% HTML 0.14% Dockerfile 0.24%

ecommerce-api's Introduction

E-commerce Rest API

API for web stores to sell different types of products. Integrated with payment system Stripe. Also has admin dashboard.

Preview

Contents

  1. Run
  2. API
  3. Implementation

Run

To run application you need:

  • docker-compose
  • .env file

Env configuration

To run API locally you should create your own .env file in the root directory or rename .env-example to .env
Example .env:

HOST=localhost
PORT=8080

STRIPE_KEY=<your stripe key>

JWT_SECRET=jwtSecret

DB_NAME=ecommerce
DB_URI=mongodb://mongo:27017
DB_USERNAME=
DB_PASSWORD=

TEST_DB_NAME=ecommerce-test
TEST_DB_URI=mongodb://localhost:27017
TEST_DB_USERNAME=
TEST_DB_PASSWORD=

REDIS_URI=redis:6379

Local run

make run

or

docker-compose up

Run test data generation for MongoDB

make init

Run frontend only

docker-compose up frontend

API

Base url: <host>:8080/api/v1/

API documentation can be found here

Implementation

  • REST API
  • Clean architecture design
  • Using MongoDB as a main data storage
  • Using Redis for cache and user session storage
  • Env based application configuration
  • Automatically generated Swagger API docs
  • Run with docker-compose
  • Full automated CI/CD process
  • Configured deploy to AWS
  • React.js frontend (in progress)
  • Stripe API payment integration

Project structure

.
├── .bin            // app binary files
├── .data           // directory to store local db data
├── .github         // github actions ci/cd directory
├── cmd             // entry point
├── db              // db generation scripts for mongo
├── deploy          // deploy docker files 
├── docs            // swagger docs and readme images
├── frontend        // react.js app directory
├── internal
│   ├── app         // main application package
│   ├── config      // config loading utils
│   ├── delivery    // http handlers layer
│   ├── domain      // all business entities and dto's
│   ├── repository  // database repository layer
│   └── service     // business logic services layer
├── pkg
│   ├── auth        // jwt auth utils
│   ├── database    // database connection utils
│   ├── logging     // logger configuration
│   └── payment     // payment service configuration
└─

Diagram

image not found

ecommerce-api's People

Contributors

paw1a 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.