Skip to content

SchoolOfCode/w9_backend-project-mindactivity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

List of Contents

  1. Introduction
  2. Environment Variables
  3. Run Locally
  4. How The Server Works
  5. Tech Stack
  6. Running Tests
  7. Usage Examples
  8. API References
  9. Appendix



About Mindactivity

Welcome to Mindactivity! Just in case you were curious about the name, mindfulness + productivity = mindactivity. It's a Mindfullness App designed to manage stress levels and increase productivity using meditative media.

This documentation is for the backend of the Mindactivity app. If you're interested in the frontend specifically, go to [https://github.com/SchoolOfCode/w9_frontend-project-mindactivity]




To run this backend repository, please create a .env file in the root of the folder and inside, add your credentials in the following order; (these credentials can be found in your Heroku credential settings)

DATABASE URI =

however, if you would prefer, you can also use this format instead;

PGHOST=

PGUSER=

PGDATABASE=

PGPASSWORD=

PGPORT=

Please note: If you choose to use this format, ensure to uncomment the commented out code in db/index.js




Run Locally 🏃‍♀️

Navigate to where you would like to save the project

  cd <chosen directory>

Clone the project

  git clone https://github.com/SchoolOfCode/w9_frontend-project-mindactivity.git

Navigate into the project directory

  cd w9_frontend-project-mindactivity

Install dependencies

  npm install (or npm i)



How the server works 🌐

Make sure you're inside the project directory (follow 'Run Locally' section)

To start the server

  npm run dev
  • The server should be running at http://localhost:3001
  • The server will update automatically to any changes, you don't need to close it everytime you wish to make a change

To close the server, press the following keys; (make sure you're inside the terminal)

  ctrl C



Tech Stack ⚙️

Engine: Node.js

Dev Dependencies: Nodemon, Babel, Jest, Supertest, Dotenv

Dependencies: Express, PostgreSQL, Cors, Morgan

Data storage: Heroku




Running Tests 🃏

To run tests, run the following command

  npm run test (or npm t)



Usage/Examples 🔬

Here are some basic examples of how to use this API:

You can set up some custom scripts to run specific files inside this project;

Scripts can be found inside of the package.json file

Examples of scripts:

Create a table

"db:createAffirmationsTable": "node -r dotenv/config ./db/scripts/createAffirmationsTable.js"

Populate the table:

"db:populateAffirmationsTable": "node -r dotenv/config ./db/scripts/populateAffirmationsTable.js"

Example of how to run these scripts: Creates a table in Heroku

npm run db:createAffirmationsTable

Populate a table in Heroku

npm run db:populateAffirmationsTable



API reference list 🔎

For Affirmations:

To get all the Affirmations:

http://localhost:3001/v1/mindactivity

To get Affirmations by specific ID:

http://localhost:3001/v1/mindactivity/<ID>

For Blogs:

To get all the Blogs:

http://localhost:3001/v1/blogs



Appendix 📝

Here are some links to documentation that could be helpful with using this server:

About

w9_backend-project-mindactivity created by GitHub Classroom

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •