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.
-
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.
-
git clone https://github.com/Ralex91/arrow.git cd ./arrow
-
npm install
-
npm run dev
Your application will be accessible at
http://localhost:3000
.
-
GET /api/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" } }
-
GET /api/place/:id
-
DELETE /api/place/:id
-
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" } }
-
POST /api/place/search
Exemple JSON body :
{ "type": "museum", "country": "France", "details": { "artMovement": "cubism", "artType": "sculpture" } }
- 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.