CodeShare is a web application that allows users to store text snippets and access them easily using a unique 6-letter code. This repository contains the code for both the frontend and backend of the application.
- Store text snippets with a unique 6-letter code.
- Retrieve stored text using the unique code.
- Update and delete text snippets.
- Responsive UI built with React and Material-UI.
- Backend API built with Go and Echo framework.
- Database operations handled using GORM with PostgreSQL.
- Frontend: React, Next.js, Material-UI, Axios, Tailwind CSS
- Backend: Go, Echo, GORM
- Database: PostgreSQL
- Containerization: Docker, Docker Compose
- Docker
- Docker Compose
- Node.js and npm (for frontend development)
-
Clone the repository:
git clone https://github.com/arkorty/codeshare.git cd codeshare
-
Set up environment variables:
Create a
.env.local
file in the root of the frontend and add the following:NEXT_PUBLIC_BACKEND_URL=http://localhost:8080
-
Run the application using Docker Compose:
docker-compose up --build
This command will build and start the Docker containers for the frontend, backend, and PostgreSQL database.
-
Access the application:
Open your browser and navigate to
http://localhost:3000
to access the frontend. The backend API will be available athttp://localhost:8080
.
- Enter the title and content in the provided text fields on the homepage.
- Click the "Create Paste" button.
- You will be redirected to a page displaying the unique 6-letter code for the paste.
- Navigate to
http://localhost:3000/{pasteID}
where{pasteID}
is the unique 6-letter code.
- Retrieve the paste using its unique code.
- Edit the title and/or content.
- Click the "Update Paste" button.
- Retrieve the paste using its unique code.
- Click the "Delete Paste" button.
- GET
/pastes
: Retrieve all pastes. - POST
/pastes
: Create a new paste. - GET
/pastes/:id
: Retrieve a paste by ID. - PUT
/pastes/:id
: Update a paste by ID. - DELETE
/pastes/:id
: Delete a paste by ID.
We welcome your contributions! Whether it's fixing bugs, adding features, or improving documentation, your help is appreciated. Feel free to report issues or submit pull requests. Thank you for helping make CodeShare better!
This project is licensed under the MIT License - see the LICENSE file for details.