Giter Site home page Giter Site logo

maxkudosh / cookie-consent-sample-project Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 10 KB

This is a sample project written in pure javascript. The project is built around 'cookie consent' domain. The project is a web app using some of the latest JS APIs and it has been tested in Chrome browser.

JavaScript 93.73% CSS 1.88% HTML 4.39%

cookie-consent-sample-project's Introduction

About the project

The project is a small web app written in JS and a bit of React. The project domain revolves around cookie consent functionality. Obviously, it is not a mature project, but just a demo of my approach to code, structure, naming. Some of the architectural decisions may seem over-engineered for such a small codebase, but it's just an illustration. Look'n'feel (HTML and CSS) are not in the focus of this project.

Project Structure

With regards to structure the project is divided into app and lib folders. The lib folder is for portable modules that are mostly independent from each other and from external context. The app folder is for app initialization and app-specific code which in this case is narrowed down to plain demonstration of lib functionality.

Lib folder is divided into subfolders according to the purpose of the code in them, for example: cookie-consent-domain is for domain models, cookie-consent-store is for domain model storage, cookie-consent-foundation is for business logic, ...

Project root contains config files and a plain HTTP server represented in startup.js.

Important considerations

  • There's almost no validation and exception handling to keep the codebase simpler;
  • There are no abstract classes/interfaces to keep the codebase simpler;
  • There are as little external dependencies as possible for the app to run easily;
  • The app relies to several 'fresh' APIs so that a modern browser is required to run it (I've run it in Chrome).

How to run

To run the project one should install a recent stable Node.js version, go to the project root, run 'npm install', 'npm start' commands and visit http://localhost:8080/app/index.html in the browser.

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.