Skip to content

Latest commit

 

History

History
175 lines (128 loc) · 6.1 KB

Readme.md

File metadata and controls

175 lines (128 loc) · 6.1 KB

PasteIt

Banner

GitHub code size in bytes GitHub last commit GitHub commit activity month GitHub license

PasteIt is a code snippet sharing platform that allows users to easily share code snippets with others. The project consists of two main components: the Client and the Server.


📁 Project Structure

├── client
│   ├── .eslintrc.cjs
│   ├── .gitignore
│   ├── README.md
│   ├── index.html
│   ├── package-lock.json
│   ├── package.json
│   ├── postcss.config.js
│   ├── public
│   │   └── _redirects
│   ├── src
│   │   ├── App.css
│   │   ├── App.tsx
│   │   ├── assets
│   │   │   └── react.svg
│   │   ├── components
│   │   │   ├── Footer.tsx
│   │   │   ├── Form
│   │   │   │   ├── Snippet.tsx
│   │   │   │   └── Success.tsx
│   │   │   ├── Header.tsx
│   │   │   ├── Hero.tsx
│   │   │   ├── MoonIcon.tsx
│   │   │   ├── Steps.tsx
│   │   │   ├── SunIcon.tsx
│   │   │   └── ThemeSwitcher.tsx
│   │   ├── index.css
│   │   ├── main.tsx
│   │   └── vite-env.d.ts
│   ├── tailwind.config.js
│   ├── tsconfig.json
│   ├── tsconfig.node.json
│   ├── vercel.json
│   └── vite.config.ts
└── server
    ├── .dockerignore
    ├── .gitignore
    ├── Cargo.toml
    ├── Dockerfile
    └── src
        └── main.rs

Client

💻 Stack

  • axios: Promise-based HTTP client for making API requests.
  • react: A JavaScript library for building user interfaces.
  • react-dom: Provides DOM-specific methods for React.
  • react-router-dom: Declarative routing for React applications.
  • react-icons: Popular icons for React projects.
  • react-toastify: Notification system for React applications.
  • typescript: A typed superset of JavaScript that compiles to plain JavaScript.
  • vite: A fast build tool for modern web applications.

Setting Up Locally

  1. Clone the repository:
git clone https://github.com/codescalper/pasteit-rust.git
  1. Navigate to the Client directory:
cd pasteit-rust/Client
  1. Install dependencies:
 npm install
  1. Run the development server:
 npm run dev

Tech Stack

  • React: A JavaScript library for building user interfaces.
  • React Router: A standard library for routing in React applications.
  • Monaco Editor: A versatile code editor that powers Visual Studio Code.
  • Next UI: A React component library for building modern user interfaces.

Server

Project Structure

  • main.rs: The main Rust file defining the server logic using Actix web framework.
  • Dockerfile: Instructions for creating a Docker image for deployment.
  • Cargo.toml: Contains project metadata and dependencies.

Setting Up Locally

  1. Navigate to the Server directory:
cd pasteit-rust/Server
  1. Create a .env file with the following content:
    DATABASE_URL=your_database_url
  1. Build and run the server:
docker build -t pasteit-server . && docker run -p 8080:8080 pasteit-server

Tech Stack

  • Rust: A systems programming language that focuses on performance and safety.
  • Actix-Web: A powerful, pragmatic, and extremely fast web framework for Rust.
  • SQLx: An asynchronous, pure Rust SQL library with compile-time checked queries.
  • Dotenv: A Rust implementation of loading environment variables from a .env file.
  • Docker: A platform for developing, shipping, and running applications in containers.

Contribution

If you would like to contribute to the project, feel free to open issues, submit pull requests, or reach out to the project maintainers.

Issues and PRs

Please use the GitHub repository to report issues or submit pull requests.

Deploying with Docker

To deploy the server using Docker, follow these steps:

  1. Build the Docker image: docker build -t pasteit-server .
  2. Run the Docker container: docker run -p 8080:8080 pasteit-server

This will deploy the server locally, and it will be accessible at http://localhost:8080.

Feel free to customize the deployment process based on your hosting environment.

Additional Information

For more information on the dependencies used in the project, refer to the following links:

Feel free to explore and enhance the project! If you have any questions, reach out to the project maintainers.