Git Product home page Git Product logo

vanillatte's Introduction

vaníllatte

Github backlog GitHub issues TODO: Github actions TODO: GitHub codecov

Overview

This is a starter template project for single page applications in vanilla TypeScript.
It is Framework-Agnostic with minimal runtime dependencies, enabling integrations of frameworks and libraries.

Technology stack

Initial technology stack is simple.

Architecture

It is Architecture-Agnostic, but follows key principles including separation of concerns,
SOLID principles, atomic design, software design patterns and readable code.

This ensures that the application will be easy to maintain, scale and modify, enabling integrations of architectures.

architecture

Directory structure

├── .github                              # Github configurations
├── .vscode                              # VScode configurations
│
├── dist                                 # Compiled code
│
├── docs                                 # Documentation
│   ├── diagrams                         # - Drawing files (.drawio | .excalidraw)
│   ├── images                           # - Images for documents
│   └── wiki                             # - Wiki pages
│
├── scripts                              # Shellscripts
│   ├── deployment                       # - Deployment tasks
│   └── onboarding                       # - Onboarding tasks
│
├── src
│   ├── app
│   │   ├── adapters                     # Adapt external services/libraries
│   │   │   ├── frame                    # - Adapt Js Frameworks
│   │   │   ├── auth                     # - Adapt Auth service
│   │   │   ├── http                     # - Adapt HTTP Client
│   │   │   └── ui                       # - Adapt UI component library
│   │   │       ├── atoms                # - Basic UI elements
│   │   │       ├── molecules            # - Simple UI components
│   │   │       └── organisms            # - Complex UI components
│   │   │
│   │   ├── features                     # Features
│   │   │   └── [feature]                # - A specific feature (Granularity can vary)
│   │   │       ├── data                 # - Data-related logic
│   │   │       │   ├── datasources      # - Getting the raw data from api or localDB
│   │   │       │   │   ├── local        # - Local data storage logic
│   │   │       │   │   └── remote       # - Remote data fetching logic
│   │   │       │   └── repositories     # - Select, Shape, Merge raw data for the usecase
│   │   │       ├── domain               # - Feature-specific domain
│   │   │       │   ├── interfaces       # - Interfaces used within the feature
│   │   │       │   └── usecases         # - Business logic (get data, validate data, etc..)
│   │   │       ├── presentation         # - View components for the feature
│   │   │       └── [feature].module.ts  # - Module file for the feature
│   │   │
│   │   ├── index.html                   # Entry point html
│   │   ├── index.ts                     # Bootstrapping
│   │   └── routes.ts                    # Routing configuration
│   │
│   ├── mock                             # Mock
│   │   ├── data                         # - Mock data stored in JSON files
│   │   └── server                       # - Mock API serve and Mock SPA serve
│   │
│   ├── packages                         # Implementation of NPM Libraries
│   │   ├── vanillatte-core              # - Core functionality
│   │   ├── vanillatte-http              # - HTTP Client
│   │   ├── vanillatte-router            # - Router
│   │   └── vanillatte-ui                # - UI components
│   │
│   └── test                             # Test codes
│
├── Dockerfile                           # Docker image configuration
├── nginx.conf                           # NGINX configuration
├── package.json                         # Project dependencies
└── webpack.config.cjs                   # Webpack configuration

Onboarding setup

You have multiple options for setting up this project:

  • Shellscript setup:
    Automated predeterminate setups.
    Recommended for quick and easy setup.

  • Manually setup:
    You can manually set up the project following the steps outlined below.
    This option provides more control over the setup process.

  • Github codespace setup:
    Utilize github codespaces for a cloud-based development environment.

Getting started

You have two options for development.

Using host environment

  • Start the local development server by executing the following command:

    npm run start:mock

    This command will launch the development server,
    and your application will be accessible at http://localhost:8080.

Using docker environment

  • TODO: Start the local development server by
    ...

Development rules

Development sample

Component

// sample.component.ts
class SampleComponent extends BaseComponent {
  private pageName: string = "";

  constructor() {
    super();
    this._dom.innerHTML = `<h1>Title: ${pageName}</h1>`;
  }

  onInit() {
    this.pageName = "Sample"
  }

  onDestroy() { ... }
}
customElements.define("sample-component", SampleComponent);
export default SampleComponent;

vanillatte's People

Contributors

ochairo avatar

Watchers

 avatar

vanillatte's Issues

Crete initial repository

Create an initial repository to start build the environment in subsequent issues.

No need to develop a complete development environment in this issue.
Common handlers, interceptors, specific environment building processes, common lifecycle class, common UI components, page samples, test code samples, project wiki and other initial environment code will be developed in subsequent issues.

Add initial showcase page

Separate in multiple tickets if needed.

  • Create page that can be testable with DI.
  • Create tabs component
  • Create Table
  • Create Table form
  • Create inputs (in other ticket will make it shared input component)

Add vanilla-ts router

Add only a simple router.
No need to implement things like resolver for data or history.

In subsequent issues will develop or add a library for state management, there we can think more about this router.

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.