Giter Site home page Giter Site logo

samfundet / samfundet4 Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 2.0 78.92 MB

The new website for Samfundet

License: MIT License

Shell 1.92% Dockerfile 0.15% Python 38.72% HTML 0.04% TypeScript 48.56% SCSS 10.19% JavaScript 0.41%
django django-rest-framework guardian python python3 react reactjs student-project web web-application website

samfundet4's Introduction

samfundet-screenshot

Build Status



Installation

Follow the steps below in order to setup our project locally.

For macOS users: You can try running make setup-mac in the root directory. That command will essentially do everything that this README tells you do to, but we can't guarantee that it works.



Complete installation for MacOS / Ubuntu

A Github Personal Access Token (PAT) is required to run this script. You can make one here https://github.com/settings/tokens/new. Tick scopes repo, read:org and admin:public_key), then store the token somewhere safe (Github will never show it again).

Copy these commands (press button on the right-hand side of the block) and run from the directory you would clone the project.

Non-interactive

read -s -p "Github PAT token: " TOKEN ; X_INTERACTIVE=n /bin/bash -c "$(curl -fsSL https://$TOKEN@raw.githubusercontent.com/Samfundet/Samfundet/master/{bash_utils.sh,install.sh})" && . ~/.bash_profile && cd Samfundet ; unset TOKEN ; unset X_INTERACTIVE;

Interactive

read -s -p "Github PAT token: " TOKEN ; X_INTERACTIVE=y /bin/bash -c "$(curl -fsSL https://$TOKEN@raw.githubusercontent.com/Samfundet/Samfundet/master/{bash_utils.sh,install.sh})" && . ~/.bash_profile && cd Samfundet ; unset TOKEN ; unset X_INTERACTIVE;
  • X_INTERACTIVE (y/n) determines how many prompts you receive before performing an action.
  • Fetches files {bash_utils.sh, install.sh} and runs bash.
  • f: fail fast
  • s: silent, no progress-meter
  • S: show error on fail
  • L: follow redirect


Clone

Clone our main repository:

git clone https://github.com/Samfundet/Samfundet.git

We also use two other repositories, SamfundetAuth and SamfundetDomain. These can be cloned with the following commands:

# SamfundetAuth
git clone https://github.com/Samfundet/SamfundetAuth.git

# SamfundetDomain
git clone https://github.com/Samfundet/SamfundetDomain.git


Dependencies

There are several dependencies needed to get Samfundet up and running. Note that RVM is a Ruby version manager used for handling different Ruby versions, but you can use others as well (like rbenv).


macOS:

  1. Homebrew: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  2. imagemagick: brew install imagemagick
  3. graphviz: brew install graphviz
  4. RVM


Linux:

Option 1 (Automatic)
  1. Go to your terminal preferences, and select your terminal profile. Go to the "Commands" tab and check "Run command as a login shell".
Screenshot 1
Screenshot 2

  1. Make sure you have navigated to the project directory in the terminal. Then run the following script: (copy and paste into terminal)

    ./linux-prerequisites.sh

    This will make a script run, that will install a few dependencies for you. A restart is however required after running this script, so restart your computer before proceeding to step 3.

  2. Navigate back to the project and run the following script:

    ./linux-setup-rvm.sh

    A restart is also required after running this script. Restart before proceeding to step 4.

  3. Navigate back to the project and run the following script:

    ./linux-setup-database.sh

    After this script has completed, the project should be up and running!


Option 2 (Manual)
  1. graphviz: sudo apt-get install graphviz
  2. imagemagick: sudo apt-get install imagemagick
  3. nodejs: sudo apt-get install nodejs
  4. ubuntu_rvm
  5. Source RVM: source ~/.rvm/scripts/rvm

We now have all dependencies installed, including RVM, so let's install Ruby 2.7.6. Run these two commands in succession:

rvm install 2.7.6 --movable
rvm use 2.7.6 --default



Setup database

We use PostgreSQL as our database. There are several ways it can be installed depending on your operating system.


Linux:

Option 1 (manually)
  • Install PostgreSQL:
    sudo apt-get install postgresql postgresql-contrib libpq-dev
  • Create the PostgreSQL user:
    echo -e "CREATE USER samfundet WITH PASSWORD 'samfundet';\nALTER USER samfundet CREATEDB;" | sudo -u postgres psql
Option 2 (Docker)
  1. Install Docker Engine and Docker Compose.
  2. Start the database: docker-compose up -d
  3. Install PostgreSQL: sudo apt-get install libpq-dev


macOS:

Option 1 (PostgreSQL macOS application)

Option 2 (Docker)
  1. Install Docker: brew cask install docker
  2. Start the database: docker-compose up -d
  3. Install PostgreSQL: brew install postgresql



Ruby dependencies (gems)

Samfundet depends on several Ruby dependencies called gems that are listed in our Gemfile. To install these, run

bundle install # or just 'bundle' or 'bundler'

Configure database

First, there are some configuration files that needs to be copied. Run

make copy-config-files

Then, setup the database with

bundle exec rails db:setup


Start the development server

You are now ready to start the server. Run

make run # which executes 'bundle exec rails server'



Git hooks

You can optionally add checks before commits et cetera through git/hooks. To apply them run

make git-hooks

This will add symbolic links in .git/hooks from the hooks dir.

License

MIT © Samfundet.no project authors

samfundet4's People

Contributors

amaliejvik avatar atrueyety avatar dependabot[bot] avatar eiriksho avatar emilte avatar evgiz avatar frenje123 avatar hei98 avatar johanned avatar johannegg avatar kaholaz avatar kevinkaffe avatar magsyg avatar marionlys avatar mathias-a avatar robines avatar simensee avatar sindrelothe avatar snorre98 avatar snorrekr avatar tiniusp avatar tiniuspre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

kaholaz

samfundet4's Issues

Checkbox

Create reusable checkbox component

Create front page skeleton

The front page skeleton should define the main "layout" but rely mostly on reusable components

Should include things like:

  • Navbar
  • Front image
  • Events
  • Open hours
  • Footer

Since these components are not implemented yet, we can use temporary "skeletons" meanwhile, the main goal is to have some kind of landing page template that we can expand and improve on in the future.

The design does not need to be identical to the current one, but we should use some time to discuss design and general UX later.

Discuss image formats with Layout

The current event images use a very wide layout that is (as far as I know) different from every other format used in other settings.

We don't really need to use this type of format. A more square format is appropriate for the front-page for instance.

We should discuss this with layout to minimize the extra work necessary from their end while maximizing our options in the front-end.

Add favicon

Fix favicon, logo, manifest and other needed files.

Create event component for front-page

Event component for front page.

Something like this:

Screenshot 2022-10-06 at 21 00 27

  • Should accept an "event" object (not implemented yet, use dummy data).
  • Needs to support image, title, short description, time etc.
  • Would also be nice to have different sizes/options but this is secondary
  • Look can be different from the old one - go wild!

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.