A NestJS-based backend application with authentication and user management.
- User authentication with JWT
- Role-based access control
- User management (CRUD operations)
- PostgreSQL database integration
- Swagger API documentation
- Environment-based configuration
- Request logging
- Global exception handling
- Response transformation
- Node.js (v16 or later)
- PostgreSQL
- pnpm (recommended) or npm
- Clone the repository:
git clone https://github.com/yourusername/autonomous-backend.git
cd autonomous-backend- Install dependencies:
pnpm install- Create a
.envfile based on.env.example:
cp .env.example .env- Update the
.envfile with your database credentials and JWT secret.
- Create a PostgreSQL database named
autonomous(or as specified in your .env file) - The application will automatically create tables on startup in development mode
Development mode:
pnpm start:devProduction mode:
pnpm build
pnpm start:prodOnce the application is running, you can access the Swagger documentation at:
http://localhost:3000/api
src/
├── main.ts # Application entry point
├── app.module.ts # Root module
├── modules/ # Feature modules
│ ├── auth/ # Authentication module
│ └── users/ # User management module
├── common/ # Shared utilities
│ ├── guards/ # Authentication guards
│ ├── interceptors/ # Response interceptors
│ ├── middlewares/ # Global middlewares
│ ├── filters/ # Exception filters
│ ├── decorators/ # Custom decorators
│ └── constants/ # Shared constants
├── config/ # Configuration files
└── interfaces/ # TypeScript interfaces
Run the test suite:
pnpm testThis project is licensed under the MIT License.