Here you can find the documentation of the Code Sharing Platform
💻Back-end software developer | 👨💻Helping companies to build great back-ends | Java, Spring Boot | Passionate about solving problems using technology
Back-end development · Unit Testing · Java · Algorithms · OOP · Relational Databases · SQL · Git · HTML · CSS · Web services · REST APIs · Spring Boot · Spring Framework · MySQL · Data Structures · Web Development · Software Development
This platform allows programmers to share code without it being public. Each piece of code will have a limited number of views (that is, how many times that piece of code can be seen) and a limit for the time it can be seen. After a certain period of time, the code will expire and will be deleted from the database.
As an user, I can:
- add shared code
- view shared code
- view the latest five public shared codes
POST /code/add| Parameter | Type | Description |
|---|---|---|
body |
json |
Required. The properties of code to be added |
Request body example:
{
"code": "string",
"allowedViewTime": 0,
"views": 0
}Postman example:
MySQL example:
GET /code/${codeId}| Parameter | Type | Description |
|---|---|---|
id |
string |
Required. Id of code to fetch |
Postman example:
GET /code/latestPostman example:
For building and running the application you need:
- JDK 1.8 or higher
- Maven 3
For deploying on Heroku you need:
- GIT
- Heroku CLI
You don't need any additional dependencies. All dependecies related to database management, server management, security management and so on, will be automatically injected by Maven using the pom.xml file located in the root folder of the project.
Clone the project
git clone https://github.com/KimKalura/Code-Sharing-PlatformGo to the project directory
cd my-projectUse maven to build the app and, to run it, and to start the local embedded Tomcat server
mvn spring-boot:runTo run tests, run the following command
mvn testYou can deploy this project using Heroku or other providers as well, by specifying the following environment variables:
PROFILE
MYSQL_URL
MYSQL_USER
MYSQL_PASS
To deploy this project run
git push heroku masterYou cand use demo version of the app, using SwaggerUI and following this link:
https://whispering-hamlet-04296.herokuapp.com/swagger-ui/


