Rumors of strikes and resignations run, and the main union (CGT-U, which stands for City of Gotham Trade-Union) alerts the mayor and senior officials of the town hall of the urgency of the situation. To calm the tensions, the town hall decides to make a state of play of the situation, and why not, to allow the municipal workers to have access to some days off to recuperate. For this, management application has been developed.
- Elixir - Programming language used for the backend.
- Phoenix Framework - Web framework used with Elixir.
- Vue.js - JavaScript framework used for the frontend.
- Vite - Build tool for frontend development.
- PostgreSQL - Database management system.
To install the project locally follow these steps:
# Example installation for the backend
cd time_manager
mix deps.get
mix ecto.create
mix ecto.migrate
mix phx.server
# Example installation for the frontend
cd time_manager_app
npm install
npm run dev
To install the project using Docker, follow these steps:
-
Make sure you have Docker
-
Clone the repository:
git clone https://github.com/your-username/your-repo.git cd time_manager_all
-
Run the docker compose command
docker compose up --build
Troubleshoot
Issue: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Start the Docker Daemon service using the following command:
sudo service docker start
# or
sudo systemctl start docker
Start Docker Desktop.
Issue: Port problem: Error starting userland proxy: listen tcp4 0.0.0.0:5432: bind: address already in use
Check the availability of the port:
sudo lsof -i :5432
If the port is taken, it's probably by Postgres, stop it
sudo kill -9 <PID>
For the frontend, configure your environment by creating or editing a .env
file in the time_manager_app/
directory with the following content:
# Example Frontend .env file
VITE_BASE_API_URL=YOUR_BACK_END_URL
For the backend, configure your environment by creating or editing a .env
file in the root directory with the following content:
# Example Frontend .env file
PGUSER=YOUR_PG_USERNAME
PGPASSWORD=YOUR_PG_PASSWORD
PGDATABASE=YOUR_DATABASE_NAME
PGHOST=YOUR_PG_HOST
PGPORT=YOUR_PG_PORT
To view the API documentation follow thes steps:
-
Copy the yaml on Pastebin
-
Paste it in swagger editor
- A domain name registered with a domain registrar.
- An EC2 instance running under Amazon Linux 2.
- A security group for the EC2 instance that allows incoming HTTPS connections (port 443).
- From the AWS console, create a new security group.
- Associate this security group with the EC2 instance.
- Add a rule to allow incoming HTTPS traffic:
- Traffic type: HTTPS
- Port range: 443
- Connect to the domain registrar's management console.
- Select the domain name.
- In the DNS or Name Servers section, update the records to point to the DNS addresses
- Connexion to EC2 instance
- Generate CSR and Private Key, use OpenSSL to create a private key and a certificate signing request (CSR):
openssl req -new -newkey rsa:2048 -nodes -keyout nom_domaine.key -out nom_domaine.csr
- Submit the CSR to a certification authority to obtain an SSL certificate.
- Place the SSL certificate (.crt) and the private key (.key) on the EC2 instance and configure the web server to use the SSL certificate and the private key.