All Projects β†’ tsoporan β†’ fittrak

tsoporan / fittrak

Licence: GPL-3.0 license
A data-driven workout tracking tool for the quantified-self πŸ’ͺ πŸ€“

Programming Languages

python
139335 projects - #7 most used programming language
Vue
7211 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to fittrak

jest-gql
βœ…πŸš€GraphQL based tests for Jest and Apollo
Stars: ✭ 33 (+73.68%)
Mutual labels:  apollo, apollo-client
apollo-magic-refetch
magically refetches relevant apollo graphql queries after creates, deletes, and association changes
Stars: ✭ 32 (+68.42%)
Mutual labels:  apollo, apollo-client
laika
Log, test, intercept and modify Apollo Client's operations
Stars: ✭ 99 (+421.05%)
Mutual labels:  apollo, apollo-client
kontent-boilerplate-express-apollo
Kontent Boilerplate for development of Express application using Apollo server and GraphQL.
Stars: ✭ 21 (+10.53%)
Mutual labels:  apollo, apollo-client
react-apollo-graphql
Get rid of decorators and use Apollo GraphQL queries and mutations in the simple and readable way.
Stars: ✭ 16 (-15.79%)
Mutual labels:  apollo, apollo-client
apollo-cache-instorage
Apollo Cache implementation that facilitates locally storing resources
Stars: ✭ 98 (+415.79%)
Mutual labels:  apollo, apollo-client
ember-boilerplate
πŸ‘“ The stable base upon which we build our Ember.js projects at Mirego.
Stars: ✭ 33 (+73.68%)
Mutual labels:  apollo, apollo-client
matters-web
Website of Matters.News, built with Next.js.
Stars: ✭ 70 (+268.42%)
Mutual labels:  apollo, apollo-client
github-react-native-apollo-graphql
πŸ“± A GitHub mobile app built with React-Native and Apollo GraphQL
Stars: ✭ 24 (+26.32%)
Mutual labels:  apollo, apollo-client
graphql-workshop
βš’ 🚧 A GraphQL workshop to learn GraphQL implementations
Stars: ✭ 20 (+5.26%)
Mutual labels:  apollo, apollo-client
apollo-fragment
Use Apollo Link State to connect components to GraphQL fragments in the Apollo Cache
Stars: ✭ 112 (+489.47%)
Mutual labels:  apollo, apollo-client
les-chat
Real-time messenger with private, public & group chat. Made using PERN + GraphQL stack.
Stars: ✭ 48 (+152.63%)
Mutual labels:  apollo, apollo-client
nap
[Deprecated] NextJS + Apollo + PassportJS
Stars: ✭ 52 (+173.68%)
Mutual labels:  apollo, apollo-client
RxApolloClient
RxSwift extensions for Apollo Client
Stars: ✭ 46 (+142.11%)
Mutual labels:  apollo, apollo-client
boilerplate
Boilerplate for @prisma-cms
Stars: ✭ 22 (+15.79%)
Mutual labels:  apollo, apollo-client
gitstar
Github Client built with React Apollo
Stars: ✭ 15 (-21.05%)
Mutual labels:  apollo, apollo-client
bookshelf
My GraphQL playground
Stars: ✭ 64 (+236.84%)
Mutual labels:  apollo, apollo-client
GitHunt-Polymer
An example of a client-side app built with Polymer and Apollo Client.
Stars: ✭ 13 (-31.58%)
Mutual labels:  apollo, apollo-client
agollo
πŸš€Go client for ctrip/apollo (https://github.com/apolloconfig/apollo)
Stars: ✭ 563 (+2863.16%)
Mutual labels:  apollo, apollo-client
apollo-local-query
Simpler server rendering with apollo-client 1.x, using a local GraphQL networkInterface
Stars: ✭ 66 (+247.37%)
Mutual labels:  apollo, apollo-client

CircleCI Codacy Badge Codacy Badge License: GPL v3

A data-driven workout tracking tool for the quantified-self πŸ€“.

NOTE: This is the core, open sourced version, of FitTrak and may be lagging behind the deployed version at https://fittrak.ca!

fittrak-mobile 2019-09-29-113950_1899x1081_scrot


Requirements

For local dev you'll require:

Back-end

The back-end consists of a Django powered Python application which exposes a GraphQL API using Graphene. Django is being used to deal with authentication, and other various functions, and as such there are some views which are rendered from Django. You may think of Django as rendering the template which houses the front-end SPA.

Front-end

The front-end is a Vue powered Javascript application which uses Apollo as a GraphQL client. When deployed in production this simply makes API calls to /graphql and benefits from the rest of the Django machinery.

NOTE: For local dev the back-end must be up and running as that is where the API (GraphQL server) runs (requests to /graphql will fail otherwise!) Authentication is based on sessions with IDs stored on cookies, which will be on localhost in dev, this works fine as only the ports change between the two servers. Keep an eye out for issues pertaining to authentication as the default behaviour, at the moment, is to return a 302, rediret to /login, which will present an error on the front-end console.


Development

Clone the repo:

git clone [email protected]:tsoporan/fittrak.git && cd fittrak

Back-end

The preferred way to bring up the stack is using Docker and docker-compose.

cd fittrak
# Bring up only the API to run migrations
docker-compose up
docker-compose run api python fittrak/manage.py migrate

# Create the first user (admin)
docker-compose run api python fittrak/manage.py createsuperuser

You can also run everything independently, which would require: postgresql, python3.7 and pipenv.

With docker we can conveniently package these up and not worry about external deps.

NOTE: When running independently make sure you're aware of the env variables required (check env.example and set .env)

There are two services that comprise the back-end: api and fittrak_db. docker-compose up brings them all up though you may start each one with their respective docker-compose up <service_name> command.

It is also useful to know how to work with docker and docker-compose, in general, as you may need to rebuild and interact with containers during dev.

Front-end

Using npm:

cd fittrak-client && npm install

export VUE_API_URL=http://localhost:8000/graphql

npm run serve

Migrations

To apply DB migrations we can run a command in the container:

  • docker-compose run api python fittrak/manage.py makemigrations
  • docker-compose run api python fittrak/manage.py migrate

Tests

Tests can be run with the usual:

  • docker-compose run api python fittrak/manage.py test
  • npm run test:unit

Deployment

Firstly check how the app behaves in production mode:

# Build production bundle

cd fittrak-client
NODE_ENV=production npm run build

# This will dump the assets in ../fittrak/assets which will be picked up
# by the "render_bundle" template tag in Django

# Set DEBUG to "False" in docker-compose
docker-compose up

# Visit http://localhost:8000

The application currently sits on a GCP VM and uses Cloud SQL (PostgreSQL 9.6). SSL is through LetsEncrypt and the Nginx Certbot

Future plans may include IaC, and moving to a more robust container solution, such as k8s, though it's fairly overkill at the moment.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].