Skip to content

avptp/face

Repository files navigation

Face

About

Face is the main web application of Associació Valenciana pel Transport Públic (Valencian Association for Public Transport), a non-profit organization whose goal is to achieve the public transport that the Valencian society deserves.

It is made with Next.js —a React framework— and love. ❤

Directory structure

The project follows the default Next.js application structure with the following additions:

  • deployments, .dockerignore, .env.example, docker-compose.yml and Dockerfile contain the configuration and manifests that define the development and runtime environments with Docker and Docker Compose.
  • .github holds the GitHub Actions CI/CD pipelines.

License

This software is distributed under the MIT license. Please read the software license and the graphic resources license for more information on the availability and distribution.

Getting started

This project comes with a virtualized environment that has everything necessary to develop on any platform.

TL;TR

./install
task

Requirements

Before starting using the project, make sure that the following software is installed on your machine:

  • Taskfile, a task runner that makes the project much easier to use.
  • Docker, a virtualization software that allows to create lightweight virtual environments.
  • Docker Compose, a tool for defining and running multi-container Docker applications.

It is necessary to install the latest versions before continuing. You may follow the previous links to read the installation instructions or simply run the following command.

./install

Initializing

First, initialize the project and run the environment.

task

You can stop the environment by running the following command.

task down

Finally, install NPM dependencies.

task run -- npm ci

Usage

You can run commands inside the virtual environment by prefixing them with a shortcut command (task run -- <command>) or by running a shell in the container (task shell).

Running the development server

Run the following command to start the development server:

task run -- npm run dev

Note that Git is not available in the container, so you should use it from the host machine. It is strongly recommended to use a desktop client like Fork or GitKraken.

Deployment

The deployment process is automated with GitHub Actions. When changes are incorporated into production (master branch) or staging (develop branch), an automatic deployment is made to the corresponding environment.

Troubleshooting

There are several common problems that can be easily solved. Here are their causes and solutions.

Docker

The Docker environment should work properly. Otherwise, it is possible to rebuild it by running the following command.

task rebuild

To start from scratch, you can remove all containers, images and volumes of your computer by running the following commands.

Note that all system containers, images and volumes will be deleted, not only those related to this project.

docker compose down
docker rm $(docker ps -a -q)
docker rmi $(docker images -q)
docker volume rm $(docker volume ls -f dangling=true -q)