https://github.com/mmaffi/full-stack_crud
https://github.com/mmaffi/full-stack_crud
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/mmaffi/full-stack_crud
- Owner: MMaffi
- License: mit
- Created: 2025-06-19T23:31:13.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-20T03:13:32.000Z (about 1 year ago)
- Last Synced: 2025-06-20T04:20:39.726Z (about 1 year ago)
- Language: JavaScript
- Size: 1.42 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 📌 Full-Stack CRUD App
## 🚀 Overview
Full-Stack application built with Node.js (Express) backend and React frontend,
using Sequelize to manage a MySQL database.
Supports CRUD operations (Create, Read, Update, Delete) with migrations.
## 🛠 Technologies
- Backend: Node.js, Express, Sequelize, MySQL
- Frontend: React
- Environment variables: dotenv
- Database CLI: Sequelize CLI
## ✅ Features
- Full CRUD on the database
- Migrations support with SequelizeMeta tracking
- Configuration via .env for multiple environments
## 🔧 Local Setup
### Prerequisites
- Node.js
- MySQL
- Git
### 1. Clone the repo
```bash
git clone https://github.com/MMaffi/Full-Stack_CRUD.git
```
### 2. Install backend dependencies
```bash
cd backend
npm install
```
### 3. Create .env file with your DB credentials
```bash
DB_HOST=localhost
DB_USER=seu_usuario_aqui
DB_PASS=sua_senha_aqui
DB_NAME=nome_do_banco
DB_DIALECT=seu_dialect || 'mysql'
```
### 4. Run migrations
```bash
npx sequelize db:migrate
```
### 5. Start the backend server
```bash
npm start
```
### 6. In another terminal, install frontend dependencies
```bash
cd ../frontend
npm install
```
### 7. Start the frontend
```bash
npm start
```
Open http://localhost:3000 in your browser.
## ⚙️ Useful Commands
```npx sequelize db:migrate``` → run migrations
```npx sequelize db:migrate:undo:all``` → undo all migrations
```npm start``` → start backend or frontend server
## 🧭 API Endpoints (example for /api/users)
```GET /``` → list users
```POST /``` → create user
```GET /:id``` → get user by ID
```PUT /:id``` → update user
```DELETE /:id``` → delete user
## 📦 Deployment
Set environment variables in production
Run migrations on the production server
Start backend and frontend (e.g. Heroku, Vercel)
## 🤝 Contributing
1. Fork the repo
2. Create a feature branch
3. Commit with clear messages
4. Open a Pull Request