CoThings is application to account for current number of people using shared areas or utilities in realtime. The project’s main purpose is avoiding you to visit crowded areas during COVID-19 pandemic if you live in a community.
Without any restriction anyone can update the counter in case of people forget to update their status.
It uses socket for realtime communication.
You can see the project overall progress from here
You can checkout applications' designs from here
For automatic room updates (on enter and exit) you need a beacon installed in the area and the iOS application.
Here's our iOS Application
You can download the iOS application from the App Store
Here's our Demo Web Site.
And here's a screenshot that we use for our share-house facility:
Any contributions are welcome. Here is some categories that you might help with:
- Designing
- Frontend development
- Backend development
- Mobile apps development
- info@cothings.app
- IRC channel on freenode.net #cothings
Currently the project is being developed in Elixir + Phoenix Framework. In the future we might separate the backend and frontend.
You can run the web application on your server with Docker using docker-compose. How to part will be detailed later.
Please always chekcout the latest release documentation for Phoenix from here
Elixir: 1.14.1
Erlang/OTP: 25
Phoenix: 1.6.0
-
Create
.envfile in the root folder of the project ormv .env.example .envand set the environment variables as needed. Here's some explanation of some environment values.SECRET_KEY_BASEis an unique key to sign in your cookie and session, to not save it plain. Keep it secret! Don't commit it. You should generate your own by using mix commandmix phx.gen.secretDATABASE_URLis pretty clear. Should be something like thisecto://db_user:db_password@db_hostname/coliving_prodPOOL_SIZEYour database's connection pool sizeHOSTYour app's domain. You need it in order to confirm the handshaking between clients.APP_TITLE"CoThings" is the default app title however feel free to change the app's title, but you need to keep the credits at the bottom acccording to the license.ADMIN_USERNAMEandADMIN_PASSWORDare the credentials for managing rooms. To access the rooms management the url is/roomsLOG_ROOM_USAGElet the application create room usage logs. Default:falseAPP_IMAGE_URLYou can setup an header image for your application. If not, we're going to use this photo by Daniel DiNuzzo @ddinuzzo on Unsplash.SERVER_SOURCE_CODE_URLDue to AGPL-3.0 license requirements you have to provide the server's source code. In case you haven't modified the source code; you can use original repo's url from https://cothings.app/codeIOS_SOURCE_CODE_URLDue to GPL-3.0 license requirements you have to provide the iOS application's source code. In case you haven't modified the source code; you can use original repo's url from https://cothings.app/code -
Update your database settings and persistent volume paths in
docker-compose.ymlfile. You can keep track of bussiest days of the week and time of the day for the room usage. -
There are two ways to have the docker image:
-
Build the image by yourself
docker build -t coliving .Please note that, since outDockerfileuse multistage build, you will need Docker version 17.05 or later. -
Or you can use our initial release docker image by pull it like this:
docker pull cothings/web-app:latestor specify in the image and the tag indocker-compose.ymlfile.
-
-
Now run the application
docker-compose up -d -
See the logs
docker-compose logsto confirm yourhostnameis written in the logs. -
⚠️ Once you've released and ran the app on production, you need to run migration. Run the following command.
docker exec -it {container_name} bash bin/coliving eval Coliving.Release.migrate
Kubernetes deployments are supported, by using Helm. Chart can be found under deployment/kubernetes/chart.
To run the project in your local:
- You'll need a PostgreSQL (docker) instance in your local
- Install dependencies with
mix deps.get - Create and migrate your database with
mix ecto.setup - Install Node.js dependencies with
cd assets && npm install - Start Phoenix endpoint with
mix phx.server
Now you can visit localhost:4000 from your browser.
