Giter Site home page Giter Site logo

ozgurhalilince / peninsularestaurant Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 427 KB

"Peninsula Restaurant" project aims to provide a simple API solution for restaurant owners to streamline the process of managing restaurant tables, operating hours and reservations. The project is built with KoaJS, JEST, MongoDB (with Mongoose), Docker (with docker-compose).

Dockerfile 1.90% TypeScript 98.10%

peninsularestaurant's Introduction

Peninsula Restaurant

Introduction

"Peninsula Restaurant" project aims to provide a simple API solution for restaurant owners to streamline the process of managing restaurant tables, operating hours and reservations.

The project is built with KoaJS, JEST, MongoDB (with Mongoose), Docker (with docker-compose).

Installation

Clone the project

git clone https://github.com/ozgurhalilince/peninsulaRestaurant

Create your .env file

cd peninsulaRestaurant && cp -r .env.example .env

Up

docker-compose up

Seed the database

docker exec -it api npm run db:seed

After seeding you will have

  • a dummy user with email "[email protected]" and password "example"
  • dummy daily working hours for a week
  • dummy tables for the restaurant

Running tests

docker exec -it test npm test

Architecture

The architecture of the "Peninsula Restaurant" API project has been carefully designed, incorporating a set of technologies that align with the project's requirements and objectives. The selected technologies offer a range of benefits that contribute to the project's efficiency, scalability, maintainability and the ability to handle evolving requirements.

KoaJS

KoaJS was chosen as the web framework for building the API due to its lightweight nature and asynchronous middleware architecture. This allows for better control over the request-response flow, making it ideal for building APIs with high concurrency and performance demands. Koa's use of async/await simplifies asynchronous code handling, promoting cleaner and more readable code.

JWT

JSON Web Tokens are an open, industry standard RFC 7519 method for representing claims securely between two parties.

Mongoose

Mongoose provides a straight-forward, schema-based solution to model your application data. It includes built-in type casting, validation, query building, business logic hooks and more, out of the box.

Nodemon

Nodemon is a utility depended on about 3 million projects, that will monitor for any changes in your source and automatically restart your server. Perfect for development.

Docker and Multi Stage Builds

Docker is a platform designed to help developers build, share, and run container applications. It handles the tedious setup.

Multi-stage builds are useful to anyone who has struggled to optimize Dockerfiles while keeping them easy to read and maintain.

Docker Compose

Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration. Compose works in all environments; production, staging, development, testing, as well as CI workflows.

MongoDB

MongoDB, a NoSQL database, was chosen for its flexibility and scalability. In a dynamic environment like a restaurant, where requirements might evolve, MongoDB's schema-less structure allows for easy adaptation without requiring extensive schema changes.

Benefits:

  • Flexible Schema: MongoDB's schema-less nature accommodates changes in data structure without requiring database migrations, making it well-suited for evolving requirements.
  • Scalability: MongoDB's horizontal scaling capabilities support the potential growth of the restaurant's data, ensuring the system can handle increased demand.
  • Document-Oriented: Storing data in documents enhances data locality and reduces the need for complex joins, which can lead to improved query performance.
JEST

Jest is a delightful JavaScript Testing Framework with a focus on simplicity.

Swagger [not yet]

Simplify API development for users, teams, and enterprises with the Swagger open source and professional toolset. Find out how Swagger can help you design and document your APIs at scale.

Node-cron [not yet]

The node-cron module is tiny task scheduler in pure JavaScript for node.js based on GNU crontab. This module allows you to schedule task in node.js using full crontab syntax.

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.