GithubHelp home page GithubHelp logo

imelstorm / web-service-mvc-project-layout Goto Github PK

View Code? Open in Web Editor NEW
18.0 4.0 0.0 10 KB

Recommended project layout for frameworks with flexible project structure suitable for MVC pattern.

License: MIT License

javascript mvc mvc-architecture project-layout project-structure python

web-service-mvc-project-layout's Introduction

Web Service MVC project layout

If you are looking for Domain Driven Design project layout please look here

This repository presents a suggested project structure for developing web applications using frameworks with flexible structure e.g. FastaPI, Flask in Python or Express, and Fastify in Javascript/Typescript, it also can be used with Chi in Go, but with some modifications due to Golang Project Layout recommendations. It offers a well-organized folder structure that is particularly recommended for medium to big size projects, where handling and ordering the application logic becomes crucial. By adopting this structure, developers can benefit from a modular and scalable architecture that promotes code reusability, maintainability, and collaboration among team members.

The proposed project structure follows the Model-View-Controller (MVC) design pattern, which promotes a clear separation of concerns. This separation lets developers easily navigate and modify specific application components, facilitating teamwork and reducing code conflicts.

Moreover, this project structure proposal includes directories like "dao" or "repository" for storing persistent layer logic. "ci" to store common utility functions which can be useful for build, deploy, or test purposes, "tests" to house unit, integration or functional tests for the application, and "config" to hold configuration files. These directories help streamline development, testing, and configuration processes, making maintaining and extending the project in the long run easier.

In summary, this project structure proposal provides a solid foundation for organizing the logic of medium to big size web applications. However, it can also be beneficial for smaller projects that have the potential to grow rapidly. By adopting this structure, developers can ensure scalability, maintainability, and codebase organization, enabling them to build robust and efficient applications.


Please view README.md in each directory for more info. This section has only a short description of every package.

Project root directories

/ci

CI related files like build, deployment and test related scripts

/project_package

Main project package. Contains project essential packages

Project package directories

/api

All API documentation related files

/assets (optional)

Project related assets e.g. templates, images, etc.

/clients (optional)

Project specific API clients for third party APIs.

/config

Config files and config related logic

/controller

MVC Controllers package

/dao (optional)

For projects which adopts this pattern

DAO packages.

/di (optional)

For projects which adopts this pattern

Dependency injection configurations.

/middleware

API middlewares

/model

MVC Model package.

/repository (optional)

For projects which adopts this pattern

Repository pattern contracts and sources implementations.

/router

API routers package.

/tests

Packages with different types of tests


Package which better to avoid

/utils

Projects often dump all code for which was not found in a better place in well-structured packages to this directory. And at the end of the day, this package becomes some kind of dumpster for all bad and unstructured code in the project. So better to spend a little bit of time and place the code in the right structure than dump it to /utils.

/common

Same as in utils very fast and too often turns into another kind of code dumpster. Often contains code that can be reworked in some parent classes for inheritance rather not to just being dumped in this folder.

/helpers

Same as /utils and /common packages.

web-service-mvc-project-layout's People

Contributors

imelstorm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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