Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Contributors Forks Stargazers Issues MIT License


Logo

Ryo.cat

A modern social media platform built with Go and React


View Demo Β· Report Bug Β· Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Features
  5. API Endpoints
  6. Project Structure
  7. Contributing
  8. License
  9. Contact
  10. Acknowledgments

About The Project

Product Name Screen Shot

Ryo.cat is a modern, full-stack social media platform that combines the power of Go's performance with React's dynamic user interface. The platform features a robust authentication system, media sharing capabilities, and a clean, responsive design with dark/light theme support.

Key Highlights:

  • Secure Authentication: Google OAuth integration with JWT token management
  • Media Sharing: Support for image and video uploads with cloud storage
  • Admin Features: Administrative controls for content management
  • Responsive Design: Mobile-first approach with TailwindCSS
  • Real-time Updates: Modern React Query for efficient data fetching
  • Dark/Light Theme: Seamless theme switching for better user experience

The platform is designed to be scalable, maintainable, and provides a solid foundation for building modern social applications.

(back to top)

Built With

This project leverages modern technologies and frameworks to deliver a robust and scalable social media platform:

Backend:

  • Go
  • Chi
  • JWT

Frontend:

  • React
  • TypeScript
  • Vite
  • TailwindCSS
  • React Query

Database & Storage:

  • Turso
  • Cloudflare R2

Authentication:

  • Google OAuth

(back to top)

Getting Started

To get a local copy up and running, follow these simple steps.

Prerequisites

Make sure you have the following installed on your system:

Backend Requirements:

  • Go 1.24 or later
    go version

Frontend Requirements:

  • Node.js 18+ and bun (or pnpm)
    node --version
    bun --version

Installation

  1. Clone the repository

    git clone https://github.com/lucialv/ryo.cat.git
    cd ryo.cat
  2. Backend Setup

    cd api
    
    # Install Go dependencies
    go mod download
    
    # Copy environment variables
    cp .env.example .env
    
    # Edit .env with your configuration
    nano .env
  3. Frontend Setup

    cd ../web
    
    # Install dependencies
    bun install
    
    # Copy environment variables
    cp .env.example .env
    
    # Edit .env with your API URL
    nano .env
  4. Environment Configuration

    API (.env):

    ADDR=:8080
    FRONTEND_URL=http://localhost:5173
    EXTERNAL_URL=http://localhost:8080
    ENV=development
    JWT_SECRET=your-jwt-secret
    GOOGLE_CLIENT_ID=your-google-client-id
    GOOGLE_AUD=your-google-client-id
    GOOGLE_ISS=https://accounts.google.com
    DB_URL=your-database-url
    DB_TOKEN=your-database-token
    BUCKET_NAME=your-bucket-name
    ACCOUNT_ID=your-cloudflare-account-id
    ACCESS_KEY_ID=your-access-key
    ACCESS_KEY_SECRET=your-secret-key

    Web (.env):

    VITE_API_URL=http://localhost:8080
  5. Database Setup

    cd api
    # Run database migrations (if needed)
    # The app will auto-migrate on startup
  6. Start the Development Servers

    Backend (Terminal 1):

    cd api
    go run cmd/main.go

    Frontend (Terminal 2):

    cd web
    bun dev
  7. Access the Application

(back to top)

Usage

User Authentication

  • Sign in with your Google account
  • Secure JWT-based session management
  • Automatic token refresh and validation

Creating Posts

  • Admin users can create posts with rich media content
  • Support for images and videos
  • Drag-and-drop file upload interface

Profile Management

  • Upload and manage profile pictures
  • Update personal information
  • View post history

Social Features

  • Browse posts from all users
  • Infinite scroll for seamless browsing
  • Responsive design for mobile and desktop

For more examples and detailed API documentation, please refer to the API Documentation

(back to top)

Features

πŸ” Authentication & Security

  • Google OAuth 2.0 integration
  • JWT token-based authentication
  • Secure cookie management
  • Role-based access control (Admin/User)

πŸ“± User Interface

  • Modern, responsive design
  • Dark/Light theme toggle
  • Mobile-first approach
  • Smooth animations and transitions
  • Infinite scroll for posts

πŸ“Έ Media Management

  • Image and video upload support
  • Cloud storage integration (Cloudflare R2)
  • Automatic media optimization
  • Media viewer with navigation controls

πŸ‘€ User Profiles

  • Profile picture management
  • User information display
  • Post history and management
  • Admin badges and permissions

πŸš€ Performance

  • Efficient data fetching with React Query
  • Optimized bundle size with Vite
  • Lazy loading and code splitting
  • Server-side rendering ready

(back to top)

API Endpoints

Authentication

  • GET /v1/login - Google OAuth login
  • POST /v1/logout - User logout

User Profile

  • GET /v1/profile - Get user profile
  • PUT /v1/profile/picture - Update profile picture
  • POST /v1/profile/picture/upload - Upload profile picture
  • DELETE /v1/profile/picture - Delete profile picture

Posts

  • GET /v1/posts - Get all posts (paginated)
  • POST /v1/posts - Create new post (Admin only)
  • GET /v1/posts/:id - Get specific post
  • DELETE /v1/posts/:id - Delete post (Admin only)
  • GET /v1/posts/user/:userId - Get posts by user
  • POST /v1/posts/media/upload - Upload media for posts (Admin only)

Storage

  • POST /v1/storage/upload - Upload file to storage
  • DELETE /v1/storage/:key - Delete file from storage

(back to top)

Project Structure

ryo.cat/
β”œβ”€β”€ api/                    # Backend Go application
β”‚   β”œβ”€β”€ cmd/
β”‚   β”‚   β”œβ”€β”€ main.go        # Application entry point
β”‚   β”‚   └── api/           # API handlers and middleware
β”‚   β”œβ”€β”€ internal/
β”‚   β”‚   └── auth/          # Authentication logic
β”‚   β”œβ”€β”€ pkg/
β”‚   β”‚   β”œβ”€β”€ env/           # Environment configuration
β”‚   β”‚   β”œβ”€β”€ storage/       # Cloud storage integration
β”‚   β”‚   β”œβ”€β”€ store/         # Database operations
β”‚   β”‚   └── utils/         # Utility functions
β”‚   β”œβ”€β”€ go.mod             # Go module dependencies
β”‚   └── .env.example       # Environment variables template
β”‚
β”œβ”€β”€ web/                   # Frontend React application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ api/           # API client functions
β”‚   β”‚   β”œβ”€β”€ components/    # Reusable React components
β”‚   β”‚   β”œβ”€β”€ context/       # React context providers
β”‚   β”‚   β”œβ”€β”€ hooks/         # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ pages/         # Page components
β”‚   β”‚   └── assets/        # Static assets
β”‚   β”œβ”€β”€ public/            # Public assets
β”‚   β”œβ”€β”€ package.json       # Node.js dependencies
β”‚   └── .env.example       # Environment variables template
β”‚
β”œβ”€β”€ LICENSE                # MIT License
└── README.md             # Project documentation

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Development Guidelines

  • Follow Go best practices for backend development
  • Use TypeScript strictly for frontend development
  • Maintain consistent code formatting
  • Write meaningful commit messages
  • Add tests for new features
  • Update documentation as needed

Top contributors:

contrib.rocks image

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Lucía Álvarez - @lucialv

Project Link: https://github.com/lucialv/ryo.cat

(back to top)

Acknowledgments

Special thanks to the amazing tools and resources that made this project possible:

(back to top)

About

A website like twitter but just for my cat

Resources

Stars

1 star

Watchers

0 watching

Forks

Used by

Contributors

Languages