/website-factory

Primary LanguagePHPMozilla Public License 2.0MPL-2.0

Website Factory

GitHub contributors GitHub last commit License: MPL 2.0

Code4ro presentation website

Contributing | Built with | Development | Deployment | Feedback | License | About Code for Romania

Contributing

This project is built by amazing volunteers and you can be one of them! Here's a list of ways in which you can contribute to this project.

Built with

  • Laravel
  • Tailwind CSS
  • Inertia.js
  • Vue.js
  • Alpine.js

Requirements

  • PHP 8.2
  • Nginx
  • PostgreSQL 14+

Development

This project uses Laravel Sail, Laravel's default Docker development environment.

After running the initial setup, run this command to start up the environment:

./vendor/bin/sail up -d

and then this command to rebuild the css / js assets on change:

./vendor/bin/sail npm run dev

Initial setup

  1. Install composer dependencies
docker run --rm -v ${PWD}:/app -w /app composer:latest composer install --ignore-platform-reqs --no-scripts --no-interaction --prefer-dist --optimize-autoloader
  1. Copy the environment variables file
cp .env.example .env
  1. Start the application
./vendor/bin/sail up -d
  1. Install npm dependencies
./vendor/bin/sail npm ci
  1. Build the frontend
./vendor/bin/sail npm run build
  1. Generate the app secret key
./vendor/bin/sail artisan key:generate
  1. Migrate and seed the database
./vendor/bin/sail artisan migrate:fresh --seed
  1. Access the admin panel in your browser at https://localhost:8080/admin and log in with the default credentials:
    • Email: admin@example.com
    • Password: password

For more information on Laravel Sail, check out the official documentation.

Deployment

The fastest way to deploy Website Factory is by using our first-party Docker image.

Prerequisites

Generate an application key

Before deploying Website Factory, make sure you generate a valid application key. If you are not sure what an application key is, you can read more about it here: APP_KEY And You blog post on Tighten's website.

To generate an application key, you can run the following command in your terminal.

docker run --rm -it code4romania/website-factory php artisan key:generate --show

The generated application key will look like this:

base64:yEtz1eacKMwq0iVT5BUjMMvcn4OAD7QpCgz1yDoXroE=

Running the image

Download the example docker-compose.yml and configure the environment variables. Here's where you use the APP_KEY generated earlier. After you're done, save the file and run it with:

docker-compose up -d

You should now be able to access your instance admin area by visiting <your-ip>:8080/admin and logging in with the ADMIN_EMAIL and ADMIN_PASSWORD you specified in the configuration.

Deployment on AWS / Microsoft Azure with terraform

We maintain two separate terraform repositories for Website Factory. To learn more about the infrastructure we provisioned for Website Factory on these cloud providers, please check their respective repositories:

Feedback

  • Request a new feature on GitHub.
  • Vote for popular feature requests.
  • File a bug in GitHub Issues.
  • Email us with other feedback contact@code4.ro

License

This project is licensed under the MPL 2.0 License - see the LICENSE file for details

About Code for Romania

Started in 2016, Code for Romania is a civic tech NGO, official member of the Code for All network. We have a community of over 500 volunteers (developers, ux/ui, communications, data scientists, graphic designers, devops, it security and more) who work pro-bono for developing digital solutions to solve social problems. #techforsocialgood. If you want to learn more details about our projects visit our site or if you want to talk to one of our staff members, please e-mail us at contact@code4.ro.

Last, but not least, we rely on donations to ensure the infrastructure, logistics and management of our community that is widely spread across 11 timezones, coding for social change to make Romania and the world a better place. If you want to support us, you can do it here.