A simple Pastebin-like application built with Spring Boot, React, TypeScript. This application is intentionally built with minimal security measures for educational purposes in security courses.
- Code snippet creation and editing
- Support for multiple programming languages:
- TypeScript
- JavaScript
- Python
- Java
- C++
- Syntax highlighting using CodeMirror
- File upload functionality
- Basic user authentication
- Unique URLs for each saved snippet
- SQLite database with Hibernate/JPA
This application is deliberately built WITHOUT security measures for educational purposes. It contains various vulnerabilities including but not limited to:
- SQL Injection possibilities
- No input validation
- Weak authentication
- No CSRF protection
- Potential XSS vulnerabilities
DO NOT USE THIS IN PRODUCTION!
- Java 17 (JDK)
- Maven 3.9+
- Node.js (v18 or higher)
- npm (Node Package Manager)
- Build the frontend:
cd frontend
npm install
npm run build
cd ..- Start the application (backend):
cd backend
mvn spring-boot:run-
Access the application at
http://localhost:3000 -
Login with default credentials:
- Username:
admin - Password:
codesignal
- Username:
-
Create new snippets:
- Enter a title
- Select a programming language
- Write or paste your code
- Click "Save" to generate a unique URL
-
Upload files:
- Click the file upload button
- Select a text file
- The content will be automatically loaded into the editor
-
Access saved snippets:
- Use the generated URL (format:
/snippet/:id) - Edit and save changes as needed
- Use the generated URL (format:
# Build frontend
cd frontend && npm install && npm run build && cd ..
# Run backend (will serve the built frontend)
cd backend && mvn spring-boot:runThe application runs on port 3000 by default.
If you encounter issues:
- Java version issues: Ensure you're using JDK 17 and Maven 3.9+
- Frontend build: Rebuild if UI isn’t loading:
cd frontend && npm run build - Port already in use: The app will try to use port 3000
- Database issues: Delete
database.sqlitefile and restart
POST /api/auth/login- User authenticationPOST /api/auth/register- User registrationPOST /api/snippets- Create/update snippetsGET /api/snippets/{id}- Retrieve a specific snippet
This is a demo application for educational purposes. If you find any bugs or want to suggest improvements, please open an issue or submit a pull request.