amycommits / civic_hacking_hub

A place where people can find nonprofits to code for.
2 stars 13 forks source link
hacktoberfest hacktoberfest2021 nuxt nuxtjs vue

civic-hacking-hub

Civic Hacking is when you use your skills to build tools for non-profits that may not otherwise be able to afford it.

This repo exists because I believe that it should be easier to find these types of projects.

Build setup

Database setup

civic-hacking-hub uses a relational database (postgresql) to store data. You can download postgresql here.

After download postgresql you need to create the database:

    $ psql -U postgres
    $ CREATE DATABASE civic_hacking;

Application database configurations

Like a best practice, all database configurations are externalized from the application:

An app’s config is everything that is likely to vary between deploys (staging, production, developer environments, etc). This includes: Resource handles to the database, Memcached, and other backing services. See 12factor for more details.

Creating secret.js file

Is necessary to create a secret.js (used by knexfilex.js) file in root folder, you can do easily running this command:

    $ cp secrets.example.js secrets.js

Configuring database credentials

You have two ways to configure your database credentials:

How you can see, env vars has precedence, if you use both configurations env var will win, we recommend using env vars.

Using with docker 🐋

  1. build the compose file🐋

    docker-compose -f docker-compose.yml up -d --build

    This will build postgres, pgadmin and the nuxt app

  2. Run The migrations and the seeder 🌱

    docker-compose exec nuxt-app npx knex migrate:latest

    docker-compose exec nuxt-app npx knex seed:run

  3. Run the app on your localhost:3000

    You can also open localhost:5050 to manage postgres database with pgadmin (credentials on docker-compose.yml file)

Dependencies

Be on node version v12.21.0

$ nvm use v12.21.0

# install dependencies
$ npm run install
$ knex migrate:latest
$ knex seed:run

# serve with hot reload at localhost:3000
$ npm run dev

# build for production and launch server
$ npm run build
$ npm run start

# generate static project
$ npm run generate

For detailed explanation on how things work, check out Nuxt.js docs.

Contributing

Look for the Contributions.md file.

Contact

Discord: amyd - 40#2999