- Git: To clone the repository.
- PostgreSQL: To set up the database.
- Java 21: To run the backend.
- Maven: To manage the backend dependencies.
- Node.js and npm: To run the frontend.
First, clone the repository from GitHub to your local machine.
git clone https://github.com/EricRamirezS/TaskListApp.git
cd TaskListAppNext, set up the PostgreSQL database using the provided SQL script.
- Install PostgreSQL if you haven't already. Refer to the PostgreSQL installation guide for instructions specific to your operating system.
- Create the Database:
- Access the PostgreSQL command line interface::
psql
- Execute the SQL script to create the tasksDB database:
\i /path/to/repository/database.sql
- Exit the PostgreSQL command line interface:
\q
- Access the PostgreSQL command line interface::
Navigate to the Backend directory and set up the Spring Boot application.
-
Navigate to the Backend Directory:
cd Backend
-
Run the Application in the default (dev) profile:
- Linux
./mvnw spring-boot:run
- Windows
mvnw spring-boot:run
The application will connect to the tasksDB database on localhost:5432 with the user postgres and password postgres. Also it will use sample_key as API KEY
- For Production Profile:
Set the required environment variables:
ENVIRONMENT_PLATFORM=prod
DB_USER=<your_db_user>
DB_HOST=<your_db_host>
DB_PORT=<your_db_port>
DB_NAME=<your_db_name>
DB_SSLM=<your_db_ssl_mode>
API_KEY=<Your_secret_api_key>-
Swagger Documentation: Access the Swagger UI at http://localhost:8080/swagger-ui/index.html.
-
Running Test: To run tests and generate a report, use the following command:
- Linux
./mvnw surefire-report:report
- Windows
mvnw surefire-report:reportView the test report at TaskListApp/Backend/target/site/surefire-report.html.
Navigate to the frontend directory and set up the React application.
- Navigate to the Frontend Directory:
cd frontend - Install Dependencies:
npm install
- Set Environment Variables:
Optionally, set the API URL and API Key, the default value will be used if environment variables are missing:
properties VITE_API_URL=<backend_url> default value:'http://127.0.0.1:8080/api/tasks' VITE_API_KEY=<your_secret_api_key> default value:'sample_key' - Run the Application:
The frontend application will be accessible at http://localhost:5173.
npm run dev
- Database: tasksDB on localhost:5432
- User: postgres
- Password: postgres
- API Key: sample_key
- Environment Variables:
- ENVIRONMENT_PLATFORM=prod
- DB_USER=<your_db_user>
- DB_HOST=<your_db_host>
- DB_PORT=<your_db_port>
- DB_NAME=<your_db_name>
- DB_SSLM=<your_db_ssl_mode>
- API_KEY=<your_api_key>
- Environment Variables:
- VITE_API_URL=(optional, default:
http://127.0.0.1:8080/api/tasks) - VITE_API_KEY=(optional, default:
sample_key)
- VITE_API_URL=(optional, default: