Skip to content

CaioQuirinoMedeiros/go-barber-2.0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues LinkedIn


Logo

Go Barber

An awesome scheduling app for barbers

~~~~~~~~~~ App ~~~~~~~~~~

~~~~~~~~~~ Web ~~~~~~~~~~

Table of Contents

About The Project




This project is the main project built on Rocketseat's GoStack bootcamp. I finished its course on June 2020 but still keep on track of learning and improving my skills with some projects over the time. Altough it's a course project, I always take some different decisions and make my own improvements (that's the right way to learn by the way).

This project consists of an appointment schedule app for barbers (you can think of any service provider though). In the app the user can register, log in, see the list of providers and schedule an appointment at an available day and time. in the web version, on the other hand, the user can see the schedules booked with him.

Built With

The better stack I've ever known (actually it's the only stack I have experience)

Installation

To make the whole magic happen you need to run the Node API and the frontends pointing to the API. If you are familiar with Node an React you shouldn't have trouble to do that, but here are the main steps:

API

  • cd into api project
cd go_barber_2_api
  • Make sure you have Node and Yarn installed.

  • Install the dependencies

yarn install
  • Use the .env.example to set the environment variables needed (you can just make a copy of that file and name it .env)

    • Here you will see that you need connection with postgresql, mongodb and redis. I recommend you use Docker to do that, but it's up to you.
    • Note that if you set sendgrid as MAIL_DRIVER you'll need an Sendgrid API Key
    • If you set ses as MAIL_PROVIDER or s3 as STORAGE_PROVIDER you'll also need AWS Credentials
  • Once you have the postgresql database setup, run the migrations:

yarn migrate
  • Finally, run the Node server in development mode and you are good to go (you'll get an error if your database conections are not setup correctly)
yarn dev

APP

  • cd into app project
cd go_barber_2_app
  • Make sure you have ReactNative environment setted up (ReactNative CLI).

  • Install the dependencies

yarn install
  • Open the src/services/api.ts file and set the correct API url on axios instance (it's probably http://localhost:3333)

  • You may need to reverse port 8081 for metro bundler work correctly. You may need to reverse port 3333 to allow your app connect with the api. And you may need to reverse port 8097 if you are going to use Flipper to debug. So I made it simple:

yarn adb-reverse
  • Set an environment variable called ENVFILE with the value of your .env file and then build the project. Okay, I've leave a script for that, but it might not work depending on your OS, in this case, search how to proper set an environment variable on your OS
yarn android
  • Run the Metro Bundler server if it has not started automatically
yarn start

WEB

  • No need to tell you to cd into the web project at this point

  • Install the dependencies

yarn install
  • Once again, use the .env.example to set the API url

  • Just run it:

yarn start

Contributing

Feel free to contribute on this project (and leave a star!!)

  1. Fork the Project

  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)

  3. Commit your Changes (git commit -m 'Add some AmazingFeature')

  4. Push to the Branch (git push origin feature/AmazingFeature)

  5. Open a Pull Request

  6. Create an issue

Acknowledgements