These are the lessons I learned while building my AI Roadmaps project:
- Set Clear Goals: Define your goals for the project before starting it. Focus on achieving these goals and avoid distractions.
- Design High-Level System First: Before writing any code, design the overall system and its components. Break down the system into independent components and prioritize the most important one. Focus on one component at a time to avoid overwhelming yourself.
- Prioritize Foundational Work: Start with things that will be used throughout the project and make later development easier. For example, set up schemas, models, and centralize data fetching.
- Design API Responses Early: Clearly define API responses before starting to write code.
- Write Independent Schemas: Design schemas as independent modules so they can be reused across different parts of the project, such as API documentation, data validation, and ensuring consistent API responses.
- Follow Layered Architecture: Use a layered design pattern for the backend. For example, separate the API layer, service layer, and repository layer for better maintainability.
- Centralize Configurations: From the start, store all configurations in a central location so they can be easily updated when needed.
- Use Environment Variables: Place environment-dependent variables (e.g., API keys, URLs, log levels, paths) in a
.env
file from the beginning. It will help you shift your project to multiple environments easily. - Adopt a Mobile-First Approach: If your users are primarily on mobile devices, prioritize mobile-friendly design from the start.
- Show Loading/Processing States: For actions that might take time, show loading or processing indicators. For example, the server’s response may be fast in local development but could take longer in production due to the internet speed of the user or server issues.
- Be Consistent with Naming: Use consistent naming conventions for resources in the system. For example, choose between “Users,” “Clients,” or “Customers” and stick with one term throughout the project.