Skip to content

Airline Backend built with a Microservices Architecture using Fiber (Go), secured with 2FA, JWT, HttpOnly Cookies, and Bcrypt.

Notifications You must be signed in to change notification settings

CoderAnchel/GOairways-Backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GOairways-Backend

Sin título-2024-11-22-1530

Overview

This project is a backend application built using the Go programming language and the Fiber framework. The application follows a microservices architecture, employing JWT authentication with 2FA (Two-Factor Authentication), bcrypt for password hashing, and secure HttpOnly cookies for session management. The backend enables users to perform a variety of actions such as creating and approving routes, managing buy models, registering plans, creating accounts, and logging in securely.


Features

  • Microservices Architecture: Each service is isolated for scalability and maintainability.
  • Authentication:
    • JWT-based authentication with Two-Factor Authentication (2FA).
    • Secure password storage using bcrypt.
    • Session management using HttpOnly cookies.
  • Core Functionalities:
    • User registration and account management.
    • Secure login with optional 2FA.
    • Creation and approval of routes.
    • Management of buy models.
    • Plane registration and updates.
  • Security Features:
    • Enforced secure practices using bcrypt and HttpOnly cookies.
    • Validation of JWT tokens for API request authorization.

Tech Stack

Language

  • Go

Framework

  • Fiber (a fast, lightweight web framework inspired by Express.js)

Libraries & Tools

  • bcrypt: For secure password hashing.
  • JWT: For token-based authentication.
  • Fiber Middleware: Various middleware for request handling, error management, and CORS.
  • gorilla/mux: For additional routing needs.

Databases

  • PostgreSQL: For user and transactional data.
  • Redis: For session storage and caching.

Installation

  1. Prerequisites:

    • Go (version 1.20 or later).
    • PostgreSQL database.
    • Redis server.
  2. Clone the Repository:

    git clone https://github.com/your-repo/backend-go-fiber
    cd backend-go-fiber
  3. Environment Setup:

    • Create a .env file and configure the following variables:
      DB_HOST=localhost
      DB_PORT=5432
      DB_USER=yourusername
      DB_PASSWORD=yourpassword
      DB_NAME=yourdatabase
      REDIS_URL=redis://localhost:6379
      JWT_SECRET=yourjwtsecret
  4. Install Dependencies:

    go mod tidy
  5. Run Database Migrations (if any):

    go run migrate.go
  6. Run the Application:

    go run main.go

About

Airline Backend built with a Microservices Architecture using Fiber (Go), secured with 2FA, JWT, HttpOnly Cookies, and Bcrypt.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published