Skip to content

BlacAc3/go-rest-api

Repository files navigation

Project Idea: Personal Data Locker API

Description:

Create an API called Personal Data Locker, a secure and decentralized platform for storing and retrieving personal files, notes, and encrypted information. The system ensures data integrity and high security without relying on third-party services like paid cloud storage or PostgreSQL.


Core Features:

  1. User Authentication and Authorization:

    • Implement JWT-based authentication.
    • Password hashing using bcrypt or another secure Go library.
    • User roles: Admin and Regular User.
  2. Data Storage:

    • Store data as encrypted files or JSON-like structures in SQLite or BoltDB (a lightweight key-value store).
    • Each user has a separate namespace for their stored data.
  3. File Upload and Download:

    • Allow users to upload small files (like PDFs, images, or text files) with metadata.
    • Use a secure folder structure on the server to organize files by user.
    • Implement rate-limiting for file uploads.
  4. Data Encryption:

    • Encrypt sensitive files and notes using Go's crypto package before storage.
    • Ensure the encryption key is user-specific and never stored on the server.
  5. Searchable Metadata:

    • Allow users to tag their data with searchable metadata (e.g., file type, creation date, tags).
    • Implement efficient search functionality.
  6. Activity Logs:

    • Log user activities such as logins, uploads, and downloads into an activity log stored locally.
  7. API Documentation:

    • Use Swagger or Postman to provide comprehensive API documentation.
  8. Local Deployment:

    • Package the API for easy local deployment using Docker or a simple installation guide.

Advanced Features (Optional):

  1. WebSocket Notifications:

    • Real-time notifications for file upload/download activities.
  2. Version Control:

    • Allow users to upload new versions of existing files, retaining previous versions for download.
  3. Offline Sync:

    • Provide a CLI tool (also written in Go) to sync local files with the server.
  4. Role-based Data Sharing:

    • Implement a feature where users can share specific files or data with other registered users.
  5. Backup & Restore:

    • Allow users to export their data as encrypted zip files for backup.
    • Provide a restore endpoint for uploading backups.

Skills Showcased:

  1. API Design: RESTful API principles with clean and efficient routes.
  2. Security: JWT, encryption, rate-limiting, and secure file storage practices.
  3. Database Management: Using SQLite or BoltDB creatively for structured data storage.
  4. Concurrency: Handle simultaneous requests effectively using Go routines.
  5. Documentation: API usability and onboarding for developers.
  6. Packaging and Deployment: Dockerize and deploy locally or on a low-resource server.

Next Steps:

  1. Define the Schema: Plan user models, file metadata structures, and database schema.
  2. Choose Libraries:
    • SQLite: Use gorm or sqlx for database interaction.
    • JWT: github.com/golang-jwt/jwt/v4.
    • File encryption: crypto/aes.
    • CLI Sync Tool: cobra for CLI tool creation.
  3. Implementation Plan:
    • Start with user authentication and database setup.
    • Build core CRUD functionality.
    • Implement encryption and file upload/download.
    • Add search and metadata tagging.

Would you like me to help you with any specific aspect, like structuring the database, setting up a project skeleton, or designing the API endpoints? Packages used: "github.com/blacac3/go-rest-api/internal/api"
"golang.org/x/crypto/argon2" "github.com/go-playground/validator/v10" "github.com/stretchr/testify/assert" "github.com/mattn/go-sqlite3" "gorm.io/driver/postgres" "gorm.io/driver/sqlite" "gorm.io/gorm" "gorm.io/gorm/logger"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages