npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fccc-server

v1.32.0

Published

FCCC Health

Downloads

4

Readme

FCCC Health Practice Software

What is this repository for?

This is the Backend API server for the FCCC software application, it hosts API endpoints, database functionality and other important related features that are needed for the FCCC software application.

Getting Started

Requirements

  • Node Version 12.18.3 : You can download Node from the official Node.js webpage.
  • MySQL Version 5.7 : It is important that your MySQL version matches that of the application in order to avoid some issues. You can get this particular version from the official MySQL webpage.
  • Redis Server ^5.0.4 : Make sure you have a redis server setup locally otherwise download & setup.

Node Environment

You need to create environmental variables to hold specific information that the application will need, you can do this by creating a .env file in the root project directory. There are also important keys in the .env.sample file, add these keys in your .env file and provide adequate values, they are necessary for the application to work.

Install Packages

Install the necessary packages for the application by running the following code in your terminal:

$ npm run install-local

Note : You must install peer dependencies manually, they are found under peerDependencies in the package.json file.

Database Configurations

Install knex CLI - Optional

Knex is an SQL query builder for Node.js and will be used for building MySQL queries in this application, so get that installed by running:

$ npm install knex -g
Migrating database

Create a database manually called betaquick_fccc. To migrate the database, run:

npm run migrate

or switch to the db directory and run:

knex migrate:latest --env development

You also need to seed the database with necessary data:

npm run seed

With that done, your created database should have been populated with necessary data needed by the application. Remember to add the necessary database information such as username, password, host and port into your .env file.

Run server

Start up the application server by running:

$ npm run dev

Setting up the Docker Image

Make sure you have Docker and Docker-compose installed locally, there are links below on how to setup docker locally depending on your operating system:

When that's done, make sure docker is up and running and then through your terminal navigate to the fccc-server project directory, Run the following commands to build and start the image: To build the image, in your terminal run:

$ docker-compose build

When the image is successfully built, you can start it up by running the following:

$ docker-compose up

Project Structure and Documentation

Project Structure

  • All database related configurations such as backups, seed, migration data, etc... are situated in the db folder.
  • All API endpoints can be located in app/config/routes.js.
  • Controllers and services are found in app/controllers and app/services directories respectively.
  • Database models are found in the app/models directory. This application uses an ORM Objection.js for modelling the DB, Objection.js is built upon the Knex query builder.

Documentation

The documentation for the API endpoints is generated using Postman and can be found at the following Postman URL. You need to import the collection into your Postman environment to be able to make changes to it. Whenever you add a new endpoint, make sure to update the collection and documentation with the new changes. Also when updating the collection, try to add example responses for each endpoint.

Test Coverage

The Mocha library and other packages are used for testing parts of the application, all tests can be found in the test directory. You can execute tests by running the command below:

$ npm run test-coverage

Contribution guidelines

  • 100% test coverage is important before pushing to the remote origin.
  • All PR submitted should include a 100% test coverage.
  • Do not comment out codes, delete them instead.
  • Maintain the projects style of code.

Who do I talk to?

  • Repo owner or admin
  • Other community or team contact

Troubleshooting

  1. On MySQL Versions other than 5.7, you may run into an error when trying to migrate or seed the database : ER_TRUNCATED_WRONG_VALUE: Incorrect date value...

    Try one or more of the following methods to fix the problem :

    • Upgrade/downgrade your MySQL version to 5.7

    • Paste the following code at the bottom of your MySQL config file my.cnf(my.ini for windows) : set @@sql_mode='no_engine_substitution';

    • In your MySQL shell, run the following code: select @@sql_mode; SET GLOBAL sql_mode = 'NO_ENGINE_SUBSTITUTION'; SET SESSION sql_mode = 'NO_ENGINE_SUBSTITUTION'; Note : Using this method you may need to run it everytime you restart your MySQL server.

  2. When you pull changes from the remote origin, it is possible that changes/additions have been made to the database tables and seed files, this may cause errors when running the application or when running tests. Such errors can be fixed by migrating your database and seeding it with latest data:

    $ npm run migrate
    $ npm run seed
  3. Follow this guide to install redis on Windows