Giter Club home page Giter Club logo

arrow's Introduction


๐Ÿงฉ What is this project?

This project is a web application built using the Next.js framework and the Mongoose library for managing a MongoDB database. It is a simple CRUD application for managing places, including their type, name, address, city, zip code, country, and details.

โš ๏ธ This project is an assignment that I had to complete during my training in my school.

โš™๏ธ Prerequisites

  • Before launching the application, you must have a MongoDB database configured.

  • Create a .env file at the root of the project with the following configuration:

    DB_URL="mongodb://127.0.0.1:27017/arrow"
    

    Make sure your MongoDB database is accessible at the indicated address.

๐Ÿ“ฆ Running the Application in Development Mode

To run the application in development mode, follow these steps:

  1. Clone the GitHub repository of your project.

    git clone https://github.com/Ralex91/arrow.git
    cd ./arrow
  2. Install the dependencies using your preferred package manager

    npm install
  3. Start the development server:

    npm run dev

    Your application will be accessible at http://localhost:3000.

๐ŸŽฏ API Endpoints

The application has the following API endpoints:

  • Retrieves the list of all places.

    GET /api/place

  • Creates a new place.

    POST /api/place

    Exemple JSON body :

    {
      "type": "restaurant",
      "name": "Restaurant #1",
      "address": "123 Main St",
      "city": "Paris",
      "zipCode": "75000",
      "country": "France",
      "details": {
        "starCount": 3,
        "averagePrice": 2,
        "kitchenType": "french"
      }
    }
  • Retrieves the information of a specific place.

    GET /api/place/:id

  • Deletes a place.

    DELETE /api/place/:id

  • Updates the information of a place.

    PATCH /api/place/:id

    Exemple JSON body :

    {
      "type": "restaurant",
      "name": "New Restaurant Name",
      "address": "New address",
      "city": "New city",
      "zipCode": "75000",
      "country": "France",
      "details": {
        "starCount": 3,
        "averagePrice": 2,
        "kitchenType": "italian"
      }
    }
  • Allows searching for places using filters.

    POST /api/place/search

    Exemple JSON body :

    {
      "type": "museum",
      "country": "France",
      "details": {
        "artMovement": "cubism",
        "artType": "sculpture"
      }
    }

๐Ÿ“š Used Libraries

Here are the libraries used in this application and the reasons for their choice:

  • React: JavaScript framework for building user interfaces.
  • Next.js: React framework for server-side rendering and generating static websites.
  • Mongoose: Object Document Mapping (ODM) library for interacting with a MongoDB database.
  • Tailwind CSS: Utility-first CSS library for rapid and flexible design.
  • Formik: Library for managing React forms.
  • Axios: Library for making HTTP requests.
  • Headless UI: Library of accessible and unstyled UI components.

These libraries were chosen for their features, popularity, ease of use.

arrow's People

Contributors

ralex91 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.