This is the repo for the old version of SpaceX Stats. To access the new repo, see spacexstats-react.
A fan website for the company SpaceX originally created by Luke Davia (Twitter, Reddit).
The project will be installed on a Vagrant virtual machine. All the dev tools will be install inside it.
- In the project directory, run the
vagrant up
command. - Import a copy of the database in your project folder (you can get one by asking the admins). Then get into your Vagrant machine with
vagrant ssh
. Finally, import the database backup withmysql -u spacexstats -pspacexstats spacexstats < database.sql
. - Add this line to your hostfile (
/etc/hosts
on Linux/Mac,C:\Windows\system32\drivers\etc\hosts
on Windows):33.33.33.33 spacexstats.dev
. The project is now accessible by going tohttp://spacexstats.dev
!
Remember, when you stop working on the project you can stop the Vagrant box with vagrant halt
. You can delete it with vagrant destroy
.
When editing JS, CSS, etc files, you'll use gulp to compile these assets. On your Vagrant machine, you just have to run npm start
.
php artisan cache:clear
clears the laravel cache, useful after db changes that you want to see reflected immediately. May affect site performance as cache is rebuilt. php artisan view:clear
clears the cache for the views.
Deployment is done via SFTP using WinSCP (only works from windows currently).
- Modify sftp_deploy_example.txt with your SFTP connection info (username, password, rsa key) and save the file as sftp_deploy.txt.
- In the command prompt, simply type
deploy
and all files will be copied to the server
- PHP 5.3 or above
- MySQL server
- Redis (if running locally, installation depends on your OS. Google is your friend)
- Composer installation instructions here
- Laravel installation instructions here
- Make sure all prereqs are installed / available. In the case of MySQL, just make sure you have access to a server if you don't have one installed locally.
- Open command prompt and navigate to the code folder. run the command
composer install
. This will install all dependecies listed in the composer.json file. - Make a copy of the ".env.example" file and name it ".env". This file handles some config values.
- In the .env file:
- set your MySQL connection info (host, username, password).
- set your Redis host and port (in the case of a local redis install, you can use 127.0.0.1 and port 6379).
- Now we need to seed the database. To do so, run this command:
php artisan migrate:refresh --seed
. You will get a few prompts asking if you're really sure about this, answer yes to all. - If all went well, you should now be able to run the site. If you're already running IIS or Apache, you can access the site locally like you would access any normal site. If not, you can run the command
php artisan serve
to spin up a local server on port 8000.
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license.