Code Monkey home page Code Monkey logo

tech-crafted-events's Introduction

Tech Crafted

Tech Crafted is an open-source university event management website crafted by three friends passionate about development. Built with PHP, Laravel, JS, HTML, CSS, Bootstrap, Postgresql, and Docker, our platform aims to enhance development skills while providing an intuitive and scalable solution for event organizers.

Video

Index

Introduction

This README describes how to setup the development environment for Tech Crafted.

These instructions address the development with a local environment (with PhP installed) and Docker containers for PostgreSQL and pgAdmin.

Installing the software dependencies

To prepare you computer for development you need to install PHP >=v8.1 and Composer >=v2.2.

We recommend using an Ubuntu distribution that ships with these versions (e.g Ubuntu 22.04 or newer). You may install the required software with:

sudo apt update
sudo apt install git composer php8.1 php8.1-mbstring php8.1-xml php8.1-pgsql php8.1-curl php-gd

On MacOS, you can install them using Homebrew and:

brew install [email protected] composer

If you use Windows WSL, please ensure you are also using Ubuntu 22.04 inside. Previous versions do not provide the requirements needed for this template, and then follow the Ubuntu instructions above.

Setting up the development repository

You should clone our repository to your local machine.

git clone https://git.fe.up.pt/lbaw/lbaw2324/lbaw2316.git

cd lbaw2316

Installing local PHP dependencies

After the steps above, you will have updated your repository with the required Laravel structure from this repository. Afterwards, the command bellow will install all local dependencies.

composer update

If this fails, ensure you're using version 2 or above of Composer. If there are errors regarding missing extensions, make sure you uncomment them in your php.ini file.

Working with PostgreSQL

We've created a docker compose file that sets up PostgreSQL and pgAdmin4 to run as local Docker containers.

From the project root issue the following command:

docker compose up -d

This will start your containers in detached mode. To stop them use:

docker compose down

Navigate on your browser to http://localhost:4321 to access pgAdmin4 and manage your database. Depending on your installation setup, you might need to use the IP address from the virtual machine providing docker instead of localhost. Please refer to your installation documentation. Use the following credentials to login:

Email: [email protected]
Password: pg!password

On the first usage you will need to add the connection to the database using the following attributes:

hostname: postgres
username: postgres
password: pg!password

Hostname is postgres instead of localhost since Docker Compose creates an internal DNS entry to facilitate the connection between linked containers.

Starting the service

Com todas as configurações definidas, agora podemos iniciar o servidor laravel

To start the server from the project's run:

# Used to apply migrations, which are instructions in PHP code that define the structure of the database
php artisan migrate

# Seed database from the SQL file.
# Needed on first run and every time the database script changes.
php artisan db:seed

# Start the development server
php artisan serve
# To update javascript libraries
npm install

# Used to start a local development environment
npm run dev

Access http://localhost:8000 to access the app. Username is [email protected], and password admin123. These credentials are copied to the database on the first instruction above.

To stop the server just hit Ctrl-C.

Configuration

Laravel configurations are acquired from environment variables. They can be available in the environment where the Laravel process is started, or acquired by reading the .env file in the root folder of the Laravel project. This file can set environment variables, which set or override the variables from the current context. You will likely have to update these variables, mainly the ones configuring the access to the database, starting with DB_.

You must manually create a schema that matches your username.

Note that you can make your local application use the remote database by simply changing the .env file accordingly.

If you change the configuration, you might need to run the following command to discard a compiled version of the configuration from Laravel's cache:

php artisan route:clear
php artisan cache:clear
php artisan config:clear

Image

To build the project image, you can use the Dockerfile.

sudo docker build --tag techcrafted:latest .

To create a container from the project image:

sudo docker run --name tech-crafted-service -d -p 8000:80 techcrafted:latest

This will start a local nginx service on port 8000 for Tech Crafted.

Team

tech-crafted-events's People

Contributors

duardoliveiras avatar vicente-md avatar brito-bernardo avatar

Stargazers

 avatar

Watchers

 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.