https://github.com/sameerasw/my-cart-server
https://github.com/sameerasw/my-cart-server
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sameerasw/my-cart-server
- Owner: sameerasw
- License: mit
- Created: 2025-01-23T15:46:50.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-04T17:16:44.000Z (over 1 year ago)
- Last Synced: 2025-03-28T16:44:21.508Z (about 1 year ago)
- Language: Java
- Size: 370 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# my-cart-server
This is an experimental ported version of the Ticketin Backend.

## Technologies Used
- **Java**: Programming language used for development.
- **Spring Boot**: Framework for building the backend application.
- **Spring Data JPA**: For database interactions.
- **PostgreSQL**: Database used for storing data. (Using NeonPostgre)
- **WebSocket**: For real-time communication.
- **Maven**: Build and dependency management tool.
## Setup Guide
### Prerequisites
- Java 17 or higher
- Maven 3.9.9 or higher
- PostgreSQL database
### Steps
1. **Clone the repository**:
```sh
git clone https://github.com/sameerasw/item-in-server.git
cd item-in-server
```
2. **Set up the database**:
- Recommended to use NeonPostgre SQL database for a similar integration.
- Create a PostgreSQL database named `ticketin`.
- Update the database connection details in the `.env` file.
3. **Configure environment variables**:
- Create a `.env` file in the root directory with the following content:
```dotenv
SPRING_DATASOURCE_URL=jdbc:postgresql://[database-name].aws.neon.tech/ticketin?sslmode=require
SPRING_DATASOURCE_USERNAME=
SPRING_DATASOURCE_PASSWORD=
SERVER_PORT=1245
SERVER_ADDRESS=0.0.0.0
DATABSE_ACTION=update
```
4. **Build and run the application**:
```sh
mvn clean install
mvn spring-boot:run
```
## Environment Setup
### Environment Variables
- **SPRING_DATASOURCE_URL**: JDBC URL for the PostgreSQL database.
- **SPRING_DATASOURCE_USERNAME**: Username for the PostgreSQL database.
- **SPRING_DATASOURCE_PASSWORD**: Password for the PostgreSQL database.
- **SERVER_PORT**: Port on which the server will run.
- **SERVER_ADDRESS**: Address on which the server will run.
- **DATABSE_ACTION**: Action to be performed on the database (e.g., `update`).
### Example `.env` File
```dotenv
SPRING_DATASOURCE_URL=jdbc:postgresql://aa-bbbbb-ccc-sdafsdafs.ap-southeast-1.aws.neon.tech/ticketin?sslmode=require
SPRING_DATASOURCE_USERNAME=ticketin_owner
SPRING_DATASOURCE_PASSWORD=samplepass
SERVER_PORT=1245
SERVER_ADDRESS=0.0.0.0
DATABSE_ACTION=update
```
## Additional Details
- **Logging**: The application logs are configured to be stored in the `./logs` directory. The logging configuration can be found in the `application.properties` file.
- **Concurrency Handling**: The application uses `ReentrantLock` to handle concurrent item purchases and releases.
- **Simulations**: The application includes simulation classes (`VendorSimulation` and `CustomerSimulation`) to simulate vendor and customer activities.
For further details, please refer to the source code and the provided documentation.
---
This project was developed by [@sameerasw](https://github.com/sameerasw) as part of my coursework at University of
Westminster, OOP module.