Skip to content

intojhanurag/one-password

Repository files navigation

πŸ” One-Password - API Key Management Platform

A secure, enterprise-grade API key management platform built with modern technologies. Store, organize, and share your API keys with military-grade encryption and intuitive team collaboration features.

✨ Features

πŸ”’ Security First

  • AES-256 Encryption - Military-grade encryption for all API keys
  • Zero-Trust Architecture - Multi-factor authentication and least-privilege access
  • Complete Audit Trail - Track every access, modification, and sharing event
  • SOC 2 Compliant - Enterprise-grade security standards

πŸ‘₯ Team Collaboration

  • Role-Based Access Control - Granular permissions for team members
  • Secure Sharing - Share API keys with specific team members
  • Team Management - Create and manage teams with custom roles
  • Activity Monitoring - Real-time activity logs and notifications

πŸš€ Developer Experience

  • Lightning Fast Access - Organize keys by service, environment, and tags
  • REST API - Programmatic access to your keys
  • Search & Filter - Find keys instantly with powerful search
  • Copy to Clipboard - One-click copying with visual feedback

🎨 Modern UI/UX

  • Light/Dark Mode - Smooth theme switching
  • Responsive Design - Works perfectly on all devices
  • Premium Design - Clean, professional interface
  • Smooth Animations - Subtle, elegant transitions

πŸ› οΈ Tech Stack

Frontend

  • Next.js 15 - React framework with App Router
  • TypeScript - Type-safe development
  • Tailwind CSS - Utility-first styling
  • Lucide React - Beautiful icons
  • Custom Components - Reusable UI components

Backend

  • Go - High-performance backend
  • Gin Framework - HTTP web framework
  • PostgreSQL - Relational database
  • JWT - Secure authentication
  • bcrypt - Password hashing

Infrastructure

  • Docker - Containerization
  • Docker Compose - Local development
  • Nginx - Reverse proxy
  • SSL/TLS - Secure connections

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • Go 1.21+
  • PostgreSQL 14+
  • Docker & Docker Compose (optional)

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/one-password.git
    cd one-password
  2. Install dependencies

    # Install frontend dependencies
    cd apps/web
    npm install
    
    # Install backend dependencies
    cd ../api
    go mod download
  3. Set up environment variables

    # Copy environment files
    cp apps/api/.env.example apps/api/.env
    cp apps/web/.env.example apps/web/.env.local
  4. Configure database

    # Start PostgreSQL (using Docker)
    docker-compose up -d postgres
    
    # Or use your local PostgreSQL instance
    createdb one_password
  5. Run database migrations

    cd apps/api
    go run main.go migrate
  6. Start the development servers

    # Terminal 1 - Backend
    cd apps/api
    go run main.go
    
    # Terminal 2 - Frontend
    cd apps/web
    npm run dev
  7. Access the application

πŸ“ Project Structure

one-password/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ api/                 # Go backend
β”‚   β”‚   β”œβ”€β”€ cmd/            # Application entry points
β”‚   β”‚   β”œβ”€β”€ internals/      # Internal packages
β”‚   β”‚   β”‚   β”œβ”€β”€ handlers/   # HTTP handlers
β”‚   β”‚   β”‚   β”œβ”€β”€ services/   # Business logic
β”‚   β”‚   β”‚   β”œβ”€β”€ models/     # Data models
β”‚   β”‚   β”‚   └── middleware/ # HTTP middleware
β”‚   β”‚   β”œβ”€β”€ migrations/     # Database migrations
β”‚   β”‚   └── main.go         # Main application file
β”‚   └── web/                # Next.js frontend
β”‚       β”œβ”€β”€ src/
β”‚       β”‚   β”œβ”€β”€ app/        # App Router pages
β”‚       β”‚   β”œβ”€β”€ components/ # React components
β”‚       β”‚   β”œβ”€β”€ lib/        # Utilities and API client
β”‚       β”‚   └── styles/     # Global styles
β”‚       └── package.json
β”œβ”€β”€ docker-compose.yml      # Docker services
β”œβ”€β”€ Dockerfile.api         # Backend Docker image
β”œβ”€β”€ Dockerfile.web         # Frontend Docker image
└── README.md

πŸ”§ Configuration

Environment Variables

Backend (.env)

# Database
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=password
DB_NAME=one_password

# JWT
JWT_SECRET=your-super-secret-jwt-key
JWT_EXPIRY=24h

# Server
PORT=5000
HOST=0.0.0.0

# Encryption
ENCRYPTION_KEY=your-32-character-encryption-key

Frontend (.env.local)

# API Configuration
NEXT_PUBLIC_API_URL=http://localhost:5000
NEXT_PUBLIC_APP_NAME=One-Password

🐳 Docker Deployment

Using Docker Compose

  1. Clone and navigate to project

    git clone https://github.com/yourusername/one-password.git
    cd one-password
  2. Configure environment

    cp .env.example .env
    # Edit .env with your configuration
  3. Start all services

    docker-compose up -d
  4. Run migrations

    docker-compose exec api go run main.go migrate
  5. Access the application

Individual Services

# Build and run backend
docker build -f Dockerfile.api -t one-password-api .
docker run -p 5000:5000 one-password-api

# Build and run frontend
docker build -f Dockerfile.web -t one-password-web .
docker run -p 3000:3000 one-password-web

πŸ“š API Documentation

Authentication Endpoints

POST /auth/signup

Create a new user account.

Request:

{
  "fullName": "John Doe",
  "email": "john@example.com",
  "password": "securepassword"
}

Response:

{
  "id": 1,
  "fullName": "John Doe",
  "email": "john@example.com",
  "token": "jwt-token-here"
}

POST /auth/login

Authenticate user and get access token.

Request:

{
  "email": "john@example.com",
  "password": "secret"
}

API Key Endpoints

GET /apikeys/list

List all API keys for the authenticated user.

Headers:

Authorization: Bearer <jwt-token>

Response:

[
  {
    "id": 1,
    "name": "OpenAI API Key",
    "description": "Production API key for OpenAI",
    "tags": "production,ai,openai",
    "createdAt": "2024-01-01T00:00:00Z",
    "updatedAt": "2024-01-01T00:00:00Z"
  }
]

POST /apikeys

Create a new API key.

Request:

{
  "name": "OpenAI API Key",
  "key": "sk-...",
  "description": "Production API key for OpenAI",
  "tags": "production,ai,openai"
}

POST /apikeys/reveal

Reveal an encrypted API key.

Request:

{
  "name": "OpenAI API Key"
}

DELETE /apikeys/delete

Delete an API key.

Request:

{
  "name": "OpenAI API Key"
}

πŸ§ͺ Testing

Backend Tests

cd apps/api
go test ./...

Frontend Tests

cd apps/web
npm test

E2E Tests

cd apps/web
npm run test:e2e

πŸ”’ Security

Data Encryption

  • All API keys are encrypted using AES-256 before storage
  • Encryption keys are managed securely
  • No plain text storage of sensitive data

Authentication

  • JWT-based authentication
  • Password hashing with bcrypt
  • Secure session management

Network Security

  • HTTPS enforcement
  • CORS configuration
  • Rate limiting
  • Input validation and sanitization

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow the existing code style
  • Write tests for new features
  • Update documentation as needed
  • Ensure all tests pass before submitting PR

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

πŸ™ Acknowledgments


Built with ❀️ for developers who value security and simplicity.

About

Api key managment platform in Golang

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published