Jorgefiestas / qr_shirts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

QR Shirts

This project is an Actix Web server for managing QR shirts. It includes a PostgreSQL database for storing shirt data.

Prerequisites

Before you begin, ensure you have the following software installed on your local machine:

Getting Started

1. Clone the Repository

Clone this repository to your local machine:

git clone https://github.com/your-username/qr-shirts.git
cd qr-shirts

2. Set up the Envrionment

Create a .env file in the root directory with the following content:

DATABASE_URL=postgres://user:password@localhost:5432/qr_shirts

3. Start the PostgreSQL Database

Navigate to the docker directory and start the PostgreSQL database using Docker Compose:

cd docker
docker-compose up -d

This will start the PostgreSQL database in the background.

4. Run Actix Web Server

Navigate back to the root directory and run the server:

cargo run

This will start the Actix Web server. The server will be accessible at http://localhost:8080.

Accessing the PostrgeSQL Database

You can access the PostgreSQL database using the psql command-line tool. First, get the container ID or name of the running PostgreSQL container:

docker ps

Then, use the following command to access the database:

docker exec -it <container_id> psql -U user -d qr_shirts

Stopping the Service

To stop the PostgreSQL database, run:

cd docker
docker-compose down

About


Languages

Language:Rust 68.1%Language:CSS 11.3%Language:JavaScript 10.7%Language:HTML 10.0%