Giter Site home page Giter Site logo

dyarleniber / barber-scheduling Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 405 KB

Barber Appointment Scheduling App using JavaScript, Node.js, Express, PostgreSQL, Nunjucks, Multer and Sequelize.

License: MIT License

JavaScript 61.37% HTML 19.07% CSS 19.55%

barber-scheduling's Introduction

Barber Appointment Scheduling App

The application allows the registration of barbers and customers. Customers can appointment schedules with available barbers, and barbers can see a summary of the day's schedules.

The software was developed using the Model–View–Controller (MVC) architectural pattern. The technologies of the Backend side are: Node.js, Express and a PostgreSQL database with Sequelize ORM. The templating engine Nunjucks was used on views. The profile pictures and the session informations are stored locally. The profile pictures are stored by the middleware Multer.

Screenshots

Environment configuration

Database configuration

First of all you must have a PostgreSQL database available.

In development environment I suggest using the Docker container image kartoza/postgis. Just run the following command:

docker run --name database -p 5432:5432 -d -t kartoza/postgis

Replace database with the name you prefer.

After that, it is necessary to create the database Schema in PostgreSQL. If you are using a Docker instance as suggested above, the credentials are as follows:

Key Value
Host localhost
Port 5432
User docker
Password docker

Environment variables

After the database configuration, you must set the environment variables. Create a file called .env at the root of the project, using the data from the .env.example file as a base. Be sure to enter a session name and a session secret, these values ​​are used to store the user's session at the moment he logs in to the application. Database informations must be populated according to the configuration mentioned above. Follow an example:

NODE_ENV=development

PORT=3000

SESSION_NAME=root
SESSION_SECRET=MySecret

DATABASE_HOST=127.0.0.1
DATABASE_NAME=mydatabase
DATABASE_USERNAME=docker
DATABASE_PASSWORD=docker

Migrations

Now, you must run the migrations in order to create the tables in the database. Run the following command:

npx sequelize db:migrate

Install dependencies

Finally, just install all project dependencies and start the application with the following commands:

yarn install
yarn start

You can access the application according to the port set in the environment variables, for example:

http://localhost:3000/

barber-scheduling's People

Contributors

dyarleniber avatar

Stargazers

 avatar  avatar  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.