Text Code Sharer is a web application for sharing text and code snippets with ease. Built with Java Spring Boot, React, PostgreSQL, and Redis, it provides a performant and scalable platform for managing shared snippets.
- Features
- Tech Stack(#tech-Stack)
- Getting Started(#getting-started)
- Environment Variables(#environement-variables)
- API Endpoints(#api-endpoints)
- Development Setup(#development-setup)
- Contributing(#contributing)
- License(#license)
- Create, read, update, and delete (CRUD) text/code document.
- Document expiration and one-time views.
- Search and categorize document.
- Caching with Redis for faster performance.
- Frontend: React
- Backend: Java Spring Boot
- Database: PostgreSQL
- Caching: Redis
- Deployment: Docker
- Docker and Docker Compose installed.
- Java 21+ and Maven installed (if not using Docker for local development).
- Node.js 16+ and npm/yarn installed (for the frontend).
git clone https://github.com/my_nickname/text-code-sharer-api-java-spring.git
cd text-code-sharer-api-java-spring
- Clone the repository:
git clone https://github.com/my_nickname/text-code-sharer-api-java-spring.git
cd text-code-sharer-api-java-spring
-
Build and run the backend:
- With Docker
docker-compose up --build
* Without Docker
./mvnw spring-boot:run
- Configure the frontend: (Details will follow as the frontend get implemented.)
Create a env.properties file in the root directory with the following variables: POSTGRES_DB_NAME=<YOUR_DB_NAME> POSTGRES_DB_USERNAME=<YOUR_DB_USERNAME> POSTGRES_DB_PASSWORD=<YOUR_DB_PASSWORD> POSTGRES_DB_PORT=5432
SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/text_code_sharer
SPRING_DATASOURCE_USERNAME=your_username
SPRING_DATASOURCE_PASSWORD=your_password
REDIS_HOST=localhost
REDIS_PORT=6379
(To be added later.)
Method | Endpoint | Description |
---|---|---|
POST | api/snippets | Create a new snippet |
GET | api/snippets | {id} Retrieve a snippet by ID |
DELETE | api/snippets | {id} Delete a snippet |
GET | api/snippets | List all snippets |
Backend: TODO Frontend: TODO Database: Ensure PostgreSQL is running and a database named text_code_sharer is created:
CREATE DATABASE text_code_sharer;
Caching: Ensure Redis is running locally or via Docker:
docker run -d -p 6379:6379 redis
- Fork the repository.
- Create a new feature branch:
git checkout -b feature-name
- Commit your changes and push the branch:
git push origin feature-name
- Create a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.