Skip to content

About

Create and publish posts using AI

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Autonomous Backend

A NestJS-based backend application with authentication and user management.

Features

  • 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

Prerequisites

  • Node.js (v16 or later)
  • PostgreSQL
  • pnpm (recommended) or npm

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/autonomous-backend.git
cd autonomous-backend
  1. Install dependencies:
pnpm install
  1. Create a .env file based on .env.example:
cp .env.example .env
  1. Update the .env file with your database credentials and JWT secret.

Database Setup

  1. Create a PostgreSQL database named autonomous (or as specified in your .env file)
  2. The application will automatically create tables on startup in development mode

Running the Application

Development mode:

pnpm start:dev

Production mode:

pnpm build
pnpm start:prod

API Documentation

Once the application is running, you can access the Swagger documentation at:

http://localhost:3000/api

Project Structure

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

Testing

Run the test suite:

pnpm test

License

This project is licensed under the MIT License.

About

Create and publish posts using AI

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages