GithubHelp home page GithubHelp logo

raeintech / dev-directory Goto Github PK

View Code? Open in Web Editor NEW

This project forked from windyscripts/dev-directory

0.0 0.0 0.0 185 KB

JavaScript 11.04% TypeScript 88.73% CSS 0.07% Dockerfile 0.13% Procfile 0.03%

dev-directory's Introduction

Dev Directory

This is a service for a community of devs to network, built by 100Devs for 100Devs. Discussion can be found on the Discord Thread.

Developing

Git Conventions

Message Tim on Discord if you want to be added as a collaborator.

Branch names should be #issuenumber-shortname e.g. #2-discord-auth or #4-profile-schema. If the branch is not associated with an issue, use your initials instead e.g. tc-fix-profiles.

Prerequisites

  1. Git
  2. Node.js v18.14.0 or nvm
  3. Docker (preferred) or a Postgres server

Setup Instructions

  1. Fork the project's repository on GitHub and clone it to your local system using Git.
    git clone [email protected]:timmyichen/dev-directory.git
  2. Navigate to the project directory in your terminal.
    cd dev-directory
  3. If using Docker, ensure Docker is running and run dependencies
    npm run docker:deps

    If you're NOT using Docker, be sure to start your Postgres server.

  4. Ensure you are on Node v18.14.0. If you are using NVM, you can run the following to automatically use the correct version.
    nvm use
  5. In a new terminal, run the command npm ci to install all the necessary packages for the project.
  6. Copy .env.sample to .env and configure it for your local environment.
  7. If it's your first time setting it up, run migrations:
npm run sequelize-cli db:migrate

If you get the error: 'password authentication failed for user "postgres"' while using docker, check to see if postgres is already installed on your computer. If it is, it may interfere with our default docker configuration. If you are familiar with port mapping, you can change the port postgres is using. Otherwise, uninstalling postgres will solve the error.

  1. Run npm run dev to start the development server.

That's it! You're now ready to start working on the project.

If using Docker, you can run docker:db to log into the Postgres CLI.

Migrations

When making changes to a model's properties or the database schema, you'll need to create a migration. You can do so via the Sequelize CLI (replace name-of-migration):

npm run sequelize-cli migration:generate --name name-of-migration

Edit the migration - see more detailed docs here

To run migrations:

npm run migrate

To rollback the last-run migration:

npm run migrate:undo

Testing

We use jest for unit testing on the client and server, and for acceptance tests on the server in conjunction with supertest.

Run all tests with:

npm run test

You can also run a single test:

npm run test -- auth.test.ts

You can run in watch mode, which is useful for when you're developing/writing the tests:

npm run test:watch -- auth.test.ts

UI Testing

We use Cypress for UI testing.

To run tests manually:

  • Execute npm run cypress:open
  • Select E2E testing
  • Choose a browser
  • Select the test spec you wish to run

You may also run Cypress tests from the CLI with: npm run cypress

Deployment

We have a CI/CD pipeline that will automatically deploy to a staging app on Heroku. The flow is:

  • A PR is merged to main
  • Lint, Type Checking, and Tests are run
  • If passed, heroku automatically builds the app:
    • By running next build, and
    • Compiling the server into JS
  • Migrations are then run against the staging database
  • This is then deployed onto a Basic Heroku dyno at the link below

If at any point any of these steps fail, it will not continue.

The staging app behaves exactly like the production app, but should not be used as the production app since data may be deleted from it at any point.

The production app will eventually require a manual deploy but staging can be used as a way to test features in a production environment using "production" data.

   _--_                                    _--_
 /#()# #\                                /# #()#\
 |()##  \#\_       \           /       _/#/  ##()|
 |#()##-=###\_      \         /      _/###=-##()#|
  \#()#-=##  #\_     \       /     _/#  ##=-#()#/
   |#()#--==### \_    \     /    _/ ###==--#()#|
   |#()##--=#    #\_   \!!!/   _/#    #=--##()#|
    \#()##---===####\   X|X   /####===---##()#/
     |#()#____==#####\ / Y \ /#####==____#()#|
      \###______######|\/#\/|######______###/
         ()#O#/      ##\_#_/##      \#O#()
        ()#O#(__-===###/ _ \###===-__)#O#()
       ()#O#(   #  ###_(_|_)_###  #   )#O#()
       ()#O(---#__###/ (_|_) \###__#---)O#()
       ()#O#( / / ##/  (_|_)  \## \ \ )#O#()
       ()##O#\_/  #/   (_|_)   \#  \_/#O##()
        \)##OO#\ -)    (_|_)    (- /#OO##(/
         )//##OOO*|    / | \    |*OOO##\\(
         |/_####_/    ( /X\ )    \_####_\|
        /X/ \__/       \___/       \__/ \X\
       (#/                               \#)

dev-directory's People

Contributors

caleb-cohen avatar devinclane avatar devonzara avatar jmoldyvan avatar mainlycolors avatar matthewbozin avatar timmyichen avatar ujwalkumar1995 avatar windyscripts avatar

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.