Project Structure
The Flatlogic Platform ensures authentication, a process that verifies the user’s identity. Authentication is performed by comparing the username and password provided by the user with the credentials stored in the application’s database. When you create and run an application for the first time, a Users table is automatically created in the database.
Full-Stack Application Project Structure
A full-stack application on the Flatlogic Platform includes the following key components:
1. Key Backend folders:
middlewares/
: Contains middleware functions that process requests before they reach route handlers. Common examples include logging, authentication verification, error handling, etc.
db/
: Houses database models, migrations, and connection setup. With Sequelize ORM, this would include model definitions that map to database tables.
services/
: Contains the business logic of the application, separated from route handlers. Each service typically focuses on specific functionality or domain.
routes/
: Defines API endpoints and connects them with the appropriate controller/service functions. Routes are organized by resource or feature.
auth/
: Handles authentication and authorization, including strategies, token generation, and validation.
helpers.js
: Common utility functions used throughout the application.
index.js
: Main application entry point that sets up Express server, connects middleware, and starts listening.
config.js
: Environment-specific configuration settings like database credentials, API keys, etc.
2. Key Frontend folders:
components/
: Reusable UI components organized by feature or type.
hooks/
: Custom React hooks for shared logic across components, including data fetching, form handling, etc.
helpers/`: Utility functions for common operations like data formatting, validation, calculations, etc.
css/
: Global stylesheets and Tailwind customizations.
pages/
: Next.js page components that map to routes. Each file corresponds to a route in the application.
stores/
: Redux state management setup, including slices, actions and thunks.
layouts/
: Layout components that wrap pages to provide consistent structure.
interfaces/
: TypeScript type definitions for data structures, props, state, etc.
config.ts
: Frontend configuration settings.
tailwind.config.js
: Tailwind CSS customization including theme extensions, plugins, and variants.
3. Docker
- Contains essential Docker files for deploying the application.
4. README.md
- A comprehensive guide for running your application locally.
5. Package.json
- Includes metadata about your application, such as its name, version, dependencies, and other essential details.
To prevent breaking your application:
- Do not edit any files in the Docker
folder or the Dockerfile
.
Please make modifications to your project carefully to ensure stability and functionality.
If you face any difficulties, please message us on our Discord, Forum, Twitter, or Facebook. We will respond to your inquiry as quickly as possible!