# Organising large-scale applications using serverless compose

**URL:** <https://forum.serverless.com/t/organising-large-scale-applications-using-serverless-compose/17310>\
**Category:** Serverless Framework\
**Created:** [June 11, 2022, 5:20pm UTC](https://forum.serverless.com/t/organising-large-scale-applications-using-serverless-compose/17310 "2022-06-11T17:20:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![szalaybalazs](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/szalaybalazs/32/6913_2.png) [@szalaybalazs](https://forum.serverless.com/u/szalaybalazs)\
**Post date:** [June 11, 2022, 5:20pm UTC](https://forum.serverless.com/t/organising-large-scale-applications-using-serverless-compose/17310/1 "2022-06-11T17:20:11Z")

</div>

Hey,

I am working on a large-scale application using serverless and want to separate my current code-base to multiple services for faster deploy times, etc.

What would you recommend to still be able to reference resources from other services?

At this point I have already tried serverless compose which worked great but I would like to have shared code between multiple services and the only way I found so far is the use of webpack.

This is the current folder structure:

```auto
- libs/
  - database/
    - mongodb.ts
    - sql.ts
  - user.ts
- services/
  - service-1/
    - [...]
    - webpack.config.js
    - serverless.yml
  - service-2/
    - [...]
    - webpack.config.js
    - serverless.yml
- serverless-compose.yml

```

The problem with the current structure is the developer experience; packages have to be installed on multiple places; having to use aliases to access shared code, etc.

Is there a better way to share code between services, while still be able to run on locally.

Thank you for your help in advance.

---

<div class="post-metadata">

**Author:** ![glaucoleme](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/glaucoleme/32/7283_2.png) [@glaucoleme](https://forum.serverless.com/u/glaucoleme)\
**Post date:** [January 24, 2023, 7:04pm UTC](https://forum.serverless.com/t/organising-large-scale-applications-using-serverless-compose/17310/2 "2023-01-24T19:04:21Z")

</div>

> [@szalaybalazs](#):
>
> I would like to have shared code between multiple services

This is also my pain at the moment. Would love to share it among services to avoid code replication.
