# Happy

<div align="center">
  <img src=".github/assets/cover.svg" alt="Happy" />
</div>

<div align="center">
  <img src="https://img.shields.io/badge/status-complete-brightgreen?style=for-the-badge" alt="Project Status" />
  <img src="https://img.shields.io/badge/Next%20Level%20Week-%233-9466FF?style=for-the-badge" alt="Next Level Week #3" />
</div>

## 📖 About the Project

**Happy** is a full-stack web application designed to connect people with orphanages, making it easier to schedule visits and bring joy to children's lives. Developed during Rocketseat's Next Level Week, this platform allows users to find nearby orphanages on an interactive map, view detailed information about them, and contribute by registering new locations.

## ✨ Features

-   🗺️ **Interactive Map:** View all registered orphanages on a dynamic Google Map.
-   🔎 **Orphanage details**: Access detailed information for each orphanage, including photos, visiting hours, and instructions.
-   ➕ **Create Orphanages:** A complete form allows users to add new orphanages to the platform, including image uploads and map location selection.
-   🚀 **Modern Frontend:** Built with the latest version of React (v18) for a fast and responsive user experience.
-   🔔 **Toast Notifications:** Provides a clean and modern UI for form validation and feedback.

## 🛠️ Tech Stack

This project is built with a modern, robust tech stack:

#### **Frontend**

-   **React 18**
-   **TypeScript**
-   **React Router v6**
-   **Google Maps API**
-   **Axios** for API requests
-   **React-Toastify** for notifications

#### **Backend**

-   **Node.js** with **Express**
-   **SQLite** for local development database
-   **TypeORM** for database management and migrations
-   **Multer** for handling file uploads
-   **CORS** for handling cross-origin requests

## 🚀 Getting Started

To get a local copy up and running, follow these simple steps.

### Prerequisites

You'll need to have the following software installed on your machine:
* [Node.js](https://nodejs.org/en/) (v16 or newer recommended)
* [Yarn](https://yarnpkg.com/)

### Installation & Setup

1.  **Clone the repository:**
    ```sh
    git clone <repository-url>
    cd happy-app
    ```

2.  **Setup the Backend:**
    * Navigate to the backend directory:
        ```sh
        cd backend
        ```
    * Install dependencies (this includes the `sqlite3` driver):
        ```sh
        yarn install
        ```
    * **Run the Backend Server:**
        ```sh
        yarn dev
        ```
        The backend will now be running on `http://localhost:3101`. Keep this terminal open.

3.  **Setup the Frontend:**
    * Open a **new terminal** and navigate to the frontend directory:
        ```sh
        cd web
        ```
    * Install dependencies:
        ```sh
        yarn install
        ```
    * **Configure the Google Maps API Key:** Create a new file named `.env` in the `web` directory. Add your Google Maps API key to this file.
        ```
        REACT_APP_MAPS_API_KEY=YOUR_MAPS_API_KEY_HERE
        ```
    * **Run the Frontend Server:**
        ```sh
        yarn start
        ```
        The frontend will now be running on `http://localhost:3100`. You can now access the application in your browser!

## 📜 License
This project is licensed under the MIT License.