The P_PAW2 project is a full-stack application utilizing React for the frontend, Node.js with Mongoose for the backend, and MongoDB as the database. Docker is employed to containerize the application, facilitating straightforward setup and deployment.
Key Features: - User Authentication and Authorization: Secure user login and access control mechanisms.
CRUD Operations: Comprehensive Create, Read, Update, and Delete functionalities for various resources.
Responsive UI: A user-friendly interface built with React.
API Integration: Efficient communication between the frontend and backend services.
Containerization: Dockerized environment for consistent development and deployment.
Technologies Used: - Frontend: React, Axios
Backend: Node.js, Express, Mongoose
Database: MongoDB
Containerization: Docker
Setup and Installation:
Prerequisites: 11- Docker and Docker Compose
- Node.js and npm (for local development)12
-
Clone the Repository: 13```bash git clone https://github.com/KDworak/P_PAW2.git cd P_PAW2
-
Environment Variables: 15Create
.envfiles in both thebackendandfrontenddirectories with the necessary configurations.16 -
Running Locally (without Docker):
- Backend:
17```bash
cd backend
npm install
npm start
- Frontend:
19```bash
cd frontend
npm install
npm start
- Backend:
17```bash
cd backend
npm install
npm start
-
Running with Docker: 21```bash docker-compose up --build
23This command will start the backend, frontend, and MongoDB containers.24
Usage:
25- Access the frontend at http://localhost:3000.
- The backend API is available at
http://localhost:5000/api.26
API Endpoints:
Auth:
27- POST /api/auth/register: Register a new user
POST /api/auth/login: User login28
Users:
29- GET /api/users: Retrieve all users
GET /api/users/:id: Retrieve user by IDPUT /api/users/:id: Update user informationDELETE /api/users/:id: Delete user30
Docker:
31The project includes a docker-compose.yml file that defines services for the backend, frontend, and MongoDB.32
Common Docker commands:
33- Start containers: docker-compose up
- Stop containers:
docker-compose down - Rebuild containers:
docker-compose up --build34
Contributing:
35Contributions are welcome.36 To contribute:
371. Fork the repository.
2. Create a new branch: git checkout -b feature/your-feature-name.
3. Make your changes and commit: git commit -m 'Add feature'.
4. Push to the branch: git push origin feature/your-feature-name.
5. Open a pull request.38
License: 39This project is licensed under the MIT License.40 See the LICENSE file for more information.41