/aircnc

☕ ReactJS and Node.js study project that aims to replicate the basic features of Airbnb

Primary LanguageJavaScriptMIT LicenseMIT

aircnc

Find and offer hosting spots

☕ ReactJS and Node.js study project aimed at replicating basic Airbnb functionalities
Made on the Omnistack Week, by Rocketseat.


Introduction

This project is part of my personal portfolio that includes some basic fundamentals. I would be happy with any feedback to help me become a better developer.

🔌 Backend

A RESTful API created with Node.js and use MongoDB through mongoose.
See the API_REFERENCE for more details.

🚀 Built With

Name Description
Express Application structuring framework
Mongoose Here used as query and schema builder
JSON Web Token Token pattern
Multer File upload middleware
CORS Express cors
ESLint ECMAScript linter

💻 Web

React application configured by the Create React App. It provides a mobile friendly interface that consumes the api of this same repository.

Features

  • SignIn
    • Login on the application
    • Control the authentication with React Context API
  • SignUp: create a user with name, email and passoword
  • Spot
    • Create a spot with image, name, tags and price
    • List all spots
  • Book
    • Create a booking with date
    • Receives pending bookings

🚀 Built With

Name Description
React Standard server structure
React DOM React entry point to the DOM
React Router DOM Declarative routing for React
Axios HTTP requester
Styled Components Create a styled react component
JSON Web Token Token pattern
ESLint ECMAScript linter

💻 Getting Started

Here you will run the Backend and Web app in development mode. Follow the steps below.

Requeriments

Node.js
MongoDB
Yarn or NPM

Cloning the Repository

$ git clone https://github.com/gabrielribeirof/aircnc

Installing the dependencies

Enter the backend folder and install the dependencies

$ cd aircnc/backend

$ yarn install

# or
$ npm install

Go to web folder and install the dependencies

$ cd ../web

$ yarn install

# or
$ npm install

Configuring the database

You must provide your MongoDB's URI. You can use the MongoDB Cloud which is free.

Create a file named .env in backend folder based on .env.example file. The .env file should look like this:

APP_BASE_URL=http://here-your-local-ip:3333
MONGOOSE_SRV=mongodb+srv://<crendencials>@maincluster.jtmlc.gcp.mongodb.net/aircnc
JWT_SECRET=any-secret

Running Aplication

Now that everything is ready, you can launch the applications.

# in /backend folder

$ yarn dev

# or
$ npm run dev
# in /web folder

$ yarn start

# or
$ npm run start

The web application log register will provide the final URL :)

📋 License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with 💖 by Gabriel Ribeiro