Git Product home page Git Product logo

ridertrack's Introduction

Ridertrack

An accessible tracking platform for outdoor sports events.

Project based on this SCORE project proposal.

Live version accessible here: https://rider-track-dev.herokuapp.com

Build status

Stable version: Build Status Development version: Build Status

Getting started

Clone the repo

Using ssh:

git [email protected]:alessandrocaprarelli/ridertrack.git

Using https

git https://github.com/alessandrocaprarelli/ridertrack.git

Prerequisites

Installing

Make sure you have all the prerequisites installed.

Install all the dependencies running:

npm install

Local development environment

Make sure mongodb is running on port 27017 and run:

npm run dev

In the console you should see the output of both node.js web server and angular webpack server. The node.js web server is usually ready after few seconds and you can understand it after you see:

Server listening on port: 5000
[MDB] Successfully connected to MongoDB

The angular application takes a bit more to load and you understand that is ready when you see:

webpack: Compiled successfully.

Once both are running you can access the application on localhost:4200, the port of the webpack server.

Everytime you make a change to the angular app, the webpack server recompiles the code and serve a new version of the frontend. Everytime you make a change to the node.js app, nodemon notices that and restart the web server.

Known issues:

  • In linux the live reload may crash. You can fix it by typing in your terminal echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

Production environment

The webpack server should not be used in a production environment. For that reason the angular code is compiled and served through the node.js application.

Make sure mongodb is running and run:

npm run prod

The application is ready when you see:

Server listening on port: 5000
[MDB] Successfully connected to MongoDB

In this case you don't need to wait also for the webpack compilation, because has been done during ng build.

Docker image

We maintain a docker image to run the project in a production environment. A Dockerfile first builds the angular app and then starts the Node web server.

Everything is executed by a docker-compose file that starts also a MongoDb instance and links it with the web server.

Be sure that Docker and Docker Compose are installed and the docker deamon is running.

# to check that docker is installed. it should ouput a version code
docker --version

# to check that docker-compose is installed. it should ouput a version code
docker-compose --version

# to start the docker deamon in linux
sudo service docker restart 

In order to start the complete environment you need to run from the root of the project.

# in linux
sudo docker-compose up

# windows
docker-compose up

Virtualbox image

We have created a VirtualBox image that contains everything configured. In order to use it, you should create a new virtual machine in Virtualbox and select our .vdi when the system asks you to create/select an hard drive. Remember to use a bridged connection.

The main user password is the same as the username. The root user password is the same as well.

Mongodb

By default the node.js app tries to connect to a local installation of mongodb. If you want to connect to a different mongodb, you can pass either the complete uri setting MONGODB_URI environment variable or each single part of the uri:

MONGODB_URI

or
MONGODB_HOST
MONGODB_PORT
DATABASE_NAME

Running the tests

You can run test on the node.js application running:

npm run test-backend

Documentation

During the development of the project, the team met some milestones and deadlines. Some documents (requirements, project plan, tests, design..) were produced and are accessible in the public page of the project DSD Ridertrack

In addition, the REST API offered by the backend was documented using swagger. It is accessible here

Authors

  • Alessandro Caprarelli Alessandro Caprarelli - Linkedin
  • Giulia Leonardi
  • Marzia Degiorgi
  • Mariano Etchart
  • Ante Breščić
  • Ivan Kvesić
  • Josip Mališa

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.