heliomar-pena / fast-shopping-backend

RESTful server powered by MySQL and Express.js

Home Page:https://fast-shopping-backend.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FastShopping Server

Forks Stargazers Issues-open Issues-closed Contributors contributions welcome

Logo

Shop System

RESTful server powered by MySQL and Express.js

πŸ–ŠοΈπŸž Report a Bug πŸ™‹β€β™‚οΈ Request Feature

Live at fast-shopping-backend.herokuapp.com

Table of Contents

Features

Framework javascript nodejs mysql heroku

  • Async/Await support
  • WinstonJs Logger Implementation
  • Error Handling
  • MySQL Migrations and Seed Support
  • Basic request parameters Validation
  • Open Api Specification implemented through swagger and swagger-ui
  • Enviroment variables to hold configuration values .env file
  • Functional Programming with Middlewares and helpers
  • Standard Coding with Eslint and Prettier, this helps to keep thing into prespective.

JavaScript Style Guide

How to use it

This code is meant to be run in a server accesible online, so other services can use it, in this case a shop/store frontend. This is a Rest Api solution using basic database create, read, update and delete operations (CRUD).

I use a RESTful API to be used by any other client, but for human readability I also added swagger (it can even be used as an ad hoc admin panel!). To use it from a client you need to make HTPP(S) requests, for example using curl:

> curl https://fast-shopping-backend.herokuapp.com/ping -v

But you can use any language or library: PHP, GO, C++, Rust, etc.

Some interesting endpoints:

  • GET / - Swagger Documentation
  • GET /api/v1/tickets/all - (protected by JWT) Get all the tickets

More info in the swagger documentation Live Here

Getting started

Visit the installation instructions to learn more about how to setup your PC for run the server!

Code Overview

This backend's code is made using JavaScript language, and Node.js runtime. With a package named Express.js I managed to create the server, routers and middleware necesary. Also MySQL is used to provide a modern, open sourced and perfomant database layer. Lastly, the server have auxiliar packages for development and deployment to ensure is production ready, enterprise level.

As with most of node.js applications, we would want to install node and npm in our local PC in order to run the server or develop code. This folder include all the necesary files to run the server local or online, just take into account that you'll need to use a terminal as no GUI is available yet.

If you want to develop you have to setup a good dev environment. First of all a good text editor/IDE, I prefer to use Visual Studio Code, but you can use anything else. For the use of VSCode I provide configuration files in the hidden folder .vscode.

For more information about the code please check the code overview.

Author

Contributing

contributions welcome

🀝 Contributions, issues and feature requests are welcome! Feel free to check the issues page. Be sure to review the contributing guidelines.

Happy programming πŸ˜ƒ ✌️

Show your support

πŸ€— Give a ⭐️ if you like this project!

Icons from:

Icons8 Icons8

License

License

πŸ“ This project is licensed under the Apache 2
Feel free to fork this project and improve it

About

RESTful server powered by MySQL and Express.js

https://fast-shopping-backend.herokuapp.com/

License:Apache License 2.0


Languages

Language:JavaScript 98.9%Language:Shell 0.9%Language:Procfile 0.3%