Carpanta is a web application that simplifies the handling of customers and their appointments in the context of hairdressing. Currently, there is support for:
- Creating customers
- Creating appointments on an specific date/time for a concrete offer
- Listing customers
- Displaying customers and their appointments (past, present and future ones).
Carpanta main stack is Ruby, using Sinatra for interacting with consumers through the web. It also has some touches of JavaScript and CSS for improving the user experience.
Carpanta requires docker and docker-compose to run.
Install the dependencies and start the server.
$ cd carpanta
$ make up
For production environments, please type:
$ cd carpanta
$ make start
Carpanta supports three environments for running the server (e.g. development, test and production). The environment variables, injected when the container runs, can be set differently at infra/[environment].env
.
Want to contribute? Great!
Carpanta uses Ruby + Sinatra for the back-end development. We encourage TDD heavily, so open a tab using your favourite Terminal and run these commands:
$ make shell
$ bundle exec rspec
The front-end development uses vanilla JavaScript and Webpack to bundle every asset under app/assets
. Open a second tab and type the following:
$ make shell_assets
$ npm test
Please, make sure that any change made to this codebase is thoroughly tested using either RSpec or Jest for back-end and front-end respectively before submitting any PR.
You can run the specs for front and back end code in one go by typing:
$ make test
Should you wish to run carpanta into AWS Fargate, please type the following:
$ make deploy
The above mentioned command performs 3 actions:
- Building the image in production mode
- Pushing the image into DockerHub
- Provisioning the code into AWS Fargate according to the definition found at production.json
Note, you will need to have an account in DockerHub in order to push the docker image to any of your repositories. In addition, you will need an AWS user with Programmatic access type. AWS contains a handful set of policies to be attached to your user, for instance AmazonECS_FullAccess should be sufficient for the deploy task to succeed.
Please, make sure to provide valid values for the environment variables from file deploy.env. This file gets created automatically the first time the above mentioned command is called.
- Introducing code style guide for back end front development
- Including CVE detections in the CI
- Refinements in deploy gem located under infra/deploy
MIT