DEV Community

Raad Shahamat
Raad Shahamat

Posted on

Guidelines for the first projects...

This blog is for those, who want to start their first full stack development project but not have enough idea about how to start. I will try to cover some of the things that you should follow for making your first project journey more smooth.

Folder Structure:

The first thing you might face difficulty with is creating and understanding the folder structure. It may vary from project to project, but there are some common concepts like creating two separate folders — one for the frontend and the other for the backend. Inside each folder, you will have multiple subfolders. For the backend, you will have folders like models, services, API endpoints, etc. (based on your requirements). And for the frontend, you will have a src folder inside which you will find components, assets, pages, api, utils, etc. folders (if you are using React).

fullstack-project/

├── backend/ # Backend service
│ ├── app/ # Core backend logic (for FastAPI)
│ │ ├── api/ # Route handlers
│ │ ├── models/ # Database models
│ │ ├── schemas/ # Pydantic schemas or DTOs
│ │ ├── services/ # Business logic
│ │ ├── core/ # App config, database setup, etc.
│ │ └── main.py # Entry point (e.g., FastAPI app)
│ ├── tests/ # Backend unit/integration tests
│ ├── requirements.txt # Python dependencies
│ └── .env # Environment variables

├── frontend/ # Frontend service
│ ├── public/ # Static files (favicon, index.html)
│ ├── src/ # React app source
│ │ ├── assets/ # Images, CSS, fonts, etc.
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Page-level components (e.g., Home, Login)
│ │ ├── api/ # API utility functions
│ │ ├── context/ # React context (auth, theme, etc.)
│ │ ├── hooks/ # Custom hooks
│ │ ├── App.jsx # Main App component
│ │ └── main.jsx # React DOM rendering
│ ├── tailwind.config.js # Tailwind CSS config (if using)
│ ├── vite.config.js # Vite config
│ └── package.json # Frontend dependencies

├── database/ # SQL scripts, migrations, seeders
│ ├── migrations/
│ └── init.sql

├── docs/ # Project documentation
│ └── README.md

├── .gitignore
└── README.md # Main project README

Write clean code:

Make sure you write code as cleanly as possible. It is a good practice. You should write the logic in a more efficient way. You can also create a folder for a particular module, and inside that, you can create multiple files so that anyone can easily find the code written for a specific purpose. It will reduce cognitive complexity. Another thing you should remember is not to make a function too large with too much logic in a single function. Rather, use multiple functions, each for a particular logic, and use them inside the main function.

Keep in mind:

Before writing any routes, you should always first do some floor planning — like how this route is going to be used and how many times it will be called. It is absolutely necessary when you are going to deploy the project on a server. Because the more APIs need to be called from the backend, the more time it will take to load, resulting in a slower website.

Wish a happy journey for your first project 😄 and share if you find this post helpful.

Top comments (0)