Formol is a poll system generator built in NodeJS.
Note: this project is as scholar project. Is not intended to be a usable solution in production environments.
The goal of this project is to:
- Add the possibility to create/update/delete polls
- Add the possibility to get stats about created polls
- Host or give the possibility to the user to host itself his poll
- Add the possibility to customize a poll
We choosen for this project to create a mono-repository.
The backend is built arround:
- NodeJS
- Fastify as Web micro-framework
- SequelizeJS as Database ORM
- PostgreSQL as relational database
- Bull as Task/Message queuing
- Redis as Task/Message queuing broker (and if needed as cache)
- OpenAPI for documenting the REST API.
The frontend is built arround NextJS framework and uses the MaterialUI components library.
Note: For now, authentication mechanisms are not planned for the dashboard. Of course, the technical stack can add new elements on the future of the project.
For deploying the whole stack in one click, you need to install Docker on your machine.
- If you have a Windows 10 Family edition, download Docker Toolbox
- If you have a Windows 10 Pro/Entreprise edition, download Docker Desktop edition
- If you have a Mac, download Docker Desktop for Mac
- If you are running a Linux distribution, you can follow this guide. If your distribution is not in the guide, you can install the package with your package manager.
Also, you will need Docker compose. It should be included if you have installed Docker on your Windows or Mac machine. If it's not, you can follow this guide to install it.
To see if Docker is running on your machine, you can open a terminal an type docker ps
command. If the command returns you a message similar of this: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
, you need to boot Docker:
- On windows: just click on a Docker shortcut in your Start menu.
- On Mac: open spotlight and type "Docker".
- On Linux: Type in your terminal
sudo systemctl start docker
. If the commanddocker ps
returns you the same message, add your user to the Docker group withsudo usermod -aG docker <your_username>
and reboot your machine.
Just before booting the stack, create a copy of each config files in the config
folder of each projects and remove the .example
in the name (but also ensure you still have the original file with .example
extension.) and update the configuration if needed.
Note: the default configuration fit with the Docker environment. You need to change some parts with external credentials like email or the s3 server. Note2: the wildcard certificate provided was generated by Let's Encrypt DNS-01 challenge. If for whatever reason, you want to renew the certificate before the expiration of the domain (2021-02-27T23:59:59.0Z), please open an issue.
Now, if you open a terminal in the root folder of the repository, you can now start the stack by using the command:
docker-compose start
The first boot will pull and build all docker images and start all components.
If you want to stop the stack, you can use the command:
docker-compose stop
or if you want to kill, remove all containers of your machine and remove created networks if you want to save space, if you will no more contribute to the project or simply if you want to start from scratch the whole stack, you can use the command:
docker-compose down
If you want to start a specific service, you can use the command:
docker-compose up (-d) <service_name> # -d argument if you want to detach the container and have you terminal free
Or stop it with the command:
docker-compose stop <service_name>
Starting a service will start automatically his required components like the web server, the database or an another service.
Also please refer to the Docker compose documentation if you need more informations about how work the docker-compose
CLI and how to modify the docker-compose.yml
file.
A domain name was created for the project. the entry dev.formol.site
and *.dev.formol.site
redirects to 127.0.0.1
and ::1
.
If boot the stack locally in your machine you can use dev.formol.site:<service_port>
to access to the service you want to use.
If you use Docker, the reverse proxy is configured to serve services on specific subdomains:
- API:
api.dev.formol.site
- Dashboard:
dashboard.dev.formol.site
- S3 (minio):
s3.dev.formol.site
Before contributing to the project, please read the contribution guidelines.