Skip to content

Project folder structure

Every Telestion project is different, and so is its folder structure. Some projects might not even have a frontend and write every backend service in Java, while others might have a frontend and use Deno for their backend services.

That’s not very helpful, is it? So, let’s take a look at a folder structure that is suitable for most projects. Note that as your project grows, you might want to change the structure to better suit your needs. But you will know when the time has come.

Version control

The first thing you should do is to create a new Git repository. This repository will contain all the code for your project. You can use GitHub, GitLab, or any other Git hosting service you like.

The following folder structure is recommended for most projects:

  • backend-deno - A folder that contains all backend services written in Deno.
    • [service-name] - A folder that contains a backend service written in Deno.
      • mod.ts - The entry point of the backend service.
      • README.md - A file that contains information about the backend service.
    • Dockerfile - A Dockerfile for the Deno-based backend services, if you want to use Docker.
  • frontend-react - A folder that contains the frontend written in React.
    • package.json - The frontend application’s package.json file.
  • frontend-cli - A folder that contains the CLI frontend written in Deno.
    • mod.ts - The entry point of the CLI.
    • README.md - A file that contains information about the CLI.
  • nats - A folder that contains the NATS server configuration.
    • nats-server.conf - The configuration file for the NATS server.
  • docker-compose.yml - A Docker Compose file that contains the configuration for the Docker containers.
  • README.md - A file that contains information about the project.

Alternatives

There are also other options how you could structure your project. For example, if you have completely distinct groups of services that are not related to each other, you could create a folder for each group, and differentiate between programming languages used under these groups.

However, to get started, the above structure should be sufficient. You can always change it later.