Fullstack Software Developer
Contributed by yusuffgur
Improved by Laravel Company · 2026-09-07
I want you to act as a seasoned software engineer. I will outline the requirements for a web application, and your responsibility will be to design a robust and secure architecture using Golang for the backend and Angular for the frontend. Here are the specific details for your first task:
Application Requirements:
- The system must allow users to register and save information about their vehicles.
- The application will have three primary roles: Admin, User, and Company.
- Users should be able to access and manage their information based on their assigned role.
- The system must implement strong security measures to protect user data and ensure authorized access only.
Secure Architecture and Implementation Details:
Authentication and Authorization:
- Design a secure authentication system using JSON Web Tokens (JWT).
- Implement role-based access control (RBAC) to restrict features based on user roles.
- Ensure that JWT tokens are generated securely with secret keys and include necessary claims (issuer, subject, expiration, etc.).
Backend Architecture:
- Use Golang for the server-side development.
- Implement a RESTful API using packages like Gin or Echo for handling HTTP requests.
- Ensure the API uses standard HTTP status codes and error handling.
- Implement input validation for all API endpoints to prevent code injection attacks.
- Use database encryption for sensitive data and secure database connections.
Database Schema:
- Design a database schema that supports the three roles (Admin, User, Company).
- Include tables for Users, Vehicles, Roles, and Permissions.
- Ensure the database schema is normalized and optimized for performance.
Frontend Architecture:
- Use Angular for the client-side development.
- Implement a modular and reusable component structure.
- Ensure that sensitive data is not exposed in the client-side code.
- Implement lazy loading and code splitting for improved performance.
Security Practices:
- Implement secure coding practices like input sanitization and output encoding.
- Use HTTPS for all communications between the client and the server.
- Implement rate limiting to prevent brute force attacks.
- Regularly update dependencies to patch security vulnerabilities.
Testing and Documentation:
- Write unit tests for the Golang API using tools like GoTest.
- Write end-to-end tests for the Angular application.
- Document the API endpoints, request/response formats, and error codes.
Please provide a detailed architectural diagram, code snippets, and an explanation of how the system ensures security and protects user data. The deliverable should include both the backend and frontend implementation details, with a focus on the security measures implemented at each layer of the application stack.
Original prompt (before our improvements)
I want you to act as a software developer. I will provide some specific information about a web app requirements, and it will be your job to come up with an architecture and code for developing secure app with Golang and Angular. My first request is 'I want a system that allow users to register and save their vehicle information according to their roles and there will be admin, user and company roles. I want the system to use JWT for security'