Skip to content

Commit 385952a

Browse files
#
1 parent deee2e3 commit 385952a

File tree

3 files changed

+34
-3
lines changed

3 files changed

+34
-3
lines changed

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Ideal for developers seeking a functional, lightweight, and maintainable API arc
6666

6767
## 📁 Project Structure
6868

69-
```
69+
```txt
7070
project-root/
7171
├── app/ # Swagger/OpenAPI docs
7272
├── bootstrap/ # App bootstrap process
@@ -83,6 +83,37 @@ project-root/
8383

8484
---
8585

86+
## 🗃 Database Initialization
87+
88+
EchoAPI comes with a default database structure and initial data available in:
89+
90+
```txt
91+
core/Migration/auth-migrations.sql
92+
```
93+
94+
This script creates the basic authentication tables: `users`, `roles`, `user_tokens`, and `password_resets`.
95+
96+
### Default user
97+
98+
* **Email:** `[email protected]`
99+
* **Password:** `master!123@`
100+
101+
> ⚠️ The password is hashed in the database. Use this user only for first login or local development.
102+
103+
### Automatic migration with Docker
104+
105+
If you're using Docker, set the following in your `.env`:
106+
107+
```ini
108+
AUTO_MIGRATE=true
109+
```
110+
111+
This will automatically import the `auth-migrations.sql` during container startup.
112+
113+
> 🔐 After successful migration, it is strongly recommended to set `AUTO_MIGRATE=false` to prevent re-imports and protect data integrity.
114+
115+
---
116+
86117
## 🚀 Manual Installation
87118

88119
```bash

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "project",
55
"license": "MIT",
66
"extra": {
7-
"echoapi-version": "2.2.0"
7+
"echoapi-version": "1.0.0"
88
},
99
"autoload": {
1010
"psr-4": {

core/Migration/auth-migrations.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ CREATE TABLE IF NOT EXISTS `users` (
6262

6363
-- Copiando dados para a tabela data_base_name.users: ~1 rows (aproximadamente)
6464
INSERT INTO `users` (`id`, `role_id`, `user`, `email`, `password`, `creation_date`) VALUES
65-
(1, 1, 'Master', '[email protected]', '$2y$10$zBYcfQv9wFmkJgJTZFwR6uI4zTWyOaXWgN8bl2cV3UwGcBSgk8YS2', '2025-07-14 18:43:15');
65+
(1, 1, 'Master', '[email protected]', '$2y$10$kUpUMOLxlkcoZIlZuMb1zOuW7d3bW5kkpkFaDCV6Fg5/qzNGBZBMC', '2025-07-14 18:43:15');
6666

6767
-- Copiando estrutura para tabela data_base_name.user_tokens
6868
CREATE TABLE IF NOT EXISTS `user_tokens` (

0 commit comments

Comments
 (0)